Skip to content

fix: unbreak PHPStan EntitySearchResult deprecations - #189

Merged
Soner (shyim) merged 2 commits into
shopware:trunkfrom
roboshyim:fix/phpstan-entity-search-result
Jul 28, 2026
Merged

fix: unbreak PHPStan EntitySearchResult deprecations#189
Soner (shyim) merged 2 commits into
shopware:trunkfrom
roboshyim:fix/phpstan-entity-search-result

Conversation

@roboshyim

Copy link
Copy Markdown
Contributor

What changed?

Fixes the failing scheduled Static Analyse job:
https://github.com/shopware/SwagExtensionStore/actions/runs/30327480501/job/90175768778

CI failures

  1. Ignored error patterns no longer matched:
    • getEntities() of deprecated EntitySearchResult (controller path)
    • deprecated class EntitySearchResult (test path)
  2. Real error: deprecated EntitySearchResult::__construct() in InAppPurchasesControllerTest

Root cause

Shopware trunk 6.8 deprecations shifted: getEntities() is the supported API (UPGRADE-6.8), while constructing EntitySearchResult with the old $entity parameter is deprecated. Ignores from #188 targeted the old messages.

Fix

  • Remove stale ignoreErrors in phpstan.neon.dist
  • Ignore only EntitySearchResult::__construct deprecation in the test fixture (still needed on 6.7)
  • Wrap fixture construction in Feature::silent('v6.8.0.0', …) and correct 'aoo''app'
  • Controller already uses ->getEntities()->first() — left as-is

How was this tested?

  • Aligned with the failed job log (unmatched ignores + constructor deprecation)
  • php -l on the touched test file
  • CI Static Analyse on this PR will confirm

Related

Scheduled run: https://github.com/shopware/SwagExtensionStore/actions/runs/30327480501

Scheduled PHP CI failed because phpstan.neon.dist ignored errors that no
longer fire (getEntities() / deprecated class), while the real finding is
the deprecated EntitySearchResult constructor used in tests.

- Drop stale ignoreErrors entries
- Ignore only EntitySearchResult::__construct deprecation in the test
- Build the fixture via Feature::silent and fix entity name typo (aoo → app)

Controller already uses getEntities()->first() (forward-compatible for 6.8).

Fixes scheduled Static Analyse on trunk.
@shyim
Soner (shyim) merged commit 272c3ad into shopware:trunk Jul 28, 2026
6 checks passed
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.

2 participants