Skip to content

Commit

Permalink
Do not process unknown hooked functions (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanDelMar authored Dec 1, 2024
1 parent fab61ad commit f7beb13
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/HookCallbackRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public function processNode(Node $node, Scope $scope): array
return [];
}

if (! $this->reflectionProvider->hasFunction($node->name, $scope)) {
return [];
}

$functionReflection = $this->reflectionProvider->getFunction($node->name, $scope);

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

0 comments on commit f7beb13

Please sign in to comment.