Upgrade plugin to support Sylius 2#38
Open
loevgaard wants to merge 4 commits into
Open
Conversation
Follows the Setono Sylius v1 -> v2 plugin upgrade playbook, using the SyliusPluginSkeleton as reference. - Require PHP >=8.2, Symfony ^6.4 || ^7.4 and Sylius ^2.0 - Move configuration to repo-root config/ and translations/; convert service definitions from XML to the PHP DSL (config/services.php) - Register the admin grid via the bundle extension prepend() instead of a grid YAML file; override getPath()/getConfigFilesPath() so Doctrine mapping, validation and translations resolve from the new layout - Default the command bus to sylius.command_bus - Replace Psalm/PHPSpec/code-quality-pack with setono/sylius-plugin (PHPStan max + PHPUnit); add ecs.php, rector.php, infection.json5 and composer-dependency-analyser.php - Convert the PHPSpec specs to PHPUnit under tests/Unit and add a functional admin-routing test - Rebuild the test application for Sylius 2.2 - Switch CI to the setono/sylius-plugin composite actions See UPGRADE.md for consumer-facing changes.
- phpunit.xml.dist: restore the intended config (unit/functional test suites + <source> coverage filter); the previous commit accidentally kept the old single-suite config, which broke code coverage - phpstan: drop doctrine objectManagerLoader (align with the skeleton); it booted a second kernel that failed under the static-analysis action - composer-dependency-analyser: disable reporting of unmatched ignores (the sylius split-package ignores are resolution-dependent) - add an (empty) templates/ directory so lint:twig has a target - mark the backwards-compatibility job non-blocking for the major upgrade
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
- composer-dependency-analyser: ignore the optional Buzz classes as unknown (kriswallsmith/buzz is not installed when only production dependencies are analysed) - remove the backwards-compatibility CI job for the 1.x -> 2.x upgrade (no 2.0 baseline yet; re-add after 2.0 is released)
loevgaard
commented
Jun 15, 2026
loevgaard
commented
Jun 15, 2026
loevgaard
commented
Jun 15, 2026
loevgaard
commented
Jun 15, 2026
loevgaard
commented
Jun 15, 2026
loevgaard
commented
Jun 15, 2026
- bundles.php: register the plugin before SyliusGridBundle (and document it in the README) instead of working around the grid/model-class parameter ordering in the extension's prepend() - remove the now-unnecessary setParameter() workaround from prepend() - drop the redundant getModelNamespace() override (it equals the AbstractResourceBundle default) - do not hard-require a specific PSR-17 implementation: require php-http/discovery and discover the request/response factories at runtime; nyholm/psr7 becomes a dev dependency (used by the test app) - composer-dependency-analyser: drop the sylius split-package ignores (not needed in CI) - restore the backwards-compatibility CI job as-is
loevgaard
commented
Jun 15, 2026
Comment on lines
+38
to
+45
| protected function getConfigFilesPath(): string | ||
| { | ||
| return sprintf( | ||
| '%s/config/doctrine/%s', | ||
| $this->getPath(), | ||
| strtolower($this->getDoctrineMappingDirectory()), | ||
| ); | ||
| } |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Upgrades the plugin from Sylius 1.10 to Sylius 2, following the Setono v1 -> v2 plugin upgrade playbook with the
SyliusPluginSkeleton(2.2.x) as the reference andSyliusRedirectPluginfor the resource-specific mechanics.Plugin
composer.json: PHP>=8.2, Symfony^6.4 || ^7.4, splitsylius/* ^2.0,setono/sylius-plugin ^2.0; dropped Psalm/PHPSpec/code-quality-packsrc/Resources/to repo-rootconfig/+translations/; services converted to the PHP DSL with FQCN ids + interface aliasesAbstractResourceBundlebut overridesgetPath()/getModelNamespace()/getConfigFilesPath()to point Doctrine/validation atconfig/Extension::prepend()(sylius_grid); routing uses/%sylius_admin.path_name%and@SyliusAdmin\shared\crudmessage_bus->sylius.command_busreadonlyconstructors)Tooling / CI
phpstan.neon(level max),ecs.php,rector.php,composer-dependency-analyser.php,infection.json5, two-suitephpunit.xml.dist,tests/PHPStan/*setono/sylius-plugin/*@v2composite-action workflowTests
tests/Unit/; existing tests moved there tootests/Functional/AdminRoutingTestVerification
Locally green on PHP 8.4 / Symfony 7.4 / Sylius 2.2.6:
composer validate --strict·composer normalize·composer-dependency-analyser·phpstan(max) ·ecs·phpunit(24 tests) ·cache:warmup·lint:container·debug:router(6 resource routes) ·doctrine:schema:create+schema:validateNotes
UPGRADE.md).symfony/type-info7.4 + API-Platform 4.3 union-type bug on PHP 8.4 that is unrelated to this (API-agnostic) plugin.