phpspec / prophecy

Highly opinionated mocking framework for PHP 5.3+
MIT License
8.53k stars 240 forks source link

Add static analysis with phpstan #577

Closed stof closed 1 year ago

stof commented 1 year ago

@ciaranmcnulty I reached the max phpstan level, with only 15 errors added in the baseline. Most of them are related to case where we deal with string containing class names without defining their type as class-string, which is something that we can improve later. One of them is about ReflectionClass::isReadOnly being reported as undefined, which will go away once we run phpstan on PHP 8.2 (but as I have PHP 8.1 locally, it was easier that way for now). And 2 of them are false positives caused by https://github.com/phpstan/phpstan/issues/8439. So this looks good enough for a merge IMO.