Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

Commit ddd0bfc

Browse files
authored
Merge pull request #32 from philwc/fix-type-bug
Fix bug trying to call toString when type is a string
2 parents 1d62ee0 + 889cfb2 commit ddd0bfc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/FileParser/FileParser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PhpParser\Node\Stmt\ClassMethod;
1515
use PhpParser\Node\Stmt\Namespace_;
1616
use PhpParser\Node\Stmt\Use_;
17+
use PhpParser\NodeAbstract;
1718
use PhpParser\Parser;
1819

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

120121
if ($type instanceof NullableType) {
121122
$type = $type->type->toString();
122-
} elseif ($type !== null) {
123+
} elseif ($type instanceof NodeAbstract) {
123124
$type = $type->toString();
124125
}
125126

0 commit comments

Comments
 (0)