Skip to content

Commit

Permalink
Mark 'method_intercept' function for PHPStan and Psalm to ignore
Browse files Browse the repository at this point in the history
The 'method_intercept' function which is a PECL-created function is updated to be ignored by PHPStan and Psalm. This change addresses static analysis warnings from these tools, ensuring that they do not flag this part of the code. The update will bring more clarity to issues identified during codebase analysis.
  • Loading branch information
koriym committed Jul 7, 2024
1 parent b485b95 commit d844ceb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Aspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use function end;
use function extension_loaded;
use function get_declared_classes;
use function method_intercept;
use function method_intercept; // @phpstan-ignore-line
use function strcasecmp;
use function sys_get_temp_dir;

Expand Down Expand Up @@ -131,7 +131,8 @@ private function applyInterceptors(): void
$methodNames = array_keys($methods);
foreach ($methodNames as $methodName) {
assert($dispatcher instanceof MethodInterceptorInterface);
method_intercept($className, $methodName, $dispatcher);
/** @psalm-suppress UndefinedFunction PECL-created function */
method_intercept($className, $methodName, $dispatcher); // @phpstan-ignore-line
}
}
}
Expand Down

0 comments on commit d844ceb

Please sign in to comment.