PHPStan custom rules
Recently I discovered that this code passed our PHPStan level 10 checks: use http\Exception\InvalidArgumentException; // … throw new InvalidArgumentException; I was surprised as http\Exception\InvalidArgumentException is not a class in our system. While cooling, I discovered that there's an http PHP extension and it appears that PHPStan has a stub for this which means that it accepts it as existing even if it doesn't. What we think happened is that I wrote throw new InvalidArgumentException; and… continue reading.











