From 414a7172e79cdaed88cd29d84a449b8013026c01 Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Tue, 20 Jan 2026 18:08:36 +0100 Subject: [PATCH 1/9] Replace abandoned package with right one --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bc39269..a0843be 100644 --- a/composer.json +++ b/composer.json @@ -14,10 +14,10 @@ }, "require-dev": { "behat/behat": "^3.16", + "behat/mink": "^1.13", "dbrekelmans/bdi": "^1.4", "dmore/behat-chrome-extension": "^1.4", "dmore/chrome-mink-driver": "^2.9", - "friends-of-behat/mink": "^1.11", "friends-of-behat/mink-browserkit-driver": "^1.6", "friends-of-behat/mink-debug-extension": "^2.1", "friends-of-behat/mink-extension": "^2.7", From f5d0e66cccf21bd57b379a1dc3c145c537b041ba Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Tue, 20 Jan 2026 18:09:32 +0100 Subject: [PATCH 2/9] Suggest right namespace in migration dir --- src/DependencyInjection/AcmeSyliusExampleExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DependencyInjection/AcmeSyliusExampleExtension.php b/src/DependencyInjection/AcmeSyliusExampleExtension.php index 1047519..11fcacf 100644 --- a/src/DependencyInjection/AcmeSyliusExampleExtension.php +++ b/src/DependencyInjection/AcmeSyliusExampleExtension.php @@ -30,7 +30,7 @@ public function prepend(ContainerBuilder $container): void protected function getMigrationsNamespace(): string { - return 'DoctrineMigrations'; + return 'Acme\SyliusExamplePlugin'; } protected function getMigrationsDirectory(): string From 6d724415580d513abd3ea33a55744995bd1673ee Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Tue, 20 Jan 2026 18:14:53 +0100 Subject: [PATCH 3/9] Update actions --- .github/workflows/build.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f486fcc..18ceff4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,16 +29,12 @@ jobs: strategy: fail-fast: false matrix: - php: ["8.3"] + php: ["8.3", "8.4"] symfony: ["^6.4", "^7.4"] - sylius: ["~2.0.0", "~2.1.0", "~2.2.0"] + sylius: ["~2.1.0", "~2.2.0"] database: ["mysql:8.4"] node: ["22.x"] - exclude: - - sylius: "~2.0.0" - symfony: "^7.4" - include: - php: "8.3" symfony: "^7.4" @@ -91,6 +87,10 @@ jobs: sylius_version: "${{ matrix.sylius }}" symfony_version: "${{ matrix.symfony }}" + - + name: Run PHPStan + run: vendor/bin/phpstan analyse + - name: Run unit tests run: vendor/bin/phpunit --colors=always --testsuite=unit From 7179d5d0db8e3ec8df46703c896448b4dbdeea6f Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Tue, 3 Mar 2026 14:57:32 +0100 Subject: [PATCH 4/9] Fix and run ECS on tests --- .github/workflows/build.yaml | 4 ++++ ecs.php | 2 -- .../Behat/Context/Ui/Shop/WelcomeContext.php | 24 ++++--------------- tests/Behat/Page/Shop/DynamicWelcomePage.php | 9 ------- tests/Behat/Page/Shop/StaticWelcomePage.php | 9 ------- .../Behat/Page/Shop/WelcomePageInterface.php | 3 --- 6 files changed, 9 insertions(+), 42 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 18ceff4..be05617 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -87,6 +87,10 @@ jobs: sylius_version: "${{ matrix.sylius }}" symfony_version: "${{ matrix.symfony }}" + - + name: Run ECS + run: vendor/bin/ecs check + - name: Run PHPStan run: vendor/bin/phpstan analyse diff --git a/ecs.php b/ecs.php index 7c3d8f3..ff9ff19 100644 --- a/ecs.php +++ b/ecs.php @@ -2,7 +2,6 @@ declare(strict_types=1); -use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer; use Symplify\EasyCodingStandard\Config\ECSConfig; return static function (ECSConfig $ecsConfig): void { @@ -14,4 +13,3 @@ $ecsConfig->import('vendor/sylius-labs/coding-standard/ecs.php'); }; - diff --git a/tests/Behat/Context/Ui/Shop/WelcomeContext.php b/tests/Behat/Context/Ui/Shop/WelcomeContext.php index a0d95b0..3e13279 100644 --- a/tests/Behat/Context/Ui/Shop/WelcomeContext.php +++ b/tests/Behat/Context/Ui/Shop/WelcomeContext.php @@ -8,26 +8,12 @@ use Tests\Acme\SyliusExamplePlugin\Behat\Page\Shop\WelcomePageInterface; use Webmozart\Assert\Assert; -final class WelcomeContext implements Context +final readonly class WelcomeContext implements Context { - /** - * @var WelcomePageInterface - */ - private $staticWelcomePage; - - /** - * @var WelcomePageInterface - */ - private $dynamicWelcomePage; - - /** - * @param WelcomePageInterface $staticWelcomePage - * @param WelcomePageInterface $dynamicWelcomePage - */ - public function __construct(WelcomePageInterface $staticWelcomePage, WelcomePageInterface $dynamicWelcomePage) - { - $this->staticWelcomePage = $staticWelcomePage; - $this->dynamicWelcomePage = $dynamicWelcomePage; + public function __construct( + private WelcomePageInterface $staticWelcomePage, + private WelcomePageInterface $dynamicWelcomePage, + ) { } /** diff --git a/tests/Behat/Page/Shop/DynamicWelcomePage.php b/tests/Behat/Page/Shop/DynamicWelcomePage.php index 6bfc5fa..3f2052c 100644 --- a/tests/Behat/Page/Shop/DynamicWelcomePage.php +++ b/tests/Behat/Page/Shop/DynamicWelcomePage.php @@ -9,9 +9,6 @@ class DynamicWelcomePage extends SymfonyPage implements WelcomePageInterface { - /** - * {@inheritdoc} - */ public function getGreeting(): string { $greeting = $this->getSession()->getPage()->waitFor(3, function (): string { @@ -29,17 +26,11 @@ public function getGreeting(): string return $greeting; } - /** - * {@inheritdoc} - */ public function getRouteName(): string { return 'acme_sylius_example_dynamic_welcome'; } - /** - * {@inheritdoc} - */ protected function getDefinedElements(): array { return array_merge(parent::getDefinedElements(), [ diff --git a/tests/Behat/Page/Shop/StaticWelcomePage.php b/tests/Behat/Page/Shop/StaticWelcomePage.php index 14de739..b2b1d6b 100644 --- a/tests/Behat/Page/Shop/StaticWelcomePage.php +++ b/tests/Behat/Page/Shop/StaticWelcomePage.php @@ -8,25 +8,16 @@ class StaticWelcomePage extends SymfonyPage implements WelcomePageInterface { - /** - * {@inheritdoc} - */ public function getGreeting(): string { return $this->getElement('greeting')->getText(); } - /** - * {@inheritdoc} - */ public function getRouteName(): string { return 'acme_sylius_example_static_welcome'; } - /** - * {@inheritdoc} - */ protected function getDefinedElements(): array { return array_merge(parent::getDefinedElements(), [ diff --git a/tests/Behat/Page/Shop/WelcomePageInterface.php b/tests/Behat/Page/Shop/WelcomePageInterface.php index 7cd873c..a8f5bd3 100644 --- a/tests/Behat/Page/Shop/WelcomePageInterface.php +++ b/tests/Behat/Page/Shop/WelcomePageInterface.php @@ -8,8 +8,5 @@ interface WelcomePageInterface extends SymfonyPageInterface { - /** - * @return string - */ public function getGreeting(): string; } From fca6b955541b70b787395832971881263062ce74 Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Tue, 3 Mar 2026 15:07:21 +0100 Subject: [PATCH 5/9] Fix files indentation --- .editorconfig | 47 ------------------- .github/dependabot.yml | 88 +++++++++++++++++++----------------- .github/workflows/build.yaml | 78 +++++++++++++++++--------------- assets/shop/js/greetings.js | 2 +- 4 files changed, 90 insertions(+), 125 deletions(-) diff --git a/.editorconfig b/.editorconfig index 003d498..ddd1cc3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,64 +15,17 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*.feature] -indent_style = space -indent_size = 4 - [*.js] -indent_style = space indent_size = 2 [*.json] -indent_style = space indent_size = 2 [*.md] -indent_style = space -indent_size = 4 trim_trailing_whitespace = false -[*.neon] -indent_style = space -indent_size = 4 - -[*.php] -indent_style = space -indent_size = 4 - -[*.sh] -indent_style = space -indent_size = 4 - [*.{yaml,yml}] -indent_style = space -indent_size = 4 trim_trailing_whitespace = false -[.babelrc] -indent_style = space -indent_size = 2 - -[.gitmodules] -indent_style = tab -indent_size = 4 - -[.php_cs{,.dist}] -indent_style = space -indent_size = 4 - [composer.json] -indent_style = space -indent_size = 4 - -[package.json] -indent_style = space -indent_size = 2 - -[phpstan.neon] -indent_style = space -indent_size = 4 - -[phpunit.xml{,.dist}] -indent_style = space indent_size = 4 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bab287a..1e7a8de 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,43 +1,49 @@ version: 2 updates: -- package-ecosystem: composer - directory: "/" - schedule: - interval: daily - time: "10:00" - open-pull-requests-limit: 10 - ignore: - - dependency-name: vimeo/psalm - versions: - - 4.5.0 - - 4.5.1 - - 4.5.2 - - 4.6.0 - - 4.6.1 - - 4.6.2 - - 4.6.3 - - 4.7.0 - - 4.7.1 - - dependency-name: phpstan/phpstan - versions: - - 0.12.70 - - 0.12.71 - - 0.12.73 - - 0.12.75 - - 0.12.76 - - 0.12.77 - - 0.12.78 - - 0.12.80 - - 0.12.81 - - 0.12.83 - - 0.12.84 - - dependency-name: sylius-labs/coding-standard - versions: - - 4.0.2 - - dependency-name: phpstan/phpstan-doctrine - versions: - - 0.12.32 - - dependency-name: phpstan/phpstan-webmozart-assert - versions: - - 0.12.10 - - 0.12.11 + - + package-ecosystem: composer + directory: "/" + schedule: + interval: daily + time: "10:00" + open-pull-requests-limit: 10 + ignore: + - + dependency-name: vimeo/psalm + versions: + - 4.5.0 + - 4.5.1 + - 4.5.2 + - 4.6.0 + - 4.6.1 + - 4.6.2 + - 4.6.3 + - 4.7.0 + - 4.7.1 + - + dependency-name: phpstan/phpstan + versions: + - 0.12.70 + - 0.12.71 + - 0.12.73 + - 0.12.75 + - 0.12.76 + - 0.12.77 + - 0.12.78 + - 0.12.80 + - 0.12.81 + - 0.12.83 + - 0.12.84 + - + dependency-name: sylius-labs/coding-standard + versions: + - 4.0.2 + - + dependency-name: phpstan/phpstan-doctrine + versions: + - 0.12.32 + - + dependency-name: phpstan/phpstan-webmozart-assert + versions: + - 0.12.10 + - 0.12.11 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index be05617..78836c5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,7 +10,7 @@ on: paths-ignore: - "*.md" release: - types: [created] + types: [ created ] schedule: - cron: "0 1 * * 6" # Run at 1am every Saturday @@ -29,43 +29,49 @@ jobs: strategy: fail-fast: false matrix: - php: ["8.3", "8.4"] - symfony: ["^6.4", "^7.4"] - sylius: ["~2.1.0", "~2.2.0"] - database: ["mysql:8.4"] - node: ["22.x"] + php: [ "8.3", "8.4" ] + symfony: [ "^6.4", "^7.4" ] + sylius: [ "~2.1.0", "~2.2.0" ] + database: [ "mysql:8.4" ] + node: [ "22.x" ] include: - - php: "8.3" - symfony: "^7.4" - sylius: "~2.2.0" - database: "mysql:8.0" - node: "22.x" - - php: "8.3" - symfony: "^7.4" - sylius: "~2.2.0" - database: "mariadb:10.11" - node: "22.x" - - php: "8.3" - symfony: "^7.4" - sylius: "~2.2.0" - database: "mariadb:11.4" - node: "22.x" - - php: "8.3" - symfony: "^7.4" - sylius: "~2.2.0" - database: "postgres:15" - node: "22.x" - - php: "8.3" - symfony: "^7.4" - sylius: "~2.2.0" - database: "postgres:16" - node: "22.x" - - php: "8.3" - symfony: "^7.4" - sylius: "~2.2.0" - database: "postgres:17" - node: "22.x" + - + php: "8.3" + symfony: "^7.4" + sylius: "~2.2.0" + database: "mysql:8.0" + node: "22.x" + - + php: "8.3" + symfony: "^7.4" + sylius: "~2.2.0" + database: "mariadb:10.11" + node: "22.x" + - + php: "8.3" + symfony: "^7.4" + sylius: "~2.2.0" + database: "mariadb:11.4" + node: "22.x" + - + php: "8.3" + symfony: "^7.4" + sylius: "~2.2.0" + database: "postgres:15" + node: "22.x" + - + php: "8.3" + symfony: "^7.4" + sylius: "~2.2.0" + database: "postgres:16" + node: "22.x" + - + php: "8.3" + symfony: "^7.4" + sylius: "~2.2.0" + database: "postgres:17" + node: "22.x" env: APP_ENV: test diff --git a/assets/shop/js/greetings.js b/assets/shop/js/greetings.js index 3d7adfd..f89aad7 100644 --- a/assets/shop/js/greetings.js +++ b/assets/shop/js/greetings.js @@ -1,3 +1,3 @@ setTimeout(function () { - document.getElementById('greeting').innerHTML = document.getElementById('greeting').dataset.greeting; + document.getElementById('greeting').innerHTML = document.getElementById('greeting').dataset.greeting; }, 1000); From 1fc741df0909c4a9dc09a97e74961257033b088c Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Tue, 3 Mar 2026 15:21:19 +0100 Subject: [PATCH 6/9] Use PHP as plugin configurations by default --- config/config.php | 9 +++++++ config/config.yaml | 4 ---- config/routes/admin.php | 8 +++++++ config/routes/admin.yaml | 1 - config/routes/shop.php | 22 +++++++++++++++++ config/routes/shop.yaml | 13 ---------- config/services.php | 9 +++++++ config/services.xml | 16 ------------- config/services/.gitkeep | 0 config/services/controller.php | 17 +++++++++++++ config/twig_hooks/shop.yaml | 10 -------- config/twig_hooks/shop/greeting.php | 24 +++++++++++++++++++ .../AcmeSyliusExampleExtension.php | 6 ++--- tests/Behat/Resources/services.php | 9 +++++++ tests/Behat/Resources/services.xml | 16 ------------- tests/Behat/Resources/services/page.php | 20 ++++++++++++++++ tests/Behat/Resources/services/ui.php | 19 +++++++++++++++ tests/TestApplication/.env | 4 ++-- tests/TestApplication/config/config.yaml | 2 +- tests/TestApplication/config/routes.yaml | 4 ++-- .../TestApplication/config/services_test.php | 2 +- 21 files changed, 146 insertions(+), 69 deletions(-) create mode 100644 config/config.php delete mode 100644 config/config.yaml create mode 100644 config/routes/admin.php delete mode 100644 config/routes/admin.yaml create mode 100644 config/routes/shop.php delete mode 100644 config/routes/shop.yaml create mode 100644 config/services.php delete mode 100644 config/services.xml delete mode 100644 config/services/.gitkeep create mode 100644 config/services/controller.php delete mode 100644 config/twig_hooks/shop.yaml create mode 100644 config/twig_hooks/shop/greeting.php create mode 100644 tests/Behat/Resources/services.php delete mode 100644 tests/Behat/Resources/services.xml create mode 100644 tests/Behat/Resources/services/page.php create mode 100644 tests/Behat/Resources/services/ui.php diff --git a/config/config.php b/config/config.php new file mode 100644 index 0000000..e0c5c5f --- /dev/null +++ b/config/config.php @@ -0,0 +1,9 @@ +import('twig_hooks/**/*.php'); +}; diff --git a/config/config.yaml b/config/config.yaml deleted file mode 100644 index 063a809..0000000 --- a/config/config.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# Put your plugin configuration here - -imports: - - { resource: "twig_hooks/**/*.yaml" } diff --git a/config/routes/admin.php b/config/routes/admin.php new file mode 100644 index 0000000..46528cf --- /dev/null +++ b/config/routes/admin.php @@ -0,0 +1,8 @@ +add('acme_sylius_example_static_welcome', '/static-welcome/{name}') + ->defaults([ + '_controller' => GreetingController::staticallyGreetAction(), + 'name' => null, + ]) + ; + + $routes->add('acme_sylius_example_dynamic_welcome', '/dynamic-welcome/{name}') + ->defaults([ + '_controller' => GreetingController::dynamicallyGreetAction(), + 'name' => null, + ]) + ; +}; diff --git a/config/routes/shop.yaml b/config/routes/shop.yaml deleted file mode 100644 index 7f47db1..0000000 --- a/config/routes/shop.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Delete these routes and define your own shop routes here - -acme_sylius_example_static_welcome: - path: /static-welcome/{name} - defaults: - _controller: Acme\SyliusExamplePlugin\Controller\GreetingController::staticallyGreetAction - name: ~ - -acme_sylius_example_dynamic_welcome: - path: /dynamic-welcome/{name} - defaults: - _controller: Acme\SyliusExamplePlugin\Controller\GreetingController::dynamicallyGreetAction - name: ~ diff --git a/config/services.php b/config/services.php new file mode 100644 index 0000000..8cc3ee1 --- /dev/null +++ b/config/services.php @@ -0,0 +1,9 @@ +import('services/*.php'); +}; diff --git a/config/services.xml b/config/services.xml deleted file mode 100644 index 738f1aa..0000000 --- a/config/services.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/config/services/.gitkeep b/config/services/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/config/services/controller.php b/config/services/controller.php new file mode 100644 index 0000000..b1255ad --- /dev/null +++ b/config/services/controller.php @@ -0,0 +1,17 @@ +services(); + + $services->set(GreetingController::class) + ->public() + ->autowire() + ->autoconfigure() + ; +}; diff --git a/config/twig_hooks/shop.yaml b/config/twig_hooks/shop.yaml deleted file mode 100644 index 33682f0..0000000 --- a/config/twig_hooks/shop.yaml +++ /dev/null @@ -1,10 +0,0 @@ -sylius_twig_hooks: - hooks: - 'app_shop.greeting.dynamic': - content: - template: '@AcmeSyliusExamplePlugin/shop/greeting/dynamic/content.html.twig' - priority: 0 - 'app_shop.greeting.static': - content: - template: '@AcmeSyliusExamplePlugin/shop/greeting/static/content.html.twig' - priority: 0 diff --git a/config/twig_hooks/shop/greeting.php b/config/twig_hooks/shop/greeting.php new file mode 100644 index 0000000..798aff9 --- /dev/null +++ b/config/twig_hooks/shop/greeting.php @@ -0,0 +1,24 @@ +extension('sylius_twig_hooks', [ + 'hooks' => [ + 'app_shop.greeting.dynamic' => [ + 'content' => [ + 'template' => '@AcmeSyliusExamplePlugin/shop/greeting/dynamic/content.html.twig', + 'priority' => 0, + ], + ], + 'app_shop.greeting.static' => [ + 'content' => [ + 'template' => '@AcmeSyliusExamplePlugin/shop/greeting/static/content.html.twig', + 'priority' => 0, + ], + ], + ], + ]); +}; diff --git a/src/DependencyInjection/AcmeSyliusExampleExtension.php b/src/DependencyInjection/AcmeSyliusExampleExtension.php index 11fcacf..19755db 100644 --- a/src/DependencyInjection/AcmeSyliusExampleExtension.php +++ b/src/DependencyInjection/AcmeSyliusExampleExtension.php @@ -9,7 +9,7 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; final class AcmeSyliusExampleExtension extends AbstractResourceExtension implements PrependExtensionInterface { @@ -18,9 +18,9 @@ final class AcmeSyliusExampleExtension extends AbstractResourceExtension impleme /** @psalm-suppress UnusedVariable */ public function load(array $configs, ContainerBuilder $container): void { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../../config')); + $loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../../config')); - $loader->load('services.xml'); + $loader->load('services.php'); } public function prepend(ContainerBuilder $container): void diff --git a/tests/Behat/Resources/services.php b/tests/Behat/Resources/services.php new file mode 100644 index 0000000..8cc3ee1 --- /dev/null +++ b/tests/Behat/Resources/services.php @@ -0,0 +1,9 @@ +import('services/*.php'); +}; diff --git a/tests/Behat/Resources/services.xml b/tests/Behat/Resources/services.xml deleted file mode 100644 index 8c823e9..0000000 --- a/tests/Behat/Resources/services.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/Behat/Resources/services/page.php b/tests/Behat/Resources/services/page.php new file mode 100644 index 0000000..6c71125 --- /dev/null +++ b/tests/Behat/Resources/services/page.php @@ -0,0 +1,20 @@ +services(); + + $services->set('acme_sylius_example.page.shop.static_welcome', StaticWelcomePage::class) + ->parent('sylius.behat.symfony_page') + ; + + $services->set('acme_sylius_example.page.shop.dynamic_welcome', DynamicWelcomePage::class) + ->parent('sylius.behat.symfony_page') + ; +}; diff --git a/tests/Behat/Resources/services/ui.php b/tests/Behat/Resources/services/ui.php new file mode 100644 index 0000000..e40e46d --- /dev/null +++ b/tests/Behat/Resources/services/ui.php @@ -0,0 +1,19 @@ +services(); + + $services->set('acme_sylius_example.context.ui.shop.welcome', WelcomeContext::class) + ->public() + ->args([ + service('acme_sylius_example.page.shop.static_welcome'), + service('acme_sylius_example.page.shop.dynamic_welcome'), + ]) + ; +}; diff --git a/tests/TestApplication/.env b/tests/TestApplication/.env index 73a305b..585aebc 100644 --- a/tests/TestApplication/.env +++ b/tests/TestApplication/.env @@ -3,5 +3,5 @@ DATABASE_URL=mysql://root@127.0.0.1/acme_sylius_example_plugin_%kernel.environme BEHAT_BASE_URL="http://127.0.0.1:8080/" SYLIUS_TEST_APP_BUNDLES_PATH="tests/TestApplication/config/bundles.php" -SYLIUS_TEST_APP_CONFIGS_TO_IMPORT="@AcmeSyliusExamplePlugin/tests/TestApplication/config/config.yaml" -SYLIUS_TEST_APP_ROUTES_TO_IMPORT="@AcmeSyliusExamplePlugin/tests/TestApplication/config/routes.yaml" +SYLIUS_TEST_APP_CONFIGS_TO_IMPORT="@AcmeSyliusExamplePlugin/tests/TestApplication/config/config.php" +SYLIUS_TEST_APP_ROUTES_TO_IMPORT="@AcmeSyliusExamplePlugin/tests/TestApplication/config/routes.php" diff --git a/tests/TestApplication/config/config.yaml b/tests/TestApplication/config/config.yaml index 6b88083..222beda 100644 --- a/tests/TestApplication/config/config.yaml +++ b/tests/TestApplication/config/config.yaml @@ -1,5 +1,5 @@ imports: - - { resource: "@AcmeSyliusExamplePlugin/config/config.yaml" } + - { resource: "@AcmeSyliusExamplePlugin/config/config.php" } - { resource: "services_test.php" } twig: diff --git a/tests/TestApplication/config/routes.yaml b/tests/TestApplication/config/routes.yaml index a913ba4..383c356 100644 --- a/tests/TestApplication/config/routes.yaml +++ b/tests/TestApplication/config/routes.yaml @@ -1,5 +1,5 @@ acme_sylius_example_admin: - resource: "@AcmeSyliusExamplePlugin/config/routes/admin.yaml" + resource: "@AcmeSyliusExamplePlugin/config/routes/admin.php" acme_sylius_example_shop: - resource: "@AcmeSyliusExamplePlugin/config/routes/shop.yaml" + resource: "@AcmeSyliusExamplePlugin/config/routes/shop.php" diff --git a/tests/TestApplication/config/services_test.php b/tests/TestApplication/config/services_test.php index 3b16fd7..bab4856 100644 --- a/tests/TestApplication/config/services_test.php +++ b/tests/TestApplication/config/services_test.php @@ -7,6 +7,6 @@ return function (ContainerConfigurator $container) { if (str_starts_with($container->env(), 'test')) { $container->import('../../../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml'); - $container->import('@AcmeSyliusExamplePlugin/tests/Behat/Resources/services.xml'); + $container->import('@AcmeSyliusExamplePlugin/tests/Behat/Resources/services.php'); } }; From 42bdaf411b0bb4004563cdc97eb9ee6724ca377c Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Tue, 3 Mar 2026 15:22:11 +0100 Subject: [PATCH 7/9] Fix README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8967a2c..f499b57 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ To be able to set up a plugin's database, remember to configure your database cr - PHPStan ```bash - vendor/bin/phpstan analyse -c phpstan.neon -l max src/ + vendor/bin/phpstan analyse ``` - Coding Standard From ade9aeeaa7cc72b5f66f9e0b3aef6b8995ed4c67 Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Tue, 3 Mar 2026 15:22:48 +0100 Subject: [PATCH 8/9] Replace mailhog with mailpit --- compose.override.dist.yml | 2 +- compose.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compose.override.dist.yml b/compose.override.dist.yml index f8fccb6..1bb2bd6 100644 --- a/compose.override.dist.yml +++ b/compose.override.dist.yml @@ -63,7 +63,7 @@ services: volumes: - .:/srv/sylius:rw,cached - ./public:/srv/sylius/public:rw,delegated - mailhog: + mailpit: ports: - "8025:8025" diff --git a/compose.yml b/compose.yml index 067908b..34fbcbf 100644 --- a/compose.yml +++ b/compose.yml @@ -17,6 +17,6 @@ services: image: ghcr.io/sylius/sylius-nginx:latest depends_on: - php - mailhog: + mailpit: # do not use in production! - image: mailhog/mailhog:latest + image: axllent/mailpit:latest From ac90dc76c2e374255d625a53654e946ac271ec2d Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Tue, 3 Mar 2026 15:25:57 +0100 Subject: [PATCH 9/9] Fix CI --- config/routes/shop.php | 4 ++-- tests/TestApplication/.env | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/routes/shop.php b/config/routes/shop.php index b629890..b448c74 100644 --- a/config/routes/shop.php +++ b/config/routes/shop.php @@ -8,14 +8,14 @@ return static function (RoutingConfigurator $routes): void { $routes->add('acme_sylius_example_static_welcome', '/static-welcome/{name}') ->defaults([ - '_controller' => GreetingController::staticallyGreetAction(), + '_controller' => [GreetingController::class, 'staticallyGreetAction'], 'name' => null, ]) ; $routes->add('acme_sylius_example_dynamic_welcome', '/dynamic-welcome/{name}') ->defaults([ - '_controller' => GreetingController::dynamicallyGreetAction(), + '_controller' => [GreetingController::class, 'dynamicallyGreetAction'], 'name' => null, ]) ; diff --git a/tests/TestApplication/.env b/tests/TestApplication/.env index 585aebc..73a305b 100644 --- a/tests/TestApplication/.env +++ b/tests/TestApplication/.env @@ -3,5 +3,5 @@ DATABASE_URL=mysql://root@127.0.0.1/acme_sylius_example_plugin_%kernel.environme BEHAT_BASE_URL="http://127.0.0.1:8080/" SYLIUS_TEST_APP_BUNDLES_PATH="tests/TestApplication/config/bundles.php" -SYLIUS_TEST_APP_CONFIGS_TO_IMPORT="@AcmeSyliusExamplePlugin/tests/TestApplication/config/config.php" -SYLIUS_TEST_APP_ROUTES_TO_IMPORT="@AcmeSyliusExamplePlugin/tests/TestApplication/config/routes.php" +SYLIUS_TEST_APP_CONFIGS_TO_IMPORT="@AcmeSyliusExamplePlugin/tests/TestApplication/config/config.yaml" +SYLIUS_TEST_APP_ROUTES_TO_IMPORT="@AcmeSyliusExamplePlugin/tests/TestApplication/config/routes.yaml"