Skip to content

Commit

Permalink
Merge pull request #32 from philwc/fix-type-bug
Browse files Browse the repository at this point in the history
Fix bug trying to call toString when type is a string
  • Loading branch information
dancryer committed Apr 18, 2019
2 parents 1d62ee0 + 889cfb2 commit ddd0bfc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/FileParser/FileParser.php
Expand Up @@ -14,6 +14,7 @@
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\Use_;
use PhpParser\NodeAbstract;
use PhpParser\Parser;

/**
Expand Down Expand Up @@ -119,7 +120,7 @@ protected function processStatements($file, array $statements, $prefix = '')

if ($type instanceof NullableType) {
$type = $type->type->toString();
} elseif ($type !== null) {
} elseif ($type instanceof NodeAbstract) {
$type = $type->toString();
}

Expand Down

0 comments on commit ddd0bfc

Please sign in to comment.