Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dd1b617

Browse filesBrowse files
Fix support for PHP8 union types
1 parent 2121c55 commit dd1b617
Copy full SHA for dd1b617

File tree

Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function registerContainerConfiguration(LoaderInterface $loader)
112112
throw new \LogicException(sprintf('"%s" uses "%s", but does not implement the required method "protected function configureContainer(ContainerConfigurator $c): void".', get_debug_type($this), MicroKernelTrait::class), 0, $e);
113113
}
114114

115-
$configuratorClass = $configureContainer->getNumberOfParameters() > 0 && ($type = $configureContainer->getParameters()[0]->getType()) && !$type->isBuiltin() ? $type->getName() : null;
115+
$configuratorClass = $configureContainer->getNumberOfParameters() > 0 && ($type = $configureContainer->getParameters()[0]->getType()) instanceof \ReflectionNamedType && !$type->isBuiltin() ? $type->getName() : null;
116116

117117
if ($configuratorClass && !is_a(ContainerConfigurator::class, $configuratorClass, true)) {
118118
$this->configureContainer($container, $loader);

‎src/Symfony/Component/DependencyInjection/Compiler/AutowireRequiredPropertiesPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/AutowireRequiredPropertiesPass.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function processValue($value, bool $isRoot = false)
4242

4343
$properties = $value->getProperties();
4444
foreach ($reflectionClass->getProperties() as $reflectionProperty) {
45-
if (!$reflectionProperty->hasType()) {
45+
if (!($type = $reflectionProperty->getType()) instanceof \ReflectionNamedType) {
4646
continue;
4747
}
4848
if (false === $doc = $reflectionProperty->getDocComment()) {
@@ -55,7 +55,7 @@ protected function processValue($value, bool $isRoot = false)
5555
continue;
5656
}
5757

58-
$type = $reflectionProperty->getType()->getName();
58+
$type = $type->getName();
5959
$value->setProperty($name, new TypedReference($type, $type, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, $name));
6060
}
6161

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.