Repository navigation
Raise phpstan to level 7, with no baseline - #82
Merged
Merged
Conversation
Every finding is fixed in the code, so `phpstan-baseline.neon` goes, and the config is `phpstan.neon.dist` as in the sibling projects. The framework checks in the adapter tests go too, since both frameworks are always installed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Level 7, as the sibling projects have it. Every finding is fixed in the code, so
phpstan-baseline.neongoes, and the config isphpstan.neon.dist.Most of it is native types, in the tests and the older parts of the loader. The rest:
file_get_contents()andReflectionClass::getFileName()can returnfalse, which went straight intojson_decode()anddirname(). Both are checked now.$specificationis a\stdClass, and any other object passed in is turned into plain data. YAML is recognised by its extension, rather than by.yamlappearing anywhere in the path.Request::route()always returning a route, and the test case's$appalways being set. The middleware calls the route resolver thatroute()uses, so a request that matched no route is still handled, and the Laravel test letssetUp()own$this->appinstead of caching its own.LaravelTestCasewith them, are gone. Both frameworks are always installed since Raise the floor to PHP 8.2, and test both adapters in one matrix #77.The oldest phpstan allowed, 2.1, found two more in
OpenApi30Translatorthat 2.3 does not, from reading properties of anobject. Its nodes come fromjson_decode(), so they are typed asstdClassnow. Checked locally with highest and lowest dependencies.