[PHPStan] fix listing return types for Pimcore 12.3.9#3078
Merged
dpfaffenbauer merged 2 commits intoJun 10, 2026
Conversation
Pimcore 12.3.9 added @return Model\DataObject[] annotations to DataObject\Listing::getObjects()/getData(), so PHPStan now infers DataObject[] instead of array and reports mismatches against the typed repository interfaces. Narrow the listing results with @var annotations, matching the existing pattern in OrderRepository::findCartByCustomer(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Fixes the 19 PHPStan errors in the
Deps highestjob (e.g. this run).Why now: Pimcore v12.3.9 (released 2026-06-09) added
@return Model\DataObject[]annotations toDataObject\Listing::getObjects()/getData()(andConcrete[]onListing\Concrete). Previously these methods were untyped, so PHPStan inferred plainarrayand our typed repository return values passed. Now PHPStan infersarray<Pimcore\Model\DataObject>and reports mismatches against the repository interfaces. The failure is unrelated to the commit that triggered the run — anyDeps highestbuild after Jun 9 would fail.Fix: narrow the listing results with
@varannotations at the 19 affected return sites, following the pattern already used inOrderRepository::findCartByCustomer().Verified locally against pimcore v12.3.9:
phpstan0 errors,psalmgreen,ecsclean.🤖 Generated with Claude Code