Skip to content

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

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: 38 calls in 10 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: 1 closure got a return type (Ibexa.requireClosureReturnType) in UserAccountFieldValueFormMapper::getModelTransformerForTranslation().

Known CI note: SonarCloud's "duplication on new code" gate fails (9.3% > 3%) on tests/lib/Validator/Constraints/PasswordValidatorTest.php and tests/lib/Validator/Constraints/UserAccountPasswordValidatorTest.php. These are pre-existing, near-identical PHPUnit test classes; this PR only changes $this->assertX()/$this->createStub() to self:: inside already-duplicated closures. SonarCloud attributes the whole pre-existing duplicated block as "new code" whenever any line in it changes. All other CI jobs are green. Not refactoring the test fixtures here (out of scope, risky).

For QA:

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

Documentation:

No client-facing impact.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
9.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@wiewiurdp
wiewiurdp merged commit 5269d6c into 6.0 Sep 23, 2026
13 of 14 checks passed
@wiewiurdp
wiewiurdp deleted the IBX-12654-added-ibexa-phpstan-and-fixed-dynamic-calls-to-static-methods branch September 23, 2026 11:17
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