PHPStan Effect System


The PHPStan Effect System lets you mark methods with effects, such as #[Effect('slow')] on a method that calls an external service, and declare where those effects aren't allowed, such as #[EffectFree('slow')] on a controller. Effects propagate back through the call graph, so PHPStan reports a controller that reaches a slow method several calls away, along with the call path. Rules can also be applied across whole groups of classes and methods in PHPStan's configuration.

View on GitHub


Related articles