IBX-12654: Added ibexa/phpstan and fixed dynamic calls to static methods - #241
Merged
wiewiurdp merged 3 commits intoSep 23, 2026
Conversation
|
bnowak
marked this pull request as ready for review
September 23, 2026 10:33
konradoboza
approved these changes
Sep 23, 2026
wiewiurdp
approved these changes
Sep 23, 2026
wiewiurdp
deleted the
IBX-12654-added-ibexa-phpstan-and-fixed-dynamic-calls-to-static-methods
branch
September 23, 2026 12:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Related PRs:
Description:
Adds
ibexa/phpstanas a dev dependency and includes its extension in the PHPStan configuration.Replaces dynamic calls to static methods (
$this->assertX(), static test helpers, ...) withself::/ClassName::calls: 315 calls in 69 files. ThestaticMethod.dynamicCallstrict 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/phpstanrules report: 13 closures/arrow functions got return types (Ibexa.requireClosureReturnType).Worth knowing:
$this->assertXMLTag(...)→self::assertXMLTag(...). Most of them passed a superfluous trailingfalseargument thatassertXMLTag($matcher, $actualXml, $message = '')never read; this was baselined asinvoked with 4 parameters, 2-3 required. PHPStan words that error differently for static calls, so instead of re-baselining it the ignored argument was dropped and the 37 baseline entries PHPStan reported as no longer matched were removed. No behaviour change.->getSubscribedEvents()calls on subscriber instances now use static call syntax: the concrete subscriber class where it is known,$eventListener::getSubscribedEvents()where only the interface is.RelationListProcessorTest: the routerwillReturnCallbackclosure fell through without a return after its two branches; it got an explicitself::fail('Unexpected call to generate().')so its: stringreturn type is honest (theexactly(2)matcher already made that path unreachable).ValueObjectVisitor/Input\Parsertest classes touched by the mechanicalself::/dropped-argument edits above (e.g.RestObjectStateTestvsObjectStateGroupTest,RestUserRoleAssignmentTestvsRestUserGroupRoleAssignmentTest) were already near-identical copy/paste test bodies before this PR; SonarCloud counts a whole pre-existing duplicate block as "new code" whenever any single line inside it changes. All other checks (PHPStan, code style, rector, unit/integration tests, REST functional tests) are green.For QA:
No functional change. CI (PHPStan, code style, unit tests) is the verification.
Documentation:
No client-facing impact.