Repository navigation
Conversation
Targets Sylius ^2.2, Symfony ^6.4 || ^7.4 and PHP >= 8.2, following the
Setono Sylius v1→v2 plugin upgrade playbook. This is a hard major upgrade
with no Sylius 1.x BC layer (see UPGRADE.md).
Highlights:
- composer: raise floors (PHP 8.2, sylius/* ^2.2, symfony ^6.4||^7.4,
doctrine/collections ^2); adopt the setono/sylius-plugin dev meta-pack.
- File layout: move src/Resources/{config,views,translations,public} to the
repo root (config/, templates/, translations/, public/); add bundle
getPath()/getConfigFilesPath() overrides.
- Service config: convert all XML to the PHP DSL with FQCN service ids.
- Asset/UI injection: replace the removed sylius_ui events with Twig hooks;
auto-inject the wishlist toggle on the product page.
- Shop UI: rewrite templates for the Sylius 2 Bootstrap 5 theme + Tabler icons.
- Test app: align tests/Application with the Sylius 2 skeleton.
- Tooling/CI/docs: phpstan.neon, infection.json5, setono/sylius-plugin@v2
composite-action workflow; add UPGRADE.md; update README and CLAUDE.md.
require-dev pins api-platform/symfony to ~4.2.1 to work around an upstream
api-platform 4.3 / symfony-type-info 7.4 incompatibility (test-app only).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #9 +/- ##
======================================
Coverage ? 62.23%
Complexity ? 167
======================================
Files ? 36
Lines ? 511
Branches ? 0
======================================
Hits ? 318
Misses ? 193
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| pull_request: | ||
| paths-ignore: | ||
| - "**/*.md" | ||
| push: ~ |
There was a problem hiding this comment.
Done in 9edd285 — on.push now triggers only on *.x branches (matching the Sylius-mirrored branch versioning).
| ; | ||
|
|
||
| // Add product/variant to wishlist | ||
| $services->set('setono_sylius_wishlist.controller.add_to_wishlist', AddToWishlistAction::class) |
There was a problem hiding this comment.
Could this use the FQCN?
There was a problem hiding this comment.
Done in 9edd285 — the abstract parents now use FQCN ids (AddToWishlistAction::class / RemoveFromWishlistAction::class).
I kept the two concrete children (setono_sylius_wishlist.controller.add_product_to_wishlist, ...add_product_variant_to_wishlist, and the remove siblings) on their snake-cased ids on purpose: they're referenced by name in config/routes/shop.yaml, and since the same class is registered twice (product vs variant, differing only by the $className arg) the children can't share a single FQCN id. Happy to rename them too if you'd prefer, but that's a route-contract change.
| # For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" | ||
| # Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls | ||
| DATABASE_URL=mysql://root@127.0.0.1/setono_sylius_wishlist_%kernel.environment%?serverVersion=5.7 | ||
| DATABASE_URL=mysql://root@127.0.0.1/setono_sylius_wishlist_%kernel.environment%?serverVersion=8.0 |
There was a problem hiding this comment.
| DATABASE_URL=mysql://root@127.0.0.1/setono_sylius_wishlist_%kernel.environment%?serverVersion=8.0 | |
| DATABASE_URL=mysql://root@127.0.0.1/setono_sylius_wishlist_%kernel.environment%?serverVersion=11.6.2-MariaDB |
There was a problem hiding this comment.
Done in 9edd285 — reverted to serverVersion=11.6.2-MariaDB. (I'd switched it to 8.0 only to match my local MySQL; the committed default should track your env.)
| APP_SECRET='ch4mb3r0f5ecr3ts' | ||
|
|
||
| KERNEL_CLASS='Setono\SyliusWishlistPlugin\Tests\Application\Kernel' | ||
| KERNEL_CLASS='Acme\SyliusExamplePlugin\Tests\Application\Kernel' |
There was a problem hiding this comment.
Good catch — that Acme namespace was copied verbatim from the skeleton's .env.test. Reverted to Setono\\SyliusWishlistPlugin\\Tests\\Application\\Kernel in 9edd285.
| <php> | ||
| <env name="APP_ENV" value="test"/> | ||
| <env name="SHELL_VERBOSITY" value="-1"/> | ||
| <env name="KERNEL_CLASS" value="Setono\SyliusWishlistPlugin\Tests\Application\Kernel"/> |
There was a problem hiding this comment.
Done in 9edd285 — removed the redundant KERNEL_CLASS env from phpunit.xml.dist; it's resolved from .env.test (the functional suite still boots correctly).
Review fixes: - build.yaml: trigger push only on *.x branches - config/services/controller.php: use FQCN ids for the abstract AddToWishlistAction / RemoveFromWishlistAction parents (the concrete children keep their snake-cased ids — referenced in routes/shop.yaml) - tests/Application/.env: serverVersion back to 11.6.2-MariaDB - tests/Application/.env.test: fix KERNEL_CLASS namespace (Acme -> Setono) - phpunit.xml.dist: drop redundant KERNEL_CLASS env (defined in .env.test) Translations: add messages + flashes for da, sv, no, fi, de, fr, es, it, nl, pl, pt, cs, hu, ro, uk (all locales now carry the toggle_wishlist key).
Coverage: add unit tests for previously-untested classes — WishlistIndexAction, FirstWishlistRedirectAction, UserWishlistProvider, GuestWishlistProvider, Twig\Extension, SelectWishlistsCommand and the guest->user conversion subscriber (74 unit + 1 functional test now). Meta files: - .gitattributes: drop removed tools (psalm, composer-require-checker), add composer-dependency-analyser.php, rector.php, infection.json5, phpstan.neon - .gitignore: ignore /.claude/ - README.md: point coverage/mutation badges at the 2.x branch (master is gone)
Upgrades the plugin to Sylius
^2.2/ Symfony^6.4 || ^7.4/ PHP>= 8.2, following the Setono Sylius v1→v2 plugin upgrade playbook. Hard major upgrade — no Sylius 1.x BC layer. SeeUPGRADE.md.What changed
sylius/* ^2.2;symfony ^6.4 || ^7.4;doctrine/collections ^2. Adopted thesetono/sylius-plugindev meta-pack (replaces hand-pinned PHPStan/ECS/Rector/Infection).src/Resources/{config,views,translations,public}→ repo-rootconfig/,templates/,translations/,public/; bundlegetPath()/getConfigFilesPath()overrides.sylius_uievents (removed in Sylius 2) →sylius_twig_hooks; the wishlist toggle now auto-injects on the product page (sylius_shop.product.show.content.info.summary).tests/Applicationaligned with the Sylius 2 skeleton (bundles, packages, Kernel,index.phpbitmask, webpack assets).phpstan.neon,infection.json5,setono/sylius-plugin@v2composite-action workflow; newUPGRADE.md; updatedREADME.mdandCLAUDE.md.Heads-up
require-devpinsapi-platform/symfony: ~4.2.1(not the skeleton's^4.3.3) to work around an upstream api-platform 4.3 + symfony/type-info 7.4 incompatibility that otherwise prevents the test app from booting. Test-app only; not a runtime dep. Worth raising upstream / revisiting.Verification
Static (PHP 8.2): PHPStan level max ✓, ECS ✓, Rector (
UP_TO_PHP_82) ✓, 59 unit + 1 functional test ✓,lint:container/lint:twig/lint:yaml✓, Doctrine schema validates.Browser (Playwright, booted shop): toggle add/remove, wishlist index + show render (Bootstrap), PATCH update (quantity/note), add-wishlist-to-cart (correct total), item removal, voter grants owner, and guest→user conversion on login — all verified end-to-end.