💀 PHP unused code detection via PHPStan extension. Detects dead cycles, supports libs like Symfony, Doctrine, PHPUnit etc. Can automatically remove dead PHP code.
This gains performance boost at about ~20% for our codebase
This is because static reflection is very costy and main process need to build all the reflection (costy ast parsing) again (even though that was already done in collectors)
In addition, PHPStan is not designed (performance-wise) for reflection heavy work in Rule<CollectedDataNode> as the reflection's underlying ast parser is doing ton of useless work, e.g. like parsing method bodies (such work is not useless in collectors/regular rules)
Thus, using reflection in Rule<CollectedDataNode> is almost always bad idea
Contains also BC break of changed EntrypointProvider interface.
This is needed to maintain the Symfony DIC constructors analysis precision. We do not have ClassHierarchy available in EntrypointProvider anymore and we need to be able to mark even children's methods as entrypoints.
Users can extend SimpleMethodEntrypointProvider for simple transition
Rule<CollectedDataNode>
as the reflection's underlying ast parser is doing ton of useless work, e.g. like parsing method bodies (such work is not useless in collectors/regular rules)Rule<CollectedDataNode>
is almost always bad ideaEntrypointProvider
interface.SimpleMethodEntrypointProvider
for simple transition