Skip to content

Commit 8bbbdbe

Browse files
Fix
1 parent cf66f03 commit 8bbbdbe

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Symfony/Component/Config/Resource/ReflectionClassResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ private function generateSignature(\ReflectionClass $class)
197197
} else {
198198
$t = \PHP_VERSION_ID >= 70000 ? $p->getType() : '';
199199
$stack[] = $p->isOptional();
200-
$stack[] = $t instanceof \ReflectionNamedType ? $t->getName() : (string) $t;
200+
$stack[] = $t instanceof \ReflectionNamedType ? ((string) $t->allowsNull()).$t->getName() : (string) $t;
201201
$stack[] = $p->isPassedByReference();
202202
$stack[] = \PHP_VERSION_ID >= 50600 ? $p->isVariadic() : '';
203203
$stack[] = $p->getName();

src/Symfony/Component/DependencyInjection/Compiler/FactoryReturnTypePass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private function updateDefinition(ContainerBuilder $container, $id, Definition $
9393

9494
$returnType = $m->getReturnType();
9595
if (null !== $returnType && !$returnType->isBuiltin()) {
96-
$returnType = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : $returnType->__toString();
96+
$returnType = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType;
9797
if (null !== $class) {
9898
$declaringClass = $m->getDeclaringClass()->getName();
9999
if ('self' === strtolower($returnType)) {

src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbs
105105
if (!$type = $parameter->getType()) {
106106
return null;
107107
}
108-
$name = $type instanceof \ReflectionNamedType ? $type->getName() : $type->__toString();
108+
$name = $type instanceof \ReflectionNamedType ? $type->getName() : (string) $type;
109109
if ('array' === $name && !$type->isBuiltin()) {
110110
// Special case for HHVM with variadics
111111
return null;

src/Symfony/Component/OptionsResolver/OptionsResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ private function getParameterClassName(\ReflectionParameter $parameter)
10761076
return ($class = $parameter->getClass()) ? $class->name : null;
10771077
}
10781078

1079-
if (!($type = $parameter->getType()) instanceof \ReflectionNamedType || $type->isBuiltin()) {
1079+
if (!($type = $parameter->getType()) || $type->isBuiltin()) {
10801080
return null;
10811081
}
10821082

0 commit comments

Comments
 (0)