mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
[Validator] Move constraint properties above the constructor
This commit is contained in:
parent
e0ad785f8b
commit
8b4f03687e
9 changed files with 39 additions and 39 deletions
|
|
@ -19,6 +19,9 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class AddingEligibleProductVariantToCart extends Constraint
|
||||
{
|
||||
/** @deprecated since Sylius 2.3, use $productVariantNotSufficientMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $productVariantNotSufficient = 'sylius.product_variant.not_sufficient';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
|
|
@ -63,9 +66,6 @@ final class AddingEligibleProductVariantToCart extends Constraint
|
|||
$this->productVariantNotSufficient = $this->productVariantNotSufficientMessage;
|
||||
}
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $productVariantNotSufficientMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $productVariantNotSufficient = 'sylius.product_variant.not_sufficient';
|
||||
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return 'sylius_api_validator_adding_eligible_product_variant_to_cart';
|
||||
|
|
|
|||
|
|
@ -19,6 +19,12 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ChangedItemQuantityInCart extends Constraint
|
||||
{
|
||||
/** @deprecated since Sylius 2.3, use $productVariantNotLongerAvailableMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $productVariantNotLongerAvailable = 'sylius.product_variant.not_longer_available';
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $productVariantNotSufficientMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $productVariantNotSufficient = 'sylius.product_variant.not_sufficient';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
|
|
@ -77,12 +83,6 @@ final class ChangedItemQuantityInCart extends Constraint
|
|||
$this->productVariantNotSufficient = $this->productVariantNotSufficientMessage;
|
||||
}
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $productVariantNotLongerAvailableMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $productVariantNotLongerAvailable = 'sylius.product_variant.not_longer_available';
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $productVariantNotSufficientMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $productVariantNotSufficient = 'sylius.product_variant.not_sufficient';
|
||||
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return 'sylius_api_validator_changed_item_quantity_in_cart';
|
||||
|
|
|
|||
|
|
@ -19,6 +19,15 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ChosenPaymentMethodEligibility extends Constraint
|
||||
{
|
||||
/** @deprecated since Sylius 2.3, use $notAvailableMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $notAvailable = 'sylius.payment_method.not_available';
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $notExistMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $notExist = 'sylius.payment_method.not_exist';
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $paymentNotFoundMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $paymentNotFound = 'sylius.payment.not_found';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
|
|
@ -91,15 +100,6 @@ final class ChosenPaymentMethodEligibility extends Constraint
|
|||
$this->paymentNotFound = $this->paymentNotFoundMessage;
|
||||
}
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $notAvailableMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $notAvailable = 'sylius.payment_method.not_available';
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $notExistMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $notExist = 'sylius.payment_method.not_exist';
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $paymentNotFoundMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $paymentNotFound = 'sylius.payment.not_found';
|
||||
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return 'sylius_api_chosen_payment_method_eligibility';
|
||||
|
|
|
|||
|
|
@ -20,6 +20,12 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ChosenPaymentRequestActionEligibility extends Constraint
|
||||
{
|
||||
/** @deprecated since Sylius 2.3, use $notAvailableMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $notAvailable = 'sylius.payment_request.action_not_available';
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $notExistMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $notExist = 'sylius.payment_method.not_exist';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
|
|
@ -76,12 +82,6 @@ final class ChosenPaymentRequestActionEligibility extends Constraint
|
|||
$this->notExist = $this->notExistMessage;
|
||||
}
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $notAvailableMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $notAvailable = 'sylius.payment_request.action_not_available';
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $notExistMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $notExist = 'sylius.payment_method.not_exist';
|
||||
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return 'sylius_api_chosen_payment_request_action_eligibility';
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class GatewayFactoryExists extends Constraint
|
||||
{
|
||||
/** @deprecated since Sylius 2.3, use $invalidGatewayFactoryMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $invalidGatewayFactory = 'sylius.gateway_config.invalid_gateway_factory';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
|
|
@ -59,9 +62,6 @@ final class GatewayFactoryExists extends Constraint
|
|||
$this->invalidGatewayFactory = $this->invalidGatewayFactoryMessage;
|
||||
}
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $invalidGatewayFactoryMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $invalidGatewayFactory = 'sylius.gateway_config.invalid_gateway_factory';
|
||||
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return 'sylius_gateway_factory_exists_validator';
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class CatalogPromotionActionType extends Constraint
|
||||
{
|
||||
/** @deprecated since Sylius 2.3, use $invalidTypeMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $invalidType = 'sylius.catalog_promotion_action.type.invalid';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
|
|
@ -59,9 +62,6 @@ final class CatalogPromotionActionType extends Constraint
|
|||
$this->invalidType = $this->invalidTypeMessage;
|
||||
}
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $invalidTypeMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $invalidType = 'sylius.catalog_promotion_action.type.invalid';
|
||||
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return 'sylius_catalog_promotion_action_type_validator';
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class CatalogPromotionScopeType extends Constraint
|
||||
{
|
||||
/** @deprecated since Sylius 2.3, use $invalidTypeMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $invalidType = 'sylius.catalog_promotion_scope.type.invalid';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
|
|
@ -59,9 +62,6 @@ final class CatalogPromotionScopeType extends Constraint
|
|||
$this->invalidType = $this->invalidTypeMessage;
|
||||
}
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $invalidTypeMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $invalidType = 'sylius.catalog_promotion_scope.type.invalid';
|
||||
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return 'sylius_catalog_promotion_scope_type_validator';
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class PromotionActionType extends Constraint
|
||||
{
|
||||
/** @deprecated since Sylius 2.3, use $invalidTypeMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $invalidType = 'sylius.promotion_action.invalid_type';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
|
|
@ -59,9 +62,6 @@ final class PromotionActionType extends Constraint
|
|||
$this->invalidType = $this->invalidTypeMessage;
|
||||
}
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $invalidTypeMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $invalidType = 'sylius.promotion_action.invalid_type';
|
||||
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return 'sylius_promotion_action_type';
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class PromotionRuleType extends Constraint
|
||||
{
|
||||
/** @deprecated since Sylius 2.3, use $invalidTypeMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $invalidType = 'sylius.promotion_rule.invalid_type';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
|
|
@ -59,9 +62,6 @@ final class PromotionRuleType extends Constraint
|
|||
$this->invalidType = $this->invalidTypeMessage;
|
||||
}
|
||||
|
||||
/** @deprecated since Sylius 2.3, use $invalidTypeMessage instead. It will be removed in Sylius 3.0. */
|
||||
public string $invalidType = 'sylius.promotion_rule.invalid_type';
|
||||
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return 'sylius_promotion_rule_type';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue