ensure compatibility with type resolver 0.5

This commit is contained in:
Christian Flothmann 2019-09-18 15:36:31 +02:00
parent d9ce895cee
commit 2d708b3e60

View File

@ -55,7 +55,14 @@ final class PhpDocTypeHelper
$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