Skip to content

Commit

Permalink
Drop nullable types to be fixed later in #202
Browse files Browse the repository at this point in the history
  • Loading branch information
asgrim committed Dec 5, 2016
1 parent 106388a commit aec253e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/TypesFinder/FindTypeFromAst.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use BetterReflection\SourceLocator\Located\LocatedSource;
use phpDocumentor\Reflection\Types\ContextFactory;
use PhpParser\Node\Name;
use PhpParser\Node\NullableType;

class FindTypeFromAst
{
Expand All @@ -23,6 +24,12 @@ public function __invoke($astType, LocatedSource $locatedSource, $namespace = ''
$locatedSource->getSource()
);

// @todo Nullable types are effectively ignored - to be fixed
/* @see https://github.com/Roave/BetterReflection/issues/202 */
if ($astType instanceof NullableType) {
$astType = $astType->type;
}

if (is_string($astType)) {
$typeString = $astType;
}
Expand Down

0 comments on commit aec253e

Please sign in to comment.