Skip to content

IBX-12654: Fixed dynamic calls to static methods - #2105

Merged
wiewiurdp merged 1 commit into
6.0from
IBX-12654-fixed-dynamic-calls-to-static-methods
Sep 23, 2026
Merged

wiewiurdp merged 1 commit into
6.0from
IBX-12654-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:

Replaces dynamic calls to static methods ($this->assertX(), static test helpers, ...) with self::/ClassName:: calls: 57 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.

51 of the 57 calls are $this->assertSame()/$this->assertEquals() used inside willReturnCallback() closures (php-cs-fixer's php_unit_test_case_static_method_calls rule does not rewrite calls inside closures, so these were fixed by hand); converting them to self:: let php-cs-fixer's static_lambda rule additionally mark 7 of those closures as static function, since they no longer capture $this. The remaining 6 calls are the package's own concrete static test helpers (createVersionInfo, createArgumentMetadata, createLocation, generateUser) called via $this-> instead of self::.

Pre-existing, unrelated CI failure: the "MySQL integration tests" and "PostgreSQL integration tests" jobs fail with Call to undefined method JMS\TranslationBundle\Translation\Comparison\ChangeSet::getChangedMessages() in TranslationTest::testTranslation. This is caused by ibexa/core (IBX-12594) bumping ibexa/jms-translation-bundle to the 3.0 fork while admin-ui itself still requires upstream jms/translation-bundle ^2.4 directly; both classes autoload under the same namespace. This diff does not touch composer.json or any translation-related code (see the file list above), so it is not the cause. All other checks (PHPStan, code style, rector, deptrac, browser tests, SonarCloud, base-branch check) are green.

For QA:

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

Documentation:

No client-facing impact.

@bnowak
bnowak force-pushed the IBX-12654-fixed-dynamic-calls-to-static-methods branch from 6d45b17 to 7bbe4bc Compare September 23, 2026 08:45
@sonarqubecloud

Copy link
Copy Markdown

@bnowak
bnowak marked this pull request as ready for review September 23, 2026 10:32
@wiewiurdp
wiewiurdp merged commit f7fe5de into 6.0 Sep 23, 2026
21 checks passed
@wiewiurdp
wiewiurdp deleted the IBX-12654-fixed-dynamic-calls-to-static-methods branch September 23, 2026 11:06
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