IBX-12654: Added ibexa/phpstan and fixed dynamic calls to static methods - #356
Merged
konradoboza merged 4 commits intoSep 23, 2026
Conversation
|
bnowak
marked this pull request as ready for review
September 23, 2026 10:32
konradoboza
approved these changes
Sep 23, 2026
konradoboza
left a comment
Contributor
There was a problem hiding this comment.
@bnowak do you feel sanities are needed here given refactor caused by ConfigResolver call in constructors?
wiewiurdp
approved these changes
Sep 23, 2026
Contributor
|
After internal sync we decided to merge this one as-is to unblock further progress. |
konradoboza
deleted the
IBX-12654-added-ibexa-phpstan-and-fixed-dynamic-calls-to-static-methods
branch
September 23, 2026 12:56
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: 23 calls in 6 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: 24 closures/arrow functions got return types (Ibexa.requireClosureReturnType), 3 converter constructors (Html5,Html5Edit,Html5Input) no longer read ConfigResolver parameters (Ibexa.noConfigResolverParametersInConstructor) — the resolver is now kept as a property and the custom stylesheets are resolved lazily on first use, withXslt::addCustomStylesheets()extracted so the subclasses can call it after construction.While fixing a pre-existing PHPStan
argument.typefinding inRichTextTransformerTest(honestly, not by baselining), one baseline entry became unmatched and was removed.A follow-up commit extracts the shared logic of
Html5,Html5EditandHtml5Inputinto a newConfigResolverAwareXsltConverterbase class: the initialIbexa.noConfigResolverParametersInConstructorfix made those three classes near-identical, which SonarCloud correctly flagged as new duplicated code (67% on new lines, gate is 3%); this was genuinely new duplication introduced by this PR, not the known pre-existing-test-fixture false positive, so it was fixed rather than worked around.Known CI failure (SonarCloud duplication gate): after that fix, SonarCloud still fails the "duplication on new code" gate (14.2%, threshold 3%), now entirely attributed to
tests/lib/RichText/RendererTest.php(64% on its 28 new lines). This is the documented false positive: the flaggedhasParameter/getParameter/warning/error/__getmock closures are pre-existing, near-identical blocks that already existed 2-3 times in this file on6.0before this branch; this PR only added a return-type declaration (and oneself::/staticconversion in commit 2) inside each occurrence, which makes SonarCloud attribute the whole pre-existing duplicated block as "new code". No new duplication was introduced. Per the established policy for this pattern, the test fixtures were intentionally left untouched rather than refactored to dodge the gate; all other checks (PHPStan, code style, unit, integration, browser tests) are green.For QA:
No functional change. CI (PHPStan, code style, unit tests) is the verification.
Documentation:
No client-facing impact.