phpstan-disallowed-calls
phpstan-disallowed-calls copied to clipboard
PHPStan rules to detect disallowed method & function calls, constant, namespace, attribute & superglobal usages
I just tried to use the new `disallowedClass` alias for `disallowedNamespace` which looks great. But it now produces 2 errors instead of 1 in the baseline: ```diff + - +...
It would be great if I could enforce some rules that only apply in some directories. Currently, the only way to get that working is to construct a list of...
Given a configuration like this for example: ```neon disallowedFunctionCalls: - function: 'pcntl_*()' allowIn: - vendor/foo/bar/Baz.php ``` when any `pcntl` call is not found in `vendor/foo/bar/Baz.php`, report error and suggest removing...
https://wiki.php.net/rfc/dynamic_class_constant_fetch Fix #241 This should have been done in #217 already.
PHP: 8.3.1 When i use dynamic constants for enum. For example: ```php
Example use case, I want to prevent the usage of a certain class / method, inside a class that has `#[Entity]` attribute.
I'd like to write modern PHP (8.3+), and use ondrejmirtes/simple-downgrader to downgrade the code to 7.2, commit to a release branch and release the package from that branch. Here's what...
given a doctrine repository which looks like this: ```php /** * @extends ServiceEntityRepository * * @method Version|null find($id, $lockMode = null, $lockVersion = null) * @method Version|null findOneBy(array $criteria, array...
https://github.com/phpstan/phpstan/discussions/11816 Close #265
See https://github.com/phpstan/phpstan/discussions/11816