Skip to content

chore: fix phpstan on 4.3#8331

Open
soyuka wants to merge 2 commits into
api-platform:4.3from
soyuka:chore/phpstan-4.3
Open

chore: fix phpstan on 4.3#8331
soyuka wants to merge 2 commits into
api-platform:4.3from
soyuka:chore/phpstan-4.3

Conversation

@soyuka

@soyuka soyuka commented Jun 17, 2026

Copy link
Copy Markdown
Member
Q A
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

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 dead getWrappedType(true) BC branch — webonyx/graphql-php ^15 always exposes getInnermostType() and getWrappedType() no longer takes an argument; remove the now-unmatched ignore pattern.
  • ParameterResourceMetadataCollectionFactory: the method_exists($filter, 'getProperties') BC shim is always-true now that the interface declares the method via @method; suppress it the same way its twin in ParameterExtensionTrait already is (kept until 5.x).

Laravel (larastan) — the metadata-dump tests added in #8290:

  • stubResourceClasses was typed list<class-string> yet intentionally receives a non-model class name → loosen to list<string>.
  • readDump returned the untyped result of unserialize() → validate and reshape the payload.
  • the Log::spy() / shouldHaveReceived() spy chain is not statically resolvable → assert with Log::shouldReceive() as the rest of the suite already does.

soyuka added 2 commits June 17, 2026 20:16
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant