Skip to content

Commit f7beb13

Browse files
authored
Do not process unknown hooked functions (#272)
1 parent fab61ad commit f7beb13

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/HookCallbackRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public function processNode(Node $node, Scope $scope): array
6666
return [];
6767
}
6868

69+
if (! $this->reflectionProvider->hasFunction($node->name, $scope)) {
70+
return [];
71+
}
72+
6973
$functionReflection = $this->reflectionProvider->getFunction($node->name, $scope);
7074

7175
if (! in_array($functionReflection->getName(), self::SUPPORTED_FUNCTIONS, true)) {

0 commit comments

Comments
 (0)