Closed
Description
Hi, this package is very similar to our rule in shipmonk/phpstan-rules
under forbidCustomFunctions
I was considering to switch to your package as it has far more features (and possibly phase-out our rule one day), but when I ran quick comparison of the behaviour of our packages, I found that phpstan-disallowed-calls
is missing quite a few features, most notably it suffers from those false-negatives:
- First class callables not detected
denied_function(...);
- Dynamic calls not detected
$fn = 'denied_function'; $fn();
- Anonymous classes not detected
new class extends ClassWithForbiddenConstructor {};
- Callables not detected
array_map('denied_function', $array);
array_map([$class, 'forbiddenMethod'], $array);
- See the MR for full diff, there are few other differences
Due to that, I'm sticking with our implementation for now, but if you ever consider implementing those, please let me know and I'll reconsider again :)