symbiote / silverstripe-phpstan

Extend PHPStan (PHP Static Analysis) to support SilverStripe projects
BSD 3-Clause "New" or "Revised" License
12 stars 13 forks source link

Catch inproper use of RequestFilter::preRequest() in 3.6.X #6

Closed silbinarywolf closed 6 years ago

silbinarywolf commented 6 years ago

If you return false with a RequestFilter::preRequest(), the server will throw an uncaught exception.

If your filter is meant to block/lock someone out of a website, this will expose the frontend with a 500 server error.

PHPStan should catch this for you

silbinarywolf commented 6 years ago

This feature is coming in: https://github.com/silbinarywolf/silverstripe-phpstan/pull/10

silbinarywolf commented 6 years ago

This is now in master.