Stopping Deprecation Warnings from Crying Wolf

When PHPStan flags a method as deprecated, you normally hunt for a replacement. But what if none exists?

Shopware used the @deprecated tag to announce planned changes—like adding a new optional parameter. Static-analysis tools treated those tags as real deprecations and complained about every call. The noise grew, developers started ignoring the warnings, and the alerts lost their value. That’s the classic “crying wolf.”

In Shopware 6.7.14.0 we split the signals.

  • @deprecated – reserve this for APIs that will disappear or be replaced. You must migrate your code.
  • BC-change attributes – use these for planned tweaks that keep the API alive, such as new optional parameters or altered return types.

The new attributes live in Shopware\Core\Framework\Deprecation\BCChange. They tell you exactly what will change and who it touches.

We divided them into two groups:

  • CallSiteCompatibilityChange – affects code that calls a method.
  • ExtenderCompatibilityChange – affects classes that extend or override a method.

Now you can prep your extension for Shopware 6.8 before the next major release lands.

Example: a method will gain a new optional parameter. Add that parameter to your overrides today; the code runs on both the current and future versions.

The change restores trust in deprecation warnings.

Three steps for developers

  1. Treat @deprecated as a mandatory fix; the API will vanish.
  2. Drop broad ignore patterns that may conceal real problems.
  3. Watch for BC-change attributes and apply small, safe updates now instead of a massive migration later.

Source: https://dev.to/shopware/when-deprecated-cries-wolf-making-shopwares-next-major-upgrades-easier-983