Merge branch '2.0' into symfony-7

* 2.0:
  [Maintenance] Remove message buses duplications
  [CS][DX] Refactor
  Minor CS fix in workflow
  [Resource] Add validation for translatable interface with new namespace
  Apply suggestions from code review
  Both resource and grid unstable versions
  Try SyliusGridBundle 1.13
  [Core] Move validation of translation classes to Core
This commit is contained in:
Grzegorz Sadowski 2024-08-29 14:13:02 +02:00
commit c934b83c90
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364
27 changed files with 56 additions and 268 deletions

View file

@ -14,9 +14,9 @@ permissions:
contents: read
jobs:
behat-no-js-unstable-symfony:
behat-no-js-unstable-dependencies:
runs-on: ubuntu-latest
name: "Non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }} (Unstable Dependencies)"
name: "Non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, Resource ${{ matrix.resource }}, Grid ${{ matrix.grid }} (Unstable Dependencies)"
timeout-minutes: 45
continue-on-error: true
strategy:
@ -25,6 +25,8 @@ jobs:
php: [ "8.2" ]
symfony: [ "^6.4" ]
mysql: [ "8.0" ]
resource: ["^1.11@dev"]
grid: [ "^1.13@dev" ]
env:
APP_ENV: test_cached
@ -68,6 +70,14 @@ jobs:
echo "{}" > public/build/app/admin/manifest.json
echo "{}" > public/build/app/shop/manifest.json
- name: Require SyliusResourceBundle version
run: |
composer require sylius/resource-bundle:${{ matrix.resource }} --no-update
- name: Require SyliusGridBundle version
run: |
composer require sylius/grid-bundle:${{ matrix.grid }} --no-update
- name: Build application
uses: SyliusLabs/BuildTestAppAction@v2.2
with:

View file

@ -8,6 +8,12 @@
+ #[Groups(['sylius:admin:product:index'])]
```
## Configuration
* Messenger:
* The `sylius_default.bus` and `sylius_event.bus` configuration options were removed. Use `sylius.command_bus` and
`sylius.event_bus` for commands and events respectively.
## Codebase
* Doctrine MongoDB and PHPCR is not longer supported in ResourceBundle and GridBundle:

View file

@ -0,0 +1,24 @@
# Unification of base message buses in sylius
* Status: accepted
* Date: 2024-29-08
## Context and Problem Statement
Due to historical reasons, and being BC compliant, we had duplications with our message buses.
We had `sylius.command_bus` and `sylius_default.bus` for commands, `sylius.event_bus` and `sylius_default.bus` for events.
## Decision Drivers
* Unification of the message buses
* Simplification of configuration and usage
* Lesser cognitive load for developers
## Decision Outcome
Keep only one message bus per context.
Users shouldn't have to think about which bus to use.
In conclusion anyone using Sylius should use:
- `sylius.command_bus` for commands
- `sylius.event_bus` for events
- `sylius.query_bus` for queries

View file

@ -51,7 +51,6 @@
<argument type="service" id="validator" />
<argument>%sylius_admin.command_handler.create_admin_user.validation_groups%</argument>
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="sylius.console.command_factory.question" class="Sylius\Bundle\AdminBundle\Console\Command\Factory\QuestionFactory" />

View file

@ -26,7 +26,6 @@
<argument type="service" id="sylius.shop_user.token_generator.email_verification" />
<argument type="service" id="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Cart\PickupCartHandler">
@ -38,7 +37,6 @@
<argument type="service" id="sylius.repository.customer" />
<argument>%sylius_core.order_token_length%</argument>
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus"/>
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Cart\AddItemToCartHandler">
@ -48,19 +46,16 @@
<argument type="service" id="sylius.factory.order_item" />
<argument type="service" id="sylius.order_item_quantity_modifier" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Cart\RemoveItemFromCartHandler">
<argument type="service" id="sylius.repository.order_item" />
<argument type="service" id="sylius.order_modifier" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Cart\InformAboutCartRecalculationHandler">
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Checkout\UpdateCartHandler">
@ -70,7 +65,6 @@
<argument type="service" id="Sylius\Bundle\CoreBundle\Resolver\CustomerResolverInterface" />
<argument type="service" id="Sylius\Bundle\ApiBundle\Context\UserContextInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Checkout\ChooseShippingMethodHandler">
@ -80,7 +74,6 @@
<argument type="service" id="sylius.shipping_method_eligibility_checker" />
<argument type="service" id="sylius_abstraction.state_machine" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Checkout\ChoosePaymentMethodHandler">
@ -90,7 +83,6 @@
<argument type="service" id="sylius_abstraction.state_machine" />
<argument type="service" id="Sylius\Bundle\ApiBundle\Changer\PaymentMethodChangerInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Checkout\CompleteOrderHandler">
@ -100,7 +92,6 @@
<argument type="service" id="sylius.event_bus" />
<argument type="service" id="Sylius\Bundle\CoreBundle\Order\Checker\OrderPromotionsIntegrityCheckerInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Checkout\ShipShipmentHandler">
@ -108,14 +99,12 @@
<argument type="service" id="sylius_abstraction.state_machine" />
<argument type="service" id="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Account\ChangePaymentMethodHandler">
<argument type="service" id="Sylius\Bundle\ApiBundle\Changer\PaymentMethodChangerInterface" />
<argument type="service" id="sylius.repository.order"/>
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Cart\ChangeItemQuantityInCartHandler">
@ -123,7 +112,6 @@
<argument type="service" id="sylius.order_item_quantity_modifier" />
<argument type="service" id="sylius.order_processing.order_processor" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Catalog\AddProductReviewHandler">
@ -132,7 +120,6 @@
<argument type="service" id="sylius.repository.product" />
<argument type="service" id="Sylius\Bundle\CoreBundle\Resolver\CustomerResolverInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus"/>
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Cart\BlameCartHandler">
@ -140,14 +127,12 @@
<argument type="service" id="sylius.repository.order" />
<argument type="service" id="sylius.order_processing.order_processor" />
<tag name="messenger.message_handler" bus="sylius.command_bus"/>
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Account\ChangeShopUserPasswordHandler">
<argument type="service" id="sylius.security.password_updater" />
<argument type="service" id="sylius.repository.shop_user" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Account\RequestResetPasswordTokenHandler">
@ -156,7 +141,6 @@
<argument type="service" id="sylius.shop_user.token_generator.password_reset" />
<argument type="service" id="clock" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Account\ResendVerificationEmailHandler">
@ -164,13 +148,11 @@
<argument type="service" id="sylius.shop_user.token_generator.email_verification" />
<argument type="service" id="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Account\ResetPasswordHandler">
<argument type="service" id="sylius.user_password_resetter.shop" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Account\SendAccountRegistrationEmailHandler">
@ -178,7 +160,6 @@
<argument type="service" id="sylius.repository.channel" />
<argument type="service" id="Sylius\Bundle\CoreBundle\Mailer\AccountRegistrationEmailManagerInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Account\SendAccountVerificationEmailHandler">
@ -186,14 +167,12 @@
<argument type="service" id="sylius.repository.channel" />
<argument type="service" id="Sylius\Bundle\CoreBundle\Mailer\AccountVerificationEmailManagerInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Checkout\SendOrderConfirmationHandler">
<argument type="service" id="sylius.repository.order" />
<argument type="service" id="Sylius\Bundle\CoreBundle\Mailer\OrderEmailManagerInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Account\SendResetPasswordEmailHandler">
@ -201,14 +180,12 @@
<argument type="service" id="sylius.repository.shop_user" />
<argument type="service" id="Sylius\Bundle\CoreBundle\Mailer\ResetPasswordEmailManagerInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Checkout\SendShipmentConfirmationEmailHandler">
<argument type="service" id="sylius.repository.shipment" />
<argument type="service" id="Sylius\Bundle\CoreBundle\Mailer\ShipmentEmailManagerInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Account\VerifyCustomerAccountHandler">
@ -216,27 +193,23 @@
<argument type="service" id="clock" />
<argument type="service" id="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\SendContactRequestHandler">
<argument type="service" id="sylius.repository.channel" />
<argument type="service" id="Sylius\Bundle\CoreBundle\Mailer\ContactEmailManagerInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Promotion\GeneratePromotionCouponHandler">
<argument type="service" id="sylius.repository.promotion" />
<argument type="service" id="sylius.promotion_coupon_generator" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Customer\RemoveShopUserHandler">
<argument type="service" id="sylius.repository.shop_user" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
</services>
</container>

View file

@ -13,14 +13,6 @@
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Attribute\Model\AttributeTranslation">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>
<value>translatable</value>
</option>
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.unique</option>
</constraint>
<property name="name">
<constraint name="NotBlank">
<option name="message">sylius.attribute.name.not_blank</option>
@ -34,15 +26,5 @@
<option name="groups">sylius</option>
</constraint>
</property>
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
</constraint-mapping>

View file

@ -24,8 +24,3 @@ sylius:
not_blank: Please select attribute.
value:
not_blank: Please enter attribute value.
translation:
locale:
not_blank: Please enter the locale.
invalid: This value is not a valid locale.
unique: A translation for the {{ value }} locale code already exists.

View file

@ -32,14 +32,12 @@ framework:
'Sylius\Component\Promotion\Event\CatalogPromotionUpdated': main
default_bus: sylius.command_bus
buses:
sylius.command_bus: &command_bus
sylius.command_bus:
middleware:
- 'validation'
- 'doctrine_transaction'
sylius.query_bus:
middleware:
- validation
sylius.event_bus: &event_bus
sylius.event_bus:
default_middleware: allow_no_handlers
sylius_default.bus: *command_bus
sylius_event.bus: *event_bus

View file

@ -24,7 +24,6 @@
<argument type="service" id="clock" />
<argument type="service" id="messenger.default_bus" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="sylius.command_handler.resend_shipment_confirmation_email"
@ -33,7 +32,6 @@
<argument type="service" id="sylius.repository.shipment" />
<argument type="service" id="Sylius\Bundle\CoreBundle\Mailer\ShipmentEmailManagerInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="sylius.command_handler.admin.account.reset_password"
@ -42,7 +40,6 @@
<argument type="service" id="sylius.user_password_resetter.admin" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="sylius.command_handler.resend_order_confirmation_email"
@ -51,7 +48,6 @@
<argument type="service" id="Sylius\Bundle\CoreBundle\Mailer\OrderEmailManagerInterface" />
<argument type="service" id="sylius.repository.order" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
<service id="sylius.command_handler.admin.account.send_reset_password_email"
@ -61,7 +57,6 @@
<argument type="service" id="Sylius\Bundle\CoreBundle\Mailer\ResetPasswordEmailManagerInterface" />
<tag name="messenger.message_handler" bus="sylius.command_bus" />
<tag name="messenger.message_handler" bus="sylius_default.bus" />
</service>
</services>
</container>

View file

@ -12,7 +12,7 @@
-->
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Product\Model\ProductVariantTranslation">
<class name="Sylius\Component\Resource\Model\AbstractTranslation">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>

View file

@ -17,4 +17,10 @@
<option name="groups">sylius</option>
</constraint>
</class>
<class name="Sylius\Resource\Model\TranslatableInterface">
<constraint name="Sylius\Bundle\CoreBundle\Validator\Constraints\TranslationForExistingLocales">
<option name="groups">sylius</option>
</constraint>
</class>
</constraint-mapping>

View file

@ -174,6 +174,10 @@ sylius:
max_size: The image is too big - {{ size }}{{ suffix }}. Maximum allowed size is {{ limit }}{{ suffix }}.
upload_ini_size: The image is too big. Maximum allowed size is {{ limit }}{{ suffix }}.
translation:
locale:
not_blank: 'Please enter the locale.'
invalid: 'This value is not a valid locale.'
unique: 'A translation for the {{ value }} locale code already exists.'
locale_code:
invalid: 'Please choose one of the available locales: %locales%'
user:

View file

@ -13,14 +13,6 @@
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Payment\Model\PaymentMethodTranslation">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>
<value>translatable</value>
</option>
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.unique</option>
</constraint>
<property name="name">
<constraint name="NotBlank">
<option name="message">sylius.payment_method.name.not_blank</option>
@ -34,15 +26,5 @@
<option name="groups">sylius</option>
</constraint>
</property>
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
</constraint-mapping>

View file

@ -41,8 +41,3 @@ sylius:
not_blank: 'Please enter payment method code.'
regex: 'Payment method code can only be comprised of letters, numbers, dashes and underscores.'
unique: 'The payment method with given code already exists.'
translation:
locale:
not_blank: Please enter the locale.
invalid: This value is not a valid locale.
unique: A translation for the {{ value }} locale code already exists.

View file

@ -13,14 +13,6 @@
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Product\Model\ProductAssociationTypeTranslation">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>
<value>translatable</value>
</option>
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.unique</option>
</constraint>
<property name="name">
<constraint name="NotBlank">
<option name="message">sylius.association_type.name.not_blank</option>
@ -34,15 +26,5 @@
<option name="groups">sylius</option>
</constraint>
</property>
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
</constraint-mapping>

View file

@ -13,14 +13,6 @@
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Product\Model\ProductOptionTranslation">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>
<value>translatable</value>
</option>
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.unique</option>
</constraint>
<property name="name">
<constraint name="NotBlank">
<option name="message">sylius.option.name.not_blank</option>
@ -34,15 +26,5 @@
<option name="groups">sylius</option>
</constraint>
</property>
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
</constraint-mapping>

View file

@ -13,29 +13,11 @@
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Product\Model\ProductOptionValueTranslation">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>
<value>translatable</value>
</option>
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.unique</option>
</constraint>
<property name="value">
<constraint name="NotBlank">
<option name="message">sylius.option_value.value.not_blank</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
</constraint-mapping>

View file

@ -13,14 +13,6 @@
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Product\Model\ProductTranslation">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>
<value>translatable</value>
</option>
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.unique</option>
</constraint>
<property name="name">
<constraint name="NotBlank">
<option name="message">sylius.product.name.not_blank</option>
@ -68,15 +60,5 @@
<option name="groups">sylius</option>
</constraint>
</property>
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
</constraint-mapping>

View file

@ -68,8 +68,3 @@ sylius:
not_blank: Please enter association type code.
regex: Association type code can only be comprised of letters, numbers, dashes and underscores.
unique: The association type with given code already exists.
translation:
locale:
not_blank: Please enter the locale.
invalid: This value is not a valid locale.
unique: A translation for the {{ value }} locale code already exists.

View file

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the Sylius package.
(c) Sylius Sp. z o.o.
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Promotion\Model\CatalogPromotionTranslation">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>
<value>translatable</value>
</option>
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.unique</option>
</constraint>
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
</constraint-mapping>

View file

@ -13,29 +13,11 @@
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Promotion\Model\PromotionTranslation">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>
<value>translatable</value>
</option>
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.unique</option>
</constraint>
<property name="label">
<constraint name="Length">
<option name="max">255</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
</constraint-mapping>

View file

@ -76,8 +76,3 @@ sylius:
possible_generation_amount: Invalid coupons code length or coupons amount. It is not possible to generate %expectedAmount% unique coupons with code length %codeLength%. The possible amount to generate is %possibleAmount%.
usage_limit:
min: Usage limit of generated coupons must be at least {{ limit }}.
translation:
locale:
not_blank: Please enter the locale.
invalid: This value is not a valid locale.
unique: A translation for the {{ value }} locale code already exists.

View file

@ -13,14 +13,6 @@
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Shipping\Model\ShippingMethodTranslation">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>
<value>translatable</value>
</option>
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.unique</option>
</constraint>
<property name="name">
<constraint name="NotBlank">
<option name="message">sylius.shipping_method.name.not_blank</option>
@ -34,15 +26,5 @@
<option name="groups">sylius</option>
</constraint>
</property>
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
</class>
</constraint-mapping>

View file

@ -35,8 +35,3 @@ sylius:
shipment:
shipping_method:
not_blank: 'Please select shipping method.'
translation:
locale:
not_blank: 'Please enter the locale.'
invalid: 'This value is not a valid locale.'
unique: 'A translation for the {{ value }} locale code already exists.'

View file

@ -13,14 +13,6 @@
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Taxonomy\Model\TaxonTranslation">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>
<value>translatable</value>
</option>
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.unique</option>
</constraint>
<property name="name">
<constraint name="NotBlank">
<option name="message">sylius.taxon.name.not_blank</option>
@ -38,16 +30,6 @@
<option name="groups">sylius</option>
</constraint>
</property>
<property name="locale">
<constraint name="NotBlank">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.not_blank</option>
</constraint>
<constraint name="Locale">
<option name="groups">sylius</option>
<option name="message">sylius.translation.locale.invalid</option>
</constraint>
</property>
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">
<value>locale</value>

View file

@ -18,8 +18,3 @@ sylius:
name:
max_length: Taxonomy name must not be longer than 255 characters.
not_blank: Please enter taxonomy name.
translation:
locale:
not_blank: Please enter the locale.
invalid: This value is not a valid locale.
unique: A translation for the {{ value }} locale code already exists.

View file

@ -16,7 +16,6 @@ namespace Sylius\Component\Core\Provider\ProductVariantMap;
use Sylius\Component\Core\Calculator\ProductVariantPricesCalculatorInterface;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\ProductVariantInterface;
use Webmozart\Assert\Assert;
final readonly class ProductVariantLowestPriceMapProvider implements ProductVariantMapProviderInterface
{
@ -26,6 +25,7 @@ final readonly class ProductVariantLowestPriceMapProvider implements ProductVari
/**
* @param array<string, mixed> $context
*
* @return array<string, mixed>
*/
public function provide(ProductVariantInterface $variant, array $context): array