Upgrades a Shopware 6 plugin from an older version (like 6.4/6.5) to be fully compatible with Shopware 6.7 by refactoring deprecated code, updating routing attributes, replacing removed interfaces, and modernizing PHP features. Use this skill when asked to make a Shopware plugin compatible with version 6.7.
This skill outlines the critical tasks required to upgrade a Shopware 6 plugin for compatibility with Shopware 6.7. Shopware 6.6 and 6.7 introduce significant breaking changes, especially regarding Symfony updates and removed core interfaces.
Shopware 6.6 (via Symfony 6/7) completely removed support for @Route annotations in favor of PHP 8 #[Route(...)] attributes.
Action Required:
src/Resources/config/routes.xml to change import type from annotation to attribute.use Symfony\Component\Routing\Annotation\Route; with use Symfony\Component\Routing\Attribute\Route; in all controller files.routes.xml Update:
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing
https://symfony.com/schema/routing/routing-1.0.xsd">
<import resource="../../Controller/**/*Controller.php" type="attribute" />
</routes>
Example Before:
/**
* @Route(defaults={"_routeScope"={"storefront"}})
*/
class MyAjaxController extends StorefrontController {
/**
* @Route("/my-route", name="frontend.my.route", methods={"GET"})
*/
public function myAction() {}
}
Example After:
#[Route(defaults: ['_routeScope' => ['storefront']])]
class MyAjaxController extends StorefrontController {
#[Route(path: '/my-route', name: 'frontend.my.route', methods: ['GET'])]
public function myAction() {}
}
Certain interfaces heavily used in previous Shopware versions have been deprecated and removed.
Action Required:
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface; with the concrete class use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;.Example:
Change private EntityRepositoryInterface $repository; to private EntityRepository $repository;.
To adhere to modern PHP 8 standards and typical Shopware repository guidelines (like AGENTS.md), dependency injection should be refactored to use constructor property promotion.
Action Required:
__construct methods in controllers, services, and subscribers.private readonly for injected dependencies.Example Before:
class MyService {
private EntityRepository $repo;
public function __construct(EntityRepository $repo) {
$this->repo = $repo;
}
}
Example After:
class MyService {
public function __construct(
private readonly EntityRepository $repo
) {}
}
The skill includes a script to fetch the latest Shopware upgrade guides directly from the official repository.
Action Required:
./fetch-upgrade-docs.sh
This will download the latest versions of:
The documents are saved in the resources/ folder with timestamps and source URLs for reference.
composer.json UpdatesEnsure the plugin requires the correct Shopware core version.
Action Required:
composer.json to require "shopware/core": "6.7.*".phpstan and php-cs-fixer if available in the project to verify type safety and formatting.Follow these steps meticulously to ensure the upgraded plugin performs seamlessly in Shopware 6.7 environments.