chore: fix phpstan on 4.3#8331
Open
soyuka wants to merge 2 commits into
Open
Conversation
Drop the dead getWrappedType(true) backward-compat branch in FieldsBuilder (webonyx/graphql-php ^15 always exposes getInnermostType() and getWrappedType() takes no argument), and remove the now-unmatched ignore pattern. Silence the always-true method_exists() BC shim in ParameterResourceMetadataCollectionFactory the same way its twin in ParameterExtensionTrait already is.
The metadata-dump tests added in api-platform#8290 trip larastan: stubResourceClasses is typed list<class-string> yet intentionally receives a non-model class name, readDump returns the untyped result of unserialize(), and the Log::spy()/shouldHaveReceived() spy chain is not statically resolvable. Loosen the stub to list<string>, validate and reshape the dump payload, and assert the stale-fingerprint warning with Log::shouldReceive() as the rest of the suite already does.
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.
Restores a green PHPStan run on
4.3(both the root level-6 config and the Laravel larastan level-7 config).Core (
phpstan.neon.dist)FieldsBuilder: drop the deadgetWrappedType(true)BC branch —webonyx/graphql-php ^15always exposesgetInnermostType()andgetWrappedType()no longer takes an argument; remove the now-unmatched ignore pattern.ParameterResourceMetadataCollectionFactory: themethod_exists($filter, 'getProperties')BC shim is always-true now that the interface declares the method via@method; suppress it the same way its twin inParameterExtensionTraitalready is (kept until 5.x).Laravel (larastan) — the metadata-dump tests added in #8290:
stubResourceClasseswas typedlist<class-string>yet intentionally receives a non-model class name → loosen tolist<string>.readDumpreturned the untyped result ofunserialize()→ validate and reshape the payload.Log::spy()/shouldHaveReceived()spy chain is not statically resolvable → assert withLog::shouldReceive()as the rest of the suite already does.