Skip to content

Commit

Permalink
bug #33626 [PropertyInfo] ensure compatibility with type resolver 0.5…
Browse files Browse the repository at this point in the history
… (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
  • Loading branch information
fabpot committed Sep 18, 2019
2 parents ac7b2b4 + 2d708b3 commit 6fad4f1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php
Expand Up @@ -55,7 +55,14 @@ public function getTypes(DocType $varType)

$varTypes = [];
for ($typeIndex = 0; $varType->has($typeIndex); ++$typeIndex) {
$varTypes[] = (string) $varType->get($typeIndex);
$nestedVarType = $varType->get($typeIndex);

if ($nestedVarType instanceof Nullable) {
$varTypes[] = (string) $nestedVarType->getActualType();
$nullable = true;
} else {
$varTypes[] = (string) $nestedVarType;
}
}

// If null is present, all types are nullable
Expand Down

0 comments on commit 6fad4f1

Please sign in to comment.