Skip to content

Commit 69f23ca

Browse files
authored
Merge pull request microsoft#355 from PythooonUser/feature/issue-225
Error when calling getNamespaceDefinition on SourceFileNode
2 parents 769b9d9 + 8fd46ab commit 69f23ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Node.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ public function getImportTablesForCurrentScope() {
584584
* @return NamespaceDefinition|null
585585
*/
586586
public function getNamespaceDefinition() {
587-
$namespaceDefinition = $this instanceof NamespaceDefinition
587+
$namespaceDefinition = ($this instanceof NamespaceDefinition || $this instanceof SourceFileNode)
588588
? $this
589589
: $this->getFirstAncestor(NamespaceDefinition::class, SourceFileNode::class);
590590

0 commit comments

Comments
 (0)