10000 bug #33626 [PropertyInfo] ensure compatibility with type resolver 0.5… · symfony/symfony@6fad4f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6fad4f1

Browse files
committed
bug #33626 [PropertyInfo] ensure compatibility with type resolver 0.5 (xabbuh)
This PR was merged into the 3.4 branch. Discussion ---------- [PropertyInfo] ensure compatibility with type resolver 0.5 | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | same as #33588 but for the `3.4` branch Commits ------- 2d708b3 ensure compatibility with type resolver 0.5
2 parents ac7b2b4 + 2d708b3 commit 6fad4f1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ public function getTypes(DocType $varType)
5555

5656
$varTypes = [];
5757
for ($typeIndex = 0; $varType->has($typeIndex); ++$typeIndex) {
58-
$varTypes[] = (string) $varType->get($typeIndex);
58+
$nestedVarType = $varType->get($typeIndex);
59+
60+
if ($nestedVarType instanceof Nullable) {
61+
$varTypes[] = (string) $nestedVarType->getActualType();
62+
$nullable = true;
63+
} else {
64+
$varTypes[] = (string) $nestedVarType;
65+
}
5966
}
6067

6168
// If null is present, all types are nullable

0 commit comments

Comments
 (0)
0