diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25a7072..2ca8489 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -182,7 +182,7 @@ jobs: - name: Upload Behat logs - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: failure() with: name: Behat logs diff --git a/ecs.php b/ecs.php index 3cf43de..fb0426f 100644 --- a/ecs.php +++ b/ecs.php @@ -18,4 +18,3 @@ VisibilityRequiredFixer::class => ['*Spec.php'], ]); }; - diff --git a/src/Checker/TableRateShippingMethodEligibilityChecker.php b/src/Checker/TableRateShippingMethodEligibilityChecker.php index 79c5964..49b742c 100644 --- a/src/Checker/TableRateShippingMethodEligibilityChecker.php +++ b/src/Checker/TableRateShippingMethodEligibilityChecker.php @@ -17,13 +17,13 @@ final class TableRateShippingMethodEligibilityChecker implements ShippingMethodE { public function __construct( private ShippingMethodEligibilityCheckerInterface $eligibilityChecker, - private TableRateResolverInterface $tableRateResolver + private TableRateResolverInterface $tableRateResolver, ) { } public function isEligible( ShippingSubjectInterface $subject, - ShippingMethodInterface $method + ShippingMethodInterface $method, ): bool { if (!$this->eligibilityChecker->isEligible($subject, $method)) { return false; diff --git a/src/EventSubscriber/TableRateDeleteSubscriber.php b/src/EventSubscriber/TableRateDeleteSubscriber.php index 4e6fed9..669a336 100644 --- a/src/EventSubscriber/TableRateDeleteSubscriber.php +++ b/src/EventSubscriber/TableRateDeleteSubscriber.php @@ -46,7 +46,7 @@ public function onTableRatePreDelete(ResourceControllerEvent $event): void 'webgriffe_sylius_table_rate_plugin.ui.shipping_table_rate.already_used_by_shipping_methods', ResourceControllerEvent::TYPE_ERROR, ['%shipping_methods%' => implode(', ', $foundMethods)], - 400 + 400, ); } } diff --git a/src/Exception/RateNotFoundException.php b/src/Exception/RateNotFoundException.php index 980212b..4493799 100644 --- a/src/Exception/RateNotFoundException.php +++ b/src/Exception/RateNotFoundException.php @@ -13,12 +13,12 @@ public function __construct( ShippingTableRate $shippingTableRate, float $weight, int $code = 0, - Throwable $previous = null + Throwable $previous = null, ) { $message = sprintf( 'The shipping table rate "%s" cannot find a rate for a weight of "%s"', $shippingTableRate->getCode(), - $weight + $weight, ); parent::__construct($message, $code, $previous); } diff --git a/src/Form/EventSubscriber/AddCurrencySubscriber.php b/src/Form/EventSubscriber/AddCurrencySubscriber.php index 4e39e62..04dcd19 100644 --- a/src/Form/EventSubscriber/AddCurrencySubscriber.php +++ b/src/Form/EventSubscriber/AddCurrencySubscriber.php @@ -33,7 +33,7 @@ public function preSetData(FormEvent $event): void 'required' => true, 'placeholder' => $messagesNamespace . 'currency.placeholder', 'disabled' => $this->shouldCurrencyBeDisabled($resource), - ] + ], ); } diff --git a/src/Form/Type/Shipping/Calculator/ChannelBasedTableRateConfigurationType.php b/src/Form/Type/Shipping/Calculator/ChannelBasedTableRateConfigurationType.php index 454692f..4b3a217 100644 --- a/src/Form/Type/Shipping/Calculator/ChannelBasedTableRateConfigurationType.php +++ b/src/Form/Type/Shipping/Calculator/ChannelBasedTableRateConfigurationType.php @@ -19,7 +19,7 @@ public function configureOptions(OptionsResolver $resolver): void 'entry_options' => function (ChannelInterface $channel): array { return ['label' => $channel->getName(), 'currency' => $channel->getBaseCurrency()]; }, - ] + ], ); } diff --git a/src/Form/Type/ShippingTableRateType.php b/src/Form/Type/ShippingTableRateType.php index a6cca57..2241510 100644 --- a/src/Form/Type/ShippingTableRateType.php +++ b/src/Form/Type/ShippingTableRateType.php @@ -28,7 +28,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'allow_add' => true, 'allow_delete' => true, 'entry_type' => WeightLimitToRateType::class, - ] + ], ) ; } diff --git a/src/Form/Type/WeightLimitToRateType.php b/src/Form/Type/WeightLimitToRateType.php index ae6d8ab..7be8918 100644 --- a/src/Form/Type/WeightLimitToRateType.php +++ b/src/Form/Type/WeightLimitToRateType.php @@ -24,7 +24,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'scale' => 2, 'required' => true, 'constraints' => [new NotBlank(['groups' => 'sylius'])], - ] + ], ) ->add( 'rate', @@ -33,7 +33,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'label' => $messagesNamespace . 'rate', 'required' => true, 'constraints' => [new NotBlank(['groups' => 'sylius'])], - ] + ], ) ; } diff --git a/src/Menu/AdminMenuListener.php b/src/Menu/AdminMenuListener.php index ca64dab..35e8952 100644 --- a/src/Menu/AdminMenuListener.php +++ b/src/Menu/AdminMenuListener.php @@ -18,7 +18,7 @@ public function addAdminMenuItems(MenuBuilderEvent $event): void $configuration ->addChild( 'webgriffe-sylius-table-rate-plugin-table-rates', - ['route' => 'webgriffe_admin_shipping_table_rate_index'] + ['route' => 'webgriffe_admin_shipping_table_rate_index'], ) ->setLabel('webgriffe.ui.shipping_table_rates') ->setLabelAttribute('icon', 'pallet') diff --git a/src/Resolver/TableRateResolver.php b/src/Resolver/TableRateResolver.php index b6baf5f..411d715 100644 --- a/src/Resolver/TableRateResolver.php +++ b/src/Resolver/TableRateResolver.php @@ -4,9 +4,12 @@ namespace Webgriffe\SyliusTableRateShippingPlugin\Resolver; +if (!interface_exists(\Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class)) { + class_alias(\Sylius\Component\Resource\Repository\RepositoryInterface::class, \Sylius\Resource\Doctrine\Persistence\RepositoryInterface::class); +} use Sylius\Component\Core\Exception\MissingChannelConfigurationException; use Sylius\Component\Core\Model\ShipmentInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; +use Sylius\Resource\Doctrine\Persistence\RepositoryInterface; use Webgriffe\SyliusTableRateShippingPlugin\Entity\ShippingTableRate; use Webgriffe\SyliusTableRateShippingPlugin\Form\Type\Shipping\Calculator\TableRateConfigurationType; use Webmozart\Assert\Assert; diff --git a/symfony.lock b/symfony.lock new file mode 100644 index 0000000..ecbc144 --- /dev/null +++ b/symfony.lock @@ -0,0 +1,449 @@ +{ + "api-platform/core": { + "version": "2.7", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "2.5", + "ref": "b86557ce5677fa855b1b2608f4a4bc4a8fed8be7" + }, + "files": [ + "config/packages/api_platform.yaml", + "config/routes/api_platform.yaml", + "src/Entity/.gitignore" + ] + }, + "babdev/pagerfanta-bundle": { + "version": "v3.8.0" + }, + "doctrine/annotations": { + "version": "2.0", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.10", + "ref": "64d8583af5ea57b7afa4aba4b159907f3a148b05" + } + }, + "doctrine/doctrine-bundle": { + "version": "2.13", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "2.10", + "ref": "c170ded8fc587d6bd670550c43dafcf093762245" + }, + "files": [ + "config/packages/doctrine.yaml", + "src/Entity/.gitignore", + "src/Repository/.gitignore" + ] + }, + "doctrine/doctrine-migrations-bundle": { + "version": "3.3", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "3.1", + "ref": "1d01ec03c6ecbd67c3375c5478c9a423ae5d6a33" + }, + "files": [ + "config/packages/doctrine_migrations.yaml", + "migrations/.gitignore" + ] + }, + "friends-of-behat/symfony-extension": { + "version": "2.6", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "2.0", + "ref": "1e012e04f573524ca83795cd19df9ea690adb604" + } + }, + "friendsofsymfony/rest-bundle": { + "version": "3.7", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "3.0", + "ref": "3762cc4e4f2d6faabeca5a151b41c8c791bd96e5" + } + }, + "jms/serializer-bundle": { + "version": "4.2", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "4.0", + "ref": "cc04e10cf7171525b50c18b36004edf64cb478be" + } + }, + "knplabs/knp-gaufrette-bundle": { + "version": "v0.8.0" + }, + "knplabs/knp-menu-bundle": { + "version": "v3.4.2" + }, + "league/flysystem-bundle": { + "version": "2.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.0", + "ref": "913dc3d7a5a1af0d2b044c5ac3a16e2f851d7380" + }, + "files": [ + "config/packages/flysystem.yaml", + "var/storage/.gitignore" + ] + }, + "lexik/jwt-authentication-bundle": { + "version": "2.17", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "2.5", + "ref": "e9481b233a11ef7e15fe055a2b21fd3ac1aa2bb7" + }, + "files": [ + "config/packages/lexik_jwt_authentication.yaml" + ] + }, + "liip/imagine-bundle": { + "version": "2.13", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.8", + "ref": "d1227d002b70d1a1f941d91845fcd7ac7fbfc929" + } + }, + "nyholm/psr7": { + "version": "1.8", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.0", + "ref": "4a8c0345442dcca1d8a2c65633dcf0285dd5a5a2" + }, + "files": [ + "config/packages/nyholm_psr7.yaml" + ] + }, + "payum/payum-bundle": { + "version": "2.6", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "2.4", + "ref": "518ac22defa04a8a1d82479ed362e2921487adf0" + } + }, + "phpstan/phpstan": { + "version": "1.12", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.0", + "ref": "5e490cc197fb6bb1ae22e5abbc531ddc633b6767" + } + }, + "phpunit/phpunit": { + "version": "9.6", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "9.6", + "ref": "7364a21d87e658eb363c5020c072ecfdc12e2326" + }, + "files": [ + ".env.test", + "phpunit.xml.dist", + "tests/bootstrap.php" + ] + }, + "sonata-project/block-bundle": { + "version": "5.1", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "4.11", + "ref": "b4edd2a1e6ac1827202f336cac2771cb529de542" + } + }, + "sonata-project/form-extensions": { + "version": "2.4", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.4", + "ref": "9c8a1e8ce2b1f215015ed16652c4ed18eb5867fd" + } + }, + "squizlabs/php_codesniffer": { + "version": "3.10", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "3.6", + "ref": "1019e5c08d4821cb9b77f4891f8e9c31ff20ac6f" + } + }, + "stof/doctrine-extensions-bundle": { + "version": "1.12", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.2", + "ref": "e805aba9eff5372e2d149a9ff56566769e22819d" + } + }, + "sylius-labs/doctrine-migrations-extra-bundle": { + "version": "v0.2.2" + }, + "sylius/calendar": { + "version": "v0.5.0" + }, + "sylius/fixtures-bundle": { + "version": "v1.9.0" + }, + "sylius/grid-bundle": { + "version": "v1.13.0" + }, + "sylius/mailer-bundle": { + "version": "v2.1.0" + }, + "sylius/resource-bundle": { + "version": "1.12", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.12", + "ref": "cde8dd6145be3135af63787aa5c5858c3f289c7a" + } + }, + "sylius/theme-bundle": { + "version": "v2.4.0" + }, + "symfony/console": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "1781ff40d8a17d87cf53f8d4cf0c8346ed2bb461" + }, + "files": [ + "bin/console" + ] + }, + "symfony/debug-bundle": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "5aa8aa48234c8eb6dbdd7b3cd5d791485d2cec4b" + }, + "files": [ + "config/packages/debug.yaml" + ] + }, + "symfony/flex": { + "version": "2.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.0", + "ref": "146251ae39e06a95be0fe3d13c807bcf3938b172" + }, + "files": [ + ".env" + ] + }, + "symfony/framework-bundle": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "6.4", + "ref": "32126346f25e1cee607cc4aa6783d46034920554" + }, + "files": [ + "config/packages/cache.yaml", + "config/packages/framework.yaml", + "config/preload.php", + "config/routes/framework.yaml", + "config/services.yaml", + "public/index.php", + "src/Controller/.gitignore", + "src/Kernel.php" + ] + }, + "symfony/mailer": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "4.3", + "ref": "df66ee1f226c46f01e85c29c2f7acce0596ba35a" + }, + "files": [ + "config/packages/mailer.yaml" + ] + }, + "symfony/messenger": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "6.0", + "ref": "ba1ac4e919baba5644d31b57a3284d6ba12d52ee" + }, + "files": [ + "config/packages/messenger.yaml" + ] + }, + "symfony/monolog-bundle": { + "version": "3.10", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "3.7", + "ref": "aff23899c4440dd995907613c1dd709b6f59503f" + }, + "files": [ + "config/packages/monolog.yaml" + ] + }, + "symfony/panther": { + "version": "2.1", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.0", + "ref": "673836afb0eac2b0ec36c44f2ff0379e5a4b2177" + } + }, + "symfony/routing": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "6.2", + "ref": "e0a11b4ccb8c9e70b574ff5ad3dfdcd41dec5aa6" + }, + "files": [ + "config/packages/routing.yaml", + "config/routes.yaml" + ] + }, + "symfony/security-bundle": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "6.4", + "ref": "2ae08430db28c8eb4476605894296c82a642028f" + }, + "files": [ + "config/packages/security.yaml", + "config/routes/security.yaml" + ] + }, + "symfony/translation": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "6.3", + "ref": "e28e27f53663cc34f0be2837aba18e3a1bef8e7b" + }, + "files": [ + "config/packages/translation.yaml", + "translations/.gitignore" + ] + }, + "symfony/twig-bundle": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "6.4", + "ref": "cab5fd2a13a45c266d45a7d9337e28dee6272877" + }, + "files": [ + "config/packages/twig.yaml", + "templates/base.html.twig" + ] + }, + "symfony/validator": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "c32cfd98f714894c4f128bb99aa2530c1227603c" + }, + "files": [ + "config/packages/validator.yaml" + ] + }, + "symfony/web-profiler-bundle": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "6.1", + "ref": "e42b3f0177df239add25373083a564e5ead4e13a" + }, + "files": [ + "config/packages/web_profiler.yaml", + "config/routes/web_profiler.yaml" + ] + }, + "symfony/webpack-encore-bundle": { + "version": "1.17", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.10", + "ref": "eff2e505d4557c967b6710fe06bd947ba555cae5" + }, + "files": [ + "assets/app.js", + "assets/bootstrap.js", + "assets/controllers.json", + "assets/controllers/hello_controller.js", + "assets/styles/app.css", + "config/packages/webpack_encore.yaml", + "package.json", + "webpack.config.js" + ] + }, + "symfony/workflow": { + "version": "6.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "3.3", + "ref": "3b2f8ca32a07fcb00f899649053943fa3d8bbfb6" + }, + "files": [ + "config/packages/workflow.yaml" + ] + }, + "willdurand/hateoas-bundle": { + "version": "2.5", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "2.0", + "ref": "34df072c6edaa61ae19afb2f3a239f272fecab87" + } + }, + "winzou/state-machine-bundle": { + "version": "v0.6.2" + } +} diff --git a/tests/Behat/Context/Setup/ProductContext.php b/tests/Behat/Context/Setup/ProductContext.php index d7cfd15..ba12dae 100644 --- a/tests/Behat/Context/Setup/ProductContext.php +++ b/tests/Behat/Context/Setup/ProductContext.php @@ -14,7 +14,7 @@ final class ProductContext implements Context { public function __construct( private ExampleFactoryInterface $productExampleFactory, - private RepositoryInterface $productRepository + private RepositoryInterface $productRepository, ) { } @@ -31,7 +31,7 @@ public function transformWeight(string $weight): int */ public function theStoreHasProductPricedWhichWeights( string $productName, - int $weight + int $weight, ): void { /** @var ProductInterface $product */ $product = $this->productExampleFactory->create([ diff --git a/tests/Behat/Context/Setup/ShippingTableRateContext.php b/tests/Behat/Context/Setup/ShippingTableRateContext.php index 579563a..dc06efc 100644 --- a/tests/Behat/Context/Setup/ShippingTableRateContext.php +++ b/tests/Behat/Context/Setup/ShippingTableRateContext.php @@ -27,7 +27,7 @@ public function __construct( private ObjectManager $shippingTableRateManager, private SharedStorageInterface $sharedStorage, private ExampleFactoryInterface $shippingMethodExampleFactory, - private RepositoryInterface $shippingMethodRepository + private RepositoryInterface $shippingMethodRepository, ) { } @@ -41,7 +41,7 @@ public function transformShippingTableRate(string $name): ShippingTableRate Assert::count( $shippingTableRates, 1, - sprintf('%d shipping table rates has been found with name "%s".', count($shippingTableRates), $name) + sprintf('%d shipping table rates has been found with name "%s".', count($shippingTableRates), $name), ); return $shippingTableRates[0]; @@ -80,7 +80,7 @@ public function thisShippingTableRateHasRateForShipmentsUpToKg(ShippingTableRate public function theStoreHasShippingMethodUsingTableRateForChannel( string $shippingMethodName, ShippingTableRate $shippingTableRate, - ChannelInterface $channel + ChannelInterface $channel, ): void { /** @var ShippingMethodInterface $shippingMethod */ $shippingMethod = $this->shippingMethodExampleFactory->create([ diff --git a/tests/Behat/Context/Ui/ManagingShippingMethodsWithTableRateContext.php b/tests/Behat/Context/Ui/ManagingShippingMethodsWithTableRateContext.php index c6f4805..f77a022 100644 --- a/tests/Behat/Context/Ui/ManagingShippingMethodsWithTableRateContext.php +++ b/tests/Behat/Context/Ui/ManagingShippingMethodsWithTableRateContext.php @@ -22,7 +22,7 @@ public function __construct(private UpdatePageInterface $updatePage) */ public function iShouldBeAbleToChooseOnlyTheTableRateForTheChannel( ShippingTableRate $shippingTableRate, - ChannelInterface $channel + ChannelInterface $channel, ): void { /** @var NodeElement[] $options */ $options = $this->updatePage->getTableRateOptions($channel->getCode()); diff --git a/tests/Behat/Context/Ui/ManagingTableRatesContext.php b/tests/Behat/Context/Ui/ManagingTableRatesContext.php index fc5fda8..52e0c0f 100644 --- a/tests/Behat/Context/Ui/ManagingTableRatesContext.php +++ b/tests/Behat/Context/Ui/ManagingTableRatesContext.php @@ -20,7 +20,7 @@ class ManagingTableRatesContext implements Context public function __construct( private IndexPageInterface $indexPage, private CreatePageInterface $createPage, - private UpdatePageInterface $updatePage + private UpdatePageInterface $updatePage, ) { } @@ -217,7 +217,7 @@ public function iShouldBeNotifiedThatAtLeastOneRateIsRequired() { Assert::same( $this->createPage->getFormValidationMessage(), - 'You should specify at least one rate for this table rate.' + 'You should specify at least one rate for this table rate.', ); } @@ -258,7 +258,7 @@ public function iChangeItsCurrencyTo(CurrencyInterface $currency) */ public function theTableRateShouldStillHaveCurrency( ShippingTableRate $shippingTableRate, - CurrencyInterface $currency + CurrencyInterface $currency, ) { Assert::same($shippingTableRate->getCurrency()->getCode(), $currency->getCode()); } @@ -270,7 +270,7 @@ public function iShouldBeNotifiedThatCodeHasToBeUnique() { $this->createPage->getValidationMessage( 'code', - 'There\'s another shipping table rate with the same code. The code has to be unique.' + 'There\'s another shipping table rate with the same code. The code has to be unique.', ); } @@ -278,12 +278,12 @@ public function iShouldBeNotifiedThatCodeHasToBeUnique() * @Then I should be notified that the table rate couldn't be deleted because is already used by the :shippingMethod shipping method */ public function iShouldBeNotifiedThatTheTableRateCouldntBeDeletedBecauseIsAlreadyUsedByTheShippingMethod( - ShippingMethod $shippingMethod + ShippingMethod $shippingMethod, ) { Assert::contains( $this->indexPage->getValidationMessage(), 'The table rate cannot be deleted because is currently used by the following shipping methods: ' . - $shippingMethod->getCode() + $shippingMethod->getCode(), ); } diff --git a/tests/Behat/Context/Ui/ShippingTableRateContext.php b/tests/Behat/Context/Ui/ShippingTableRateContext.php index ee1d67e..aa6030b 100644 --- a/tests/Behat/Context/Ui/ShippingTableRateContext.php +++ b/tests/Behat/Context/Ui/ShippingTableRateContext.php @@ -16,7 +16,7 @@ final class ShippingTableRateContext implements Context public function __construct( private AddressFactoryInterface $addressFactory, private AddressPageInterface $addressPage, - private SelectShippingPageInterface $selectShippingPage + private SelectShippingPageInterface $selectShippingPage, ) { } diff --git a/tests/Behat/Page/ShippingMethod/UpdatePage.php b/tests/Behat/Page/ShippingMethod/UpdatePage.php index ceb7022..262a6cc 100644 --- a/tests/Behat/Page/ShippingMethod/UpdatePage.php +++ b/tests/Behat/Page/ShippingMethod/UpdatePage.php @@ -12,7 +12,7 @@ public function getTableRateOptions(string $channelCode): array { return $this->getElement('table_rate', ['%channelCode%' => $channelCode])->findAll( 'css', - 'option[value!=""]' + 'option[value!=""]', ); } @@ -20,7 +20,7 @@ protected function getDefinedElements(): array { return array_merge( parent::getDefinedElements(), - ['table_rate' => '#sylius_shipping_method_configuration_%channelCode%_table_rate'] + ['table_rate' => '#sylius_shipping_method_configuration_%channelCode%_table_rate'], ); } } diff --git a/tests/Behat/Page/TableRate/CreatePage.php b/tests/Behat/Page/TableRate/CreatePage.php index 6f018cd..bd62a94 100644 --- a/tests/Behat/Page/TableRate/CreatePage.php +++ b/tests/Behat/Page/TableRate/CreatePage.php @@ -24,7 +24,7 @@ protected function getDefinedElements(): array { return array_merge( parent::getDefinedElements(), - self::getCreateUpdatePageDefinedElements() + self::getCreateUpdatePageDefinedElements(), ); } @@ -51,7 +51,7 @@ public function getFormValidationMessage(): string public function addRate(int $rate, int $weightLimit) { $weightLimitToRateField = $this->getDocument()->findById( - 'webgriffe_sylius_table_rate_plugin_shipping_table_rate_weightLimitToRate' + 'webgriffe_sylius_table_rate_plugin_shipping_table_rate_weightLimitToRate', ); $addRateButton = $weightLimitToRateField->findLink('Add'); $addRateButton->click(); diff --git a/tests/Behat/Page/TableRate/UpdatePage.php b/tests/Behat/Page/TableRate/UpdatePage.php index 08c1bee..dd86992 100644 --- a/tests/Behat/Page/TableRate/UpdatePage.php +++ b/tests/Behat/Page/TableRate/UpdatePage.php @@ -16,14 +16,14 @@ protected function getDefinedElements(): array { return array_merge( parent::getDefinedElements(), - CreatePage::getCreateUpdatePageDefinedElements() + CreatePage::getCreateUpdatePageDefinedElements(), ); } public function addRate(int $rate, int $weightLimit) { $weightLimitToRateField = $this->getDocument()->findById( - 'webgriffe_sylius_table_rate_plugin_shipping_table_rate_weightLimitToRate' + 'webgriffe_sylius_table_rate_plugin_shipping_table_rate_weightLimitToRate', ); $addRateButton = $weightLimitToRateField->findLink('Add'); $addRateButton->click();