diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83f45ee4..db615520 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,37 +14,53 @@ jobs: tests: runs-on: ubuntu-latest - name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, wkhtmltopdf: ${{ matrix.wkhtmltopdf }}" + name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, wkhtmltopdf: ${{ matrix.wkhtmltopdf }}, State Machine Adapter ${{ matrix.state_machine_adapter }}" strategy: fail-fast: false matrix: - php: ["8.0", "8.1"] - symfony: ["^5.4", "^6.0"] - sylius: ["~1.11.10", "~1.12.0"] - node: ["16.x"] - mysql: ["5.7", "8.0"] + php: ["8.1", "8.2"] + symfony: ["^5.4.21", "^6.4"] + sylius: ["~1.12.0", "~1.13.x-dev",] + node: ["20.x"] + mysql: ["8.0"] wkhtmltopdf: ["0.12.6-1"] + state_machine_adapter: [ "winzou_state_machine", "symfony_workflow" ] include: - - php: "8.1" - symfony: "^6.0" + php: "8.3" + symfony: "^6.4" + sylius: "~1.13.x-dev" + node: "20.x" + mysql: "8.0" + wkhtmltopdf: "0.12.6-1" + state_machine_adapter: "symfony_workflow" + - + php: "8.2" + symfony: "^6.4" sylius: "~1.12.0" - node: "16.x" + node: "20.x" + mysql: "8.0" + wkhtmltopdf: false + state_machine_adapter: "winzou_state_machine" + - + php: "8.2" + symfony: "^6.4" + sylius: "~1.13.x-dev" + node: "20.x" mysql: "8.0" wkhtmltopdf: false + state_machine_adapter: "symfony_workflow" exclude: - - php: "8.0" - symfony: "^6.0" - - - symfony: "^6.0" - sylius: "~1.11.10" + - sylius: "~1.12.0" + state_machine_adapter: "symfony_workflow" env: APP_ENV: test DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}" + TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}" steps: - diff --git a/README.md b/README.md index 946af26c..7d5f6770 100644 --- a/README.md +++ b/README.md @@ -73,10 +73,9 @@ Symfony Flex, it's much quicker! :) ## Extension points -Majority of actions contained in SyliusInvoicingPlugin is executed once an event after changing the state of -the Order on `winzou_state_machine` is dispatched. +Majority of actions contained in SyliusInvoicingPlugin is executed once an event after changing the state of the Order. -Here is the example: +Here is the example for `Winzou State Machine`: ```yaml winzou_state_machine: @@ -92,6 +91,17 @@ winzou_state_machine: Code placed above is a part of configuration placed in `config.yml` file. You can customize this file by adding new state machine events listeners or editing existing ones. +Here is the example for Symfony's `workflow`: + +```xml + + + + + +``` + Apart from that an Invoice model is treated as a Resource. You can read more about Resources here: diff --git a/UPGRADE.md b/UPGRADE.md index 07fd24a7..c23bad1f 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,4 +1,11 @@ -### UPGRADE FROM 0.23.X TO 0.24.0 +### UPGRADE FROM 0.24.X TO 0.25.0 + +1. Support for Sylius 1.13 has been added, it is now the recommended Sylius version to use with InvoicingPlugin. +2. Support for Sylius 1.11 has been dropped, upgrade your application to [Sylius 1.12](https://github.com/Sylius/Sylius/blob/master/UPGRADE-1.12.md). + or to [Sylius 1.13](https://github.com/Sylius/Sylius/blob/master/UPGRADE-1.13.md). +3. Support for PHP 8.0 has been dropped. + +### UPGRADE FROM 0.23.1 TO 0.24.0 1. Support for Sylius 1.12 has been added, it is now the recommended Sylius version to use with InvoicingPlugin. 2. Support for Sylius 1.10 has been dropped, upgrade your application to [Sylius 1.11](https://github.com/Sylius/Sylius/blob/master/UPGRADE-1.11.md). diff --git a/composer.json b/composer.json index 0788d176..a2194705 100644 --- a/composer.json +++ b/composer.json @@ -5,51 +5,51 @@ "description": "Invoicing plugin for Sylius.", "license": "MIT", "require": { - "php": "^8.0", + "php": "^8.1", "knplabs/knp-snappy-bundle": "^1.8", "ramsey/uuid": "^3.9 || ^4.0", - "sylius/grid-bundle": "^1.7", - "sylius/resource-bundle": "^1.6", - "sylius/sylius": "~1.11.0 || ~1.12.0", - "symfony/config": "^5.4 || ^6.0", - "symfony/dependency-injection": "^5.4 || ^6.0", - "symfony/form": "^5.4 || ^6.0", - "symfony/framework-bundle": "^5.4 || ^6.0", - "symfony/http-foundation": "^5.4 || ^6.0", - "symfony/http-kernel": "^5.4 || ^6.0", - "symfony/messenger": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/routing": "^5.4 || ^6.0" + "sylius/grid-bundle": "^1.9", + "sylius/resource-bundle": "^1.9", + "sylius/sylius": "~1.12.0 || ~1.13.x-dev", + "symfony/config": "^5.4 || ^6.4", + "symfony/dependency-injection": "^5.4.21 || ^6.4", + "symfony/form": "^5.4.21 || ^6.4", + "symfony/framework-bundle": "^5.4.21 || ^6.4", + "symfony/http-foundation": "^5.4.21 || ^6.4", + "symfony/http-kernel": "^5.4.21 || ^6.4", + "symfony/messenger": "^5.4.21 || ^6.4", + "symfony/options-resolver": "^5.4.21 || ^6.4", + "symfony/routing": "^5.4.21 || ^6.4" }, "require-dev": { "behat/behat": "^3.6.1", - "behat/mink-selenium2-driver": "^1.4", + "behat/mink-selenium2-driver": "~1.6.0", "friends-of-behat/exclude-specifications-extension": "^0.2 || ^0.3", "friends-of-behat/mink": "^1.8", - "friends-of-behat/mink-browserkit-driver": "^1.3", + "friends-of-behat/mink-browserkit-driver": "^1.4", "friends-of-behat/mink-debug-extension": "^2.0", - "friends-of-behat/mink-extension": "^2.3", + "friends-of-behat/mink-extension": "^2.4", "friends-of-behat/page-object-extension": "^0.3", "friends-of-behat/suite-settings-extension": "^1.0", "friends-of-behat/symfony-extension": "^2.1", "friends-of-behat/variadic-extension": "^1.3", - "matthiasnoback/symfony-config-test": "^4.0", - "matthiasnoback/symfony-dependency-injection-test": "^4.1", - "phpspec/phpspec": "^7.0", + "matthiasnoback/symfony-config-test": "^4.2", + "matthiasnoback/symfony-dependency-injection-test": "^4.2", + "phpspec/phpspec": "^7.2", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.8", "phpstan/phpstan-doctrine": "^1.3", "phpstan/phpstan-symfony": "^1.2", "phpstan/phpstan-webmozart-assert": "^1.2", - "phpunit/phpunit": "^8.5", + "phpunit/phpunit": "^9.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", "sylius-labs/coding-standard": "~4.0.0", - "symfony/browser-kit": "^5.4 || ^6.0", - "symfony/debug-bundle": "^5.4 || ^6.0", - "symfony/dotenv": "^5.4 || ^6.0", + "symfony/browser-kit": "^5.4.21 || ^6.4", + "symfony/debug-bundle": "^5.4.21 || ^6.4", + "symfony/dotenv": "^5.4.21 || ^6.4", "symfony/intl": "^5.4 || ^6.0", "symfony/webpack-encore-bundle": "^1.15", - "symfony/web-profiler-bundle": "^5.4 || ^6.0" + "symfony/web-profiler-bundle": "^5.4.21 || ^6.4" }, "autoload": { "psr-4": { diff --git a/features/managing_invoices/filtering_invoices.feature b/features/managing_invoices/filtering_invoices.feature index 6a9dd6bc..ad6b5092 100644 --- a/features/managing_invoices/filtering_invoices.feature +++ b/features/managing_invoices/filtering_invoices.feature @@ -12,7 +12,7 @@ Feature: Filtering invoices And the store has a zone "Germany + France" with code "DE + FR" And this zone has the "Germany" country member And this zone has the "France" country member - And the store has a product "PHP T-Shirt" priced at "€10" available in channel "WEB-DE" and channel "WEB-FR" + And the store has a product "PHP T-Shirt" priced at "€10.00" available in channel "WEB-DE" and channel "WEB-FR" And the store ships everywhere for free for all channels And the store allows paying offline for all channels And there is a customer "john.doe@gmail.com" that placed an order "#00000022" diff --git a/features/managing_invoices/seeing_invoice_with_items_and_shipments_having_promotion_applied.feature b/features/managing_invoices/seeing_invoice_with_items_and_shipments_having_promotion_applied.feature index f43efa24..cb2863de 100644 --- a/features/managing_invoices/seeing_invoice_with_items_and_shipments_having_promotion_applied.feature +++ b/features/managing_invoices/seeing_invoice_with_items_and_shipments_having_promotion_applied.feature @@ -12,7 +12,7 @@ Feature: Seeing an invoice with items having promotion applied And there is a promotion "50% shipping discount" And it gives "50%" discount on shipping to every order And there is a promotion "Anatomy Park Promotion" - And this promotion gives "$1" off on every product with minimum price at "$5.00" + And this promotion gives "$1.00" off on every product with minimum price at "$5.00" And there is a customer "rick.sanchez@wubba-lubba-dub-dub.com" that placed an order "#00000666" And the customer "Lucifer Morningstar" addressed it to "Seaside Fwy", "90802" "Los Angeles" in the "United States" And for the billing address of "Mazikeen Lilim" in the "Pacific Coast Hwy", "90806" "Los Angeles", "United States" diff --git a/features/managing_invoices/seeing_invoice_with_items_having_promotion_applied.feature b/features/managing_invoices/seeing_invoice_with_items_having_promotion_applied.feature index b9bca170..04018f9c 100644 --- a/features/managing_invoices/seeing_invoice_with_items_having_promotion_applied.feature +++ b/features/managing_invoices/seeing_invoice_with_items_having_promotion_applied.feature @@ -10,7 +10,7 @@ Feature: Seeing an invoice with items and shipment having promotion applied And the store has "Galaxy Post" shipping method with "$20.00" fee And the store allows paying with "Space money" And there is a promotion "Anatomy Park Promotion" - And this promotion gives "$10" discount to every order with items total at least "$15.00" + And this promotion gives "$10.00" discount to every order with items total at least "$15.00" And there is a customer "rick.sanchez@wubba-lubba-dub-dub.com" that placed an order "#00000666" And the customer "Lucifer Morningstar" addressed it to "Seaside Fwy", "90802" "Los Angeles" in the "United States" And for the billing address of "Mazikeen Lilim" in the "Pacific Coast Hwy", "90806" "Los Angeles", "United States" diff --git a/features/managing_invoices/seeing_invoice_with_taxes_included_in_price_and_promotions_applied.feature b/features/managing_invoices/seeing_invoice_with_taxes_included_in_price_and_promotions_applied.feature index e0b3d900..4662f1c9 100644 --- a/features/managing_invoices/seeing_invoice_with_taxes_included_in_price_and_promotions_applied.feature +++ b/features/managing_invoices/seeing_invoice_with_taxes_included_in_price_and_promotions_applied.feature @@ -12,7 +12,7 @@ Feature: Seeing included in price taxes and promotions applied on an invoice And the store has "UPS" shipping method with "$10.00" fee And the store allows paying with "Cash on Delivery" And there is a promotion "Anatomy Park Promotion" - And this promotion gives "$10" off on every product with minimum price at "$5.00" + And this promotion gives "$10.00" off on every product with minimum price at "$5.00" And there is a customer "lucy@teamlucifer.com" that placed an order "#00000666" And the customer bought 2 "PHP T-Shirt" products And the customer "Lucifer Morningstar" addressed it to "Seaside Fwy", "90802" "Los Angeles" in the "United States" diff --git a/src/EventListener/Workflow/Payment/ProduceOrderPaymentPaidListener.php b/src/EventListener/Workflow/Payment/ProduceOrderPaymentPaidListener.php new file mode 100644 index 00000000..bf6f6c4c --- /dev/null +++ b/src/EventListener/Workflow/Payment/ProduceOrderPaymentPaidListener.php @@ -0,0 +1,37 @@ +getSubject(); + Assert::isInstanceOf($payment, PaymentInterface::class); + + $this->orderPaymentPaidProducer->__invoke($payment); + } +} diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml index 4d93ff3a..fda610e9 100644 --- a/src/Resources/config/services.xml +++ b/src/Resources/config/services.xml @@ -2,7 +2,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/src/Resources/config/services/actions.xml b/src/Resources/config/services/actions.xml index f86ea25b..88e74775 100644 --- a/src/Resources/config/services/actions.xml +++ b/src/Resources/config/services/actions.xml @@ -2,7 +2,7 @@ - + diff --git a/src/Resources/config/services/cli.xml b/src/Resources/config/services/cli.xml index f79d6628..00975c36 100644 --- a/src/Resources/config/services/cli.xml +++ b/src/Resources/config/services/cli.xml @@ -2,7 +2,7 @@ - + diff --git a/src/Resources/config/services/converters.xml b/src/Resources/config/services/converters.xml index c2c75d21..da25fa26 100644 --- a/src/Resources/config/services/converters.xml +++ b/src/Resources/config/services/converters.xml @@ -2,7 +2,7 @@ - + diff --git a/src/Resources/config/services/fixtures.xml b/src/Resources/config/services/fixtures.xml index 3dbc5c3d..6199cdb6 100644 --- a/src/Resources/config/services/fixtures.xml +++ b/src/Resources/config/services/fixtures.xml @@ -2,7 +2,7 @@ - + diff --git a/src/Resources/config/services/generators.xml b/src/Resources/config/services/generators.xml index 8b8abb92..a819f479 100644 --- a/src/Resources/config/services/generators.xml +++ b/src/Resources/config/services/generators.xml @@ -2,7 +2,7 @@ - + diff --git a/src/Resources/config/services/events.xml b/src/Resources/config/services/listeners.xml similarity index 96% rename from src/Resources/config/services/events.xml rename to src/Resources/config/services/listeners.xml index 4e2f50ef..576ea7d8 100644 --- a/src/Resources/config/services/events.xml +++ b/src/Resources/config/services/listeners.xml @@ -2,7 +2,7 @@ - + diff --git a/src/Resources/config/services/listeners/workflow.xml b/src/Resources/config/services/listeners/workflow.xml new file mode 100644 index 00000000..4440453b --- /dev/null +++ b/src/Resources/config/services/listeners/workflow.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/src/Resources/config/services/ui.xml b/src/Resources/config/services/ui.xml index 7706cb10..0010bdb5 100644 --- a/src/Resources/config/services/ui.xml +++ b/src/Resources/config/services/ui.xml @@ -2,7 +2,7 @@ - + diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index e1eb45ce..f51687e6 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -1,11 +1,14 @@ ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], + League\FlysystemBundle\FlysystemBundle::class => ['all' => true], Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true], Sylius\Bundle\MoneyBundle\SyliusMoneyBundle::class => ['all' => true], Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle::class => ['all' => true], @@ -58,3 +61,9 @@ SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], ]; + +if (SyliusCoreBundle::VERSION_ID >= '11300') { + $bundles[Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class] = ['all' => true]; +} + +return $bundles; diff --git a/tests/Application/config/sylius/1.12/packages/mailer.yaml b/tests/Application/config/packages/mailer.yaml similarity index 100% rename from tests/Application/config/sylius/1.12/packages/mailer.yaml rename to tests/Application/config/packages/mailer.yaml diff --git a/tests/Application/config/sylius/1.12/packages/test/mailer.yaml b/tests/Application/config/packages/test/mailer.yaml similarity index 100% rename from tests/Application/config/sylius/1.12/packages/test/mailer.yaml rename to tests/Application/config/packages/test/mailer.yaml diff --git a/tests/Application/config/sylius/1.12/packages/test_cached/mailer.yaml b/tests/Application/config/packages/test_cached/mailer.yaml similarity index 100% rename from tests/Application/config/sylius/1.12/packages/test_cached/mailer.yaml rename to tests/Application/config/packages/test_cached/mailer.yaml diff --git a/tests/Application/config/sylius/1.11/packages/dev/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/dev/swiftmailer.yaml deleted file mode 100644 index f4380780..00000000 --- a/tests/Application/config/sylius/1.11/packages/dev/swiftmailer.yaml +++ /dev/null @@ -1,2 +0,0 @@ -swiftmailer: - disable_delivery: true diff --git a/tests/Application/config/sylius/1.11/packages/staging/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/staging/swiftmailer.yaml deleted file mode 100644 index 98d6b73b..00000000 --- a/tests/Application/config/sylius/1.11/packages/staging/swiftmailer.yaml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: "../dev/mailer.yaml" } diff --git a/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml deleted file mode 100644 index 3bab0d32..00000000 --- a/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml +++ /dev/null @@ -1,2 +0,0 @@ -swiftmailer: - url: '%env(MAILER_URL)%' diff --git a/tests/Application/config/sylius/1.11/packages/test/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/test/swiftmailer.yaml deleted file mode 100644 index c438f4b2..00000000 --- a/tests/Application/config/sylius/1.11/packages/test/swiftmailer.yaml +++ /dev/null @@ -1,6 +0,0 @@ -swiftmailer: - disable_delivery: true - logging: true - spool: - type: file - path: "%kernel.cache_dir%/spool" diff --git a/tests/Application/config/sylius/1.11/packages/test_cached/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/test_cached/swiftmailer.yaml deleted file mode 100644 index 16f3170a..00000000 --- a/tests/Application/config/sylius/1.11/packages/test_cached/swiftmailer.yaml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: "../test/mailer.yaml" } diff --git a/tests/Application/config/sylius/1.13/_sylius.yaml b/tests/Application/config/sylius/1.13/_sylius.yaml new file mode 100644 index 00000000..320a1c56 --- /dev/null +++ b/tests/Application/config/sylius/1.13/_sylius.yaml @@ -0,0 +1,6 @@ +parameters: + test_default_state_machine_adapter: 'symfony_workflow' + test_sylius_state_machine_adapter: '%env(string:default:test_default_state_machine_adapter:TEST_SYLIUS_STATE_MACHINE_ADAPTER)%' + +sylius_state_machine_abstraction: + default_adapter: '%test_sylius_state_machine_adapter%' diff --git a/tests/Application/package.json b/tests/Application/package.json index 1916d10f..d7847319 100644 --- a/tests/Application/package.json +++ b/tests/Application/package.json @@ -47,7 +47,7 @@ "yargs": "^17.5.1" }, "engines": { - "node": "^14 || ^16 || ^18" + "node": "^18 || ^20" }, "engineStrict": true, "scripts": { diff --git a/tests/Application/src/Kernel.php b/tests/Application/src/Kernel.php index 2f41e94d..54a35f17 100644 --- a/tests/Application/src/Kernel.php +++ b/tests/Application/src/Kernel.php @@ -5,12 +5,10 @@ namespace Tests\Sylius\InvoicingPlugin\Application; use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer; -use Sylius\Bundle\CoreBundle\Application\Kernel as SyliusKernel; +use Sylius\Bundle\CoreBundle\SyliusCoreBundle; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\DelegatingLoader; -use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Loader\LoaderResolver; -use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Loader\ClosureLoader; @@ -23,15 +21,12 @@ use Symfony\Component\HttpKernel\Bundle\BundleInterface; use Symfony\Component\HttpKernel\Config\FileLocator; use Symfony\Component\HttpKernel\Kernel as BaseKernel; -use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; use Webmozart\Assert\Assert; final class Kernel extends BaseKernel { use MicroKernelTrait; - private const CONFIG_EXTS = '.{php,xml,yaml,yml}'; - public function getCacheDir(): string { return $this->getProjectDir() . '/var/cache/' . $this->environment; @@ -49,26 +44,6 @@ public function registerBundles(): iterable } } - protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void - { - foreach ($this->getBundleListFiles() as $file) { - $container->addResource(new FileResource($file)); - } - - $container->setParameter('container.dumper.inline_class_loader', true); - - foreach ($this->getConfigurationDirectories() as $confDir) { - $this->loadContainerConfiguration($loader, $confDir); - } - } - - protected function configureRoutes(RoutingConfigurator $routes): void - { - foreach ($this->getConfigurationDirectories() as $confDir) { - $this->loadRoutesConfiguration($routes, $confDir); - } - } - protected function getContainerBaseClass(): string { if ($this->isTestEnvironment() && class_exists(MockerContainer::class)) { @@ -97,23 +72,7 @@ protected function getContainerLoader(ContainerInterface $container): Delegating private function isTestEnvironment(): bool { - return 0 === strpos($this->getEnvironment(), 'test'); - } - - - private function loadContainerConfiguration(LoaderInterface $loader, string $confDir): void - { - $loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob'); - $loader->load($confDir . '/{packages}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob'); - $loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob'); - $loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); - } - - private function loadRoutesConfiguration(RoutingConfigurator $routes, string $confDir): void - { - $routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS); - $routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS); - $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS); + return str_starts_with($this->getEnvironment(), 'test'); } /** @@ -123,18 +82,6 @@ private function registerBundlesFromFile(string $bundlesFile): iterable { $contents = require $bundlesFile; - if (SyliusKernel::MINOR_VERSION > 11) { - $contents = array_merge( - ['League\FlysystemBundle\FlysystemBundle' => ['all' => true]], - $contents, - ); - } else { - $contents = array_merge( - ['Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle' => ['all' => true]], - $contents, - ); - } - foreach ($contents as $class => $envs) { if (isset($envs['all']) || isset($envs[$this->environment])) { yield new $class(); @@ -162,7 +109,7 @@ private function getConfigurationDirectories(): array { $directories = [ $this->getProjectDir() . '/config', - $this->getProjectDir() . '/config/sylius/' . SyliusKernel::MAJOR_VERSION . '.' . SyliusKernel::MINOR_VERSION, + $this->getProjectDir() . '/config/sylius/' . SyliusCoreBundle::MAJOR_VERSION . '.' . SyliusCoreBundle::MINOR_VERSION, ]; return array_filter($directories, 'file_exists');