Skip to content

IBX-12654: Enabled the PHPStan strict rule for dynamic calls to static methods - #16

Merged
bnowak merged 1 commit into
6.0from
IBX-12654-enabled-PHPStan-strict-rule-for-dynamic-calls-to-static-methods
Sep 23, 2026
Merged

bnowak merged 1 commit into
6.0from
IBX-12654-enabled-PHPStan-strict-rule-for-dynamic-calls-to-static-methods

Conversation

@bnowak

@bnowak bnowak commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12654

Related PRs (63 consumer PRs, must merge before this one):

Not included: ibexa/activity-log already ships the full phpstan-strict-rules set (this rule was already active there with 0 hits, no PR needed). ibexa/jms-translation-bundle is blocked on a separate Symfony 7.4/8.0 dependency conflict and needs a decision before it can be adjusted.

Description:

Enables the phpstan/phpstan-strict-rules check for dynamic calls to static methods (staticMethod.dynamicCall) in the shared Ibexa ruleset by registering PHPStan\Rules\StrictCalls\DynamicCallOnStaticMethodsRule and PHPStan\Rules\StrictCalls\DynamicCallOnStaticMethodsCallableRule under rules: in extension.neon.

Because the rule classes now ship as part of the extension, phpstan/phpstan-strict-rules moves from require-dev to require, so every consumer of ibexa/phpstan gets them installed.

The consumer packages are fixed first (their PRs replace $this->assertX()-style calls and static test helpers with self::/ClassName:: calls); this PR merges last, once those are in, so their CI stays green when this rule is released. The package's own PHPStan run, test suite and code style check pass with the change, and the rule was verified to report Dynamic call to static method Foo::bar(). when analysing a throwaway fixture through extension.neon.

For QA:

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

Documentation:

No client-facing impact.

This was referenced Sep 22, 2026
@bnowak
bnowak marked this pull request as ready for review September 23, 2026 10:33

@konradoboza konradoboza left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

@bnowak
bnowak force-pushed the IBX-12654-enabled-PHPStan-strict-rule-for-dynamic-calls-to-static-methods branch from 683b716 to b0cebf4 Compare September 23, 2026 13:03
@bnowak
bnowak merged commit 14eef74 into 6.0 Sep 23, 2026
4 checks passed
@bnowak
bnowak deleted the IBX-12654-enabled-PHPStan-strict-rule-for-dynamic-calls-to-static-methods branch September 23, 2026 13:38
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.

4 participants