Skip to content

[PHPStan] fix listing return types for Pimcore 12.3.9#3078

Merged
dpfaffenbauer merged 2 commits into
coreshop:5.1from
dpfaffenbauer:fix/phpstan-pimcore-12-3-9
Jun 10, 2026
Merged

[PHPStan] fix listing return types for Pimcore 12.3.9#3078
dpfaffenbauer merged 2 commits into
coreshop:5.1from
dpfaffenbauer:fix/phpstan-pimcore-12-3-9

Conversation

@dpfaffenbauer

Copy link
Copy Markdown
Member

Fixes the 19 PHPStan errors in the Deps highest job (e.g. this run).

Why now: Pimcore v12.3.9 (released 2026-06-09) added @return Model\DataObject[] annotations to DataObject\Listing::getObjects()/getData() (and Concrete[] on Listing\Concrete). Previously these methods were untyped, so PHPStan inferred plain array and our typed repository return values passed. Now PHPStan infers array<Pimcore\Model\DataObject> and reports mismatches against the repository interfaces. The failure is unrelated to the commit that triggered the run — any Deps highest build after Jun 9 would fail.

Fix: narrow the listing results with @var annotations at the 19 affected return sites, following the pattern already used in OrderRepository::findCartByCustomer().

Verified locally against pimcore v12.3.9: phpstan 0 errors, psalm green, ecs clean.

🤖 Generated with Claude Code

dpfaffenbauer and others added 2 commits June 10, 2026 16:30
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>
@sonarqubecloud

Copy link
Copy Markdown

@dpfaffenbauer dpfaffenbauer merged commit 8b5c8a2 into coreshop:5.1 Jun 10, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant