Skip to content

IBX-12654: Added ibexa/phpstan and fixed dynamic calls to static methods - #151

Merged
wiewiurdp merged 3 commits into
6.0from
IBX-12654-added-ibexa-phpstan-and-fixed-dynamic-calls-to-static-methods
Sep 23, 2026
Merged

wiewiurdp merged 3 commits into
6.0from
IBX-12654-added-ibexa-phpstan-and-fixed-dynamic-calls-to-static-methods

Conversation

@bnowak

@bnowak bnowak commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12654

Related PRs:

Description:

Adds ibexa/phpstan as a dev dependency and includes its extension in the PHPStan configuration.
Replaces dynamic calls to static methods ($this->assertX(), static test helpers, ...) with self::/ClassName:: calls: 33 calls in 11 files. The staticMethod.dynamicCall strict rule itself is enabled in the linked ibexa/phpstan PR; this PR keeps CI green once that is released.
Also fixes what the existing ibexa/phpstan rules report: 3 closures/arrow functions got return types (Ibexa.requireClosureReturnType).

Judgment call: converting one dynamic $this->assertInstanceOf() call (inside a closure in tests/lib/Validator/Constraint/PasswordValidatorTest.php) to self::assertInstanceOf() changed which PHPStan identifier a pre-existing "always evaluate to true" false positive is reported under (method.alreadyNarrowedType → staticMethod.alreadyNarrowedType), since it now merges with an already-baselined occurrence of the same message. The stale method.alreadyNarrowedType baseline entry (no longer matched) was removed and the sibling staticMethod.alreadyNarrowedType entry's count was updated from 1 to 2 to reflect the two identical, pre-existing occurrences now sharing one identifier. No error is newly ignored; this is purely a mechanical reclassification caused by the self:: conversion.

For QA:

No functional change. CI (PHPStan, code style, unit tests) is the verification.

Documentation:

No client-facing impact.

@sonarqubecloud

Copy link
Copy Markdown

@wiewiurdp
wiewiurdp merged commit 8b90e6b into 6.0 Sep 23, 2026
12 checks passed
@wiewiurdp
wiewiurdp deleted the IBX-12654-added-ibexa-phpstan-and-fixed-dynamic-calls-to-static-methods branch September 23, 2026 12:55
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.

3 participants