mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
[Validator] Keep backward-compatible array options with a deprecation
This commit is contained in:
parent
e603a8c63e
commit
a167cac1db
78 changed files with 1514 additions and 230 deletions
|
|
@ -26,14 +26,29 @@ class ProvinceAddressConstraint extends Constraint
|
|||
public $message = 'sylius.address.province.valid';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/addressing-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message ?? $this->message;
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class UniqueProvinceCollection extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.country.unique_provinces',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/addressing-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.country.unique_provinces';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ZoneCannotContainItself extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.zone_member.cannot_be_the_same_as_zone',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/addressing-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.zone_member.cannot_be_the_same_as_zone';
|
||||
|
|
|
|||
|
|
@ -19,20 +19,38 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class AddingEligibleProductVariantToCart extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $productNotExistMessage = 'sylius.product.not_exist',
|
||||
string $productVariantNotExistMessage = 'sylius.product_variant.not_exist',
|
||||
string $productVariantNotSufficient = 'sylius.product_variant.not_sufficient',
|
||||
?array $options = null,
|
||||
?string $productNotExistMessage = null,
|
||||
?string $productVariantNotExistMessage = null,
|
||||
?string $productVariantNotSufficient = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$productNotExistMessage ??= $options['productNotExistMessage'] ?? null;
|
||||
$productVariantNotExistMessage ??= $options['productVariantNotExistMessage'] ?? null;
|
||||
$productVariantNotSufficient ??= $options['productVariantNotSufficient'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->productNotExistMessage = $productNotExistMessage;
|
||||
$this->productVariantNotExistMessage = $productVariantNotExistMessage;
|
||||
$this->productVariantNotSufficient = $productVariantNotSufficient;
|
||||
$this->productNotExistMessage = $productNotExistMessage ?? $this->productNotExistMessage;
|
||||
$this->productVariantNotExistMessage = $productVariantNotExistMessage ?? $this->productVariantNotExistMessage;
|
||||
$this->productVariantNotSufficient = $productVariantNotSufficient ?? $this->productVariantNotSufficient;
|
||||
}
|
||||
|
||||
public string $productNotExistMessage = 'sylius.product.not_exist';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class AdminResetPasswordTokenNonExpired extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.admin.expired_password_reset_token',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.admin.expired_password_reset_token';
|
||||
|
|
|
|||
|
|
@ -19,20 +19,38 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ChangedItemQuantityInCart extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $productNotExistMessage = 'sylius.product.not_exist',
|
||||
string $productVariantNotLongerAvailable = 'sylius.product_variant.not_longer_available',
|
||||
string $productVariantNotSufficient = 'sylius.product_variant.not_sufficient',
|
||||
?array $options = null,
|
||||
?string $productNotExistMessage = null,
|
||||
?string $productVariantNotLongerAvailable = null,
|
||||
?string $productVariantNotSufficient = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$productNotExistMessage ??= $options['productNotExistMessage'] ?? null;
|
||||
$productVariantNotLongerAvailable ??= $options['productVariantNotLongerAvailable'] ?? null;
|
||||
$productVariantNotSufficient ??= $options['productVariantNotSufficient'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->productNotExistMessage = $productNotExistMessage;
|
||||
$this->productVariantNotLongerAvailable = $productVariantNotLongerAvailable;
|
||||
$this->productVariantNotSufficient = $productVariantNotSufficient;
|
||||
$this->productNotExistMessage = $productNotExistMessage ?? $this->productNotExistMessage;
|
||||
$this->productVariantNotLongerAvailable = $productVariantNotLongerAvailable ?? $this->productVariantNotLongerAvailable;
|
||||
$this->productVariantNotSufficient = $productVariantNotSufficient ?? $this->productVariantNotSufficient;
|
||||
}
|
||||
|
||||
public string $productNotExistMessage = 'sylius.product.not_exist';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
class CheckoutCompletion extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.order.invalid_state_transition',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.order.invalid_state_transition';
|
||||
|
|
|
|||
|
|
@ -19,20 +19,38 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ChosenPaymentMethodEligibility extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $notAvailable = 'sylius.payment_method.not_available',
|
||||
string $notExist = 'sylius.payment_method.not_exist',
|
||||
string $paymentNotFound = 'sylius.payment.not_found',
|
||||
?array $options = null,
|
||||
?string $notAvailable = null,
|
||||
?string $notExist = null,
|
||||
?string $paymentNotFound = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$notAvailable ??= $options['notAvailable'] ?? null;
|
||||
$notExist ??= $options['notExist'] ?? null;
|
||||
$paymentNotFound ??= $options['paymentNotFound'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->notAvailable = $notAvailable;
|
||||
$this->notExist = $notExist;
|
||||
$this->paymentNotFound = $paymentNotFound;
|
||||
$this->notAvailable = $notAvailable ?? $this->notAvailable;
|
||||
$this->notExist = $notExist ?? $this->notExist;
|
||||
$this->paymentNotFound = $paymentNotFound ?? $this->paymentNotFound;
|
||||
}
|
||||
|
||||
public string $notAvailable = 'sylius.payment_method.not_available';
|
||||
|
|
|
|||
|
|
@ -20,18 +20,35 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ChosenPaymentRequestActionEligibility extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $notAvailable = 'sylius.payment_request.action_not_available',
|
||||
string $notExist = 'sylius.payment_method.not_exist',
|
||||
?array $options = null,
|
||||
?string $notAvailable = null,
|
||||
?string $notExist = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$notAvailable ??= $options['notAvailable'] ?? null;
|
||||
$notExist ??= $options['notExist'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->notAvailable = $notAvailable;
|
||||
$this->notExist = $notExist;
|
||||
$this->notAvailable = $notAvailable ?? $this->notAvailable;
|
||||
$this->notExist = $notExist ?? $this->notExist;
|
||||
}
|
||||
|
||||
public string $notAvailable = 'sylius.payment_request.action_not_available';
|
||||
|
|
|
|||
|
|
@ -19,20 +19,38 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ChosenShippingMethodEligibility extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.shipping_method.not_available',
|
||||
string $notFoundMessage = 'sylius.shipping_method.not_found',
|
||||
string $shipmentNotFoundMessage = 'sylius.shipment.not_found',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?string $notFoundMessage = null,
|
||||
?string $shipmentNotFoundMessage = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$notFoundMessage ??= $options['notFoundMessage'] ?? null;
|
||||
$shipmentNotFoundMessage ??= $options['shipmentNotFoundMessage'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->notFoundMessage = $notFoundMessage;
|
||||
$this->shipmentNotFoundMessage = $shipmentNotFoundMessage;
|
||||
$this->message = $message ?? $this->message;
|
||||
$this->notFoundMessage = $notFoundMessage ?? $this->notFoundMessage;
|
||||
$this->shipmentNotFoundMessage = $shipmentNotFoundMessage ?? $this->shipmentNotFoundMessage;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.shipping_method.not_available';
|
||||
|
|
|
|||
|
|
@ -23,14 +23,29 @@ final class ConfirmResetPassword extends Constraint
|
|||
public $message = 'sylius.user.plainPassword.mismatch';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message ?? $this->message;
|
||||
|
|
|
|||
|
|
@ -23,14 +23,29 @@ final class CorrectChangeShopUserConfirmPassword extends Constraint
|
|||
public $message = 'sylius.user.plainPassword.mismatch';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message ?? $this->message;
|
||||
|
|
|
|||
|
|
@ -19,18 +19,35 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class CorrectOrderAddress extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $countryCodeNotExistMessage = 'sylius.country.not_exist',
|
||||
string $addressWithoutCountryCodeCanNotExistMessage = 'sylius.address.without_country',
|
||||
?array $options = null,
|
||||
?string $countryCodeNotExistMessage = null,
|
||||
?string $addressWithoutCountryCodeCanNotExistMessage = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$countryCodeNotExistMessage ??= $options['countryCodeNotExistMessage'] ?? null;
|
||||
$addressWithoutCountryCodeCanNotExistMessage ??= $options['addressWithoutCountryCodeCanNotExistMessage'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->countryCodeNotExistMessage = $countryCodeNotExistMessage;
|
||||
$this->addressWithoutCountryCodeCanNotExistMessage = $addressWithoutCountryCodeCanNotExistMessage;
|
||||
$this->countryCodeNotExistMessage = $countryCodeNotExistMessage ?? $this->countryCodeNotExistMessage;
|
||||
$this->addressWithoutCountryCodeCanNotExistMessage = $addressWithoutCountryCodeCanNotExistMessage ?? $this->addressWithoutCountryCodeCanNotExistMessage;
|
||||
}
|
||||
|
||||
public string $countryCodeNotExistMessage = 'sylius.country.not_exist';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class OrderAddressRequirement extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.order.address_requirement',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.order.address_requirement';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class OrderItemAvailability extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.product_variant.product_variant_with_name_not_sufficient',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.product_variant.product_variant_with_name_not_sufficient';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class OrderNotEmpty extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.order.not_empty',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.order.not_empty';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class OrderPaymentMethodEligibility extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.order.payment_method_eligibility',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.order.payment_method_eligibility';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class OrderProductEligibility extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.order.product_eligibility',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.order.product_eligibility';
|
||||
|
|
|
|||
|
|
@ -19,14 +19,40 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class OrderShippingMethodEligibility extends Constraint
|
||||
{
|
||||
public string $message = 'sylius.order.shipping_method_eligibility';
|
||||
|
||||
public string $methodNotAvailableMessage = 'sylius.order.shipping_method_not_available';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
public string $message = 'sylius.order.shipping_method_eligibility',
|
||||
public string $methodNotAvailableMessage = 'sylius.order.shipping_method_not_available',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?string $methodNotAvailableMessage = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$methodNotAvailableMessage ??= $options['methodNotAvailableMessage'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message ?? $this->message;
|
||||
$this->methodNotAvailableMessage = $methodNotAvailableMessage ?? $this->methodNotAvailableMessage;
|
||||
}
|
||||
|
||||
public function getMessage(): string
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class PlacedOrderCartItemsImmutable extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.order.cart_items_immutable',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.order.cart_items_immutable';
|
||||
|
|
|
|||
|
|
@ -23,14 +23,29 @@ final class PromotionCouponEligibility extends Constraint
|
|||
public $message = 'sylius.promotion_coupon.is_invalid';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message ?? $this->message;
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ShipmentAlreadyShipped extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.shipment.shipped',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.shipment.shipped';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ShopUserNotVerified extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.account.is_verified',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.account.is_verified';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ShopUserResetPasswordTokenExists extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.reset_password.invalid_token',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.reset_password.invalid_token';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ShopUserResetPasswordTokenNotExpired extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.reset_password.token_expired',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.reset_password.token_expired';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ShopUserVerificationTokenEligibility extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.account.invalid_verification_token',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.account.invalid_verification_token';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class SingleValueForProductVariantOption extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.product_variant.option_values.single_value',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.product_variant.option_values.single_value';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class UniqueReviewerEmail extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.review.author.already_exists',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.review.author.already_exists';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class UniqueShopUserEmail extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.user.email.unique',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.user.email.unique';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class UpdateCartEmailNotAllowed extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.checkout.email.not_changeable',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/api-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.checkout.email.not_changeable';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
class AttributeType extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $unregisteredAttributeTypeMessage = 'sylius.attribute.type.unregistered',
|
||||
?array $options = null,
|
||||
?string $unregisteredAttributeTypeMessage = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/attribute-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$unregisteredAttributeTypeMessage ??= $options['unregisteredAttributeTypeMessage'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->unregisteredAttributeTypeMessage = $unregisteredAttributeTypeMessage;
|
||||
$this->unregisteredAttributeTypeMessage = $unregisteredAttributeTypeMessage ?? $this->unregisteredAttributeTypeMessage;
|
||||
}
|
||||
|
||||
public string $unregisteredAttributeTypeMessage = 'sylius.attribute.type.unregistered';
|
||||
|
|
|
|||
|
|
@ -19,20 +19,38 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ValidSelectAttributeConfiguration extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $messageMultiple = 'sylius.attribute.configuration.multiple',
|
||||
string $messageMinEntries = 'sylius.attribute.configuration.min_entries',
|
||||
string $messageMaxEntries = 'sylius.attribute.configuration.max_entries',
|
||||
?array $options = null,
|
||||
?string $messageMultiple = null,
|
||||
?string $messageMinEntries = null,
|
||||
?string $messageMaxEntries = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/attribute-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$messageMultiple ??= $options['messageMultiple'] ?? null;
|
||||
$messageMinEntries ??= $options['messageMinEntries'] ?? null;
|
||||
$messageMaxEntries ??= $options['messageMaxEntries'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->messageMultiple = $messageMultiple;
|
||||
$this->messageMinEntries = $messageMinEntries;
|
||||
$this->messageMaxEntries = $messageMaxEntries;
|
||||
$this->messageMultiple = $messageMultiple ?? $this->messageMultiple;
|
||||
$this->messageMinEntries = $messageMinEntries ?? $this->messageMinEntries;
|
||||
$this->messageMaxEntries = $messageMaxEntries ?? $this->messageMaxEntries;
|
||||
}
|
||||
|
||||
public string $messageMultiple = 'sylius.attribute.configuration.multiple';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ValidTextAttributeConfiguration extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.attribute.configuration.max_length',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/attribute-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.attribute.configuration.max_length';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class AllowedImageMimeTypes extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.image.file.allowed_mime_types',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.image.file.allowed_mime_types';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class CartItemAvailability extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.cart_item.not_available',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.cart_item.not_available';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class CartItemVariantEnabled extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.cart_item.variant.not_available',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.cart_item.variant.not_available';
|
||||
|
|
|
|||
|
|
@ -37,11 +37,13 @@ final class ChannelCodeCollection extends Constraint
|
|||
public bool $validateAgainstAllChannels = false;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<Constraint>|null $constraints
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?array $constraints = null,
|
||||
?bool $allowExtraFields = null,
|
||||
?bool $allowMissingFields = null,
|
||||
|
|
@ -53,6 +55,26 @@ final class ChannelCodeCollection extends Constraint
|
|||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$constraints ??= $options['constraints'] ?? null;
|
||||
$allowExtraFields ??= $options['allowExtraFields'] ?? null;
|
||||
$allowMissingFields ??= $options['allowMissingFields'] ?? null;
|
||||
$channelAwarePropertyPath ??= $options['channelAwarePropertyPath'] ?? null;
|
||||
$extraFieldsMessage ??= $options['extraFieldsMessage'] ?? null;
|
||||
$missingFieldsMessage ??= $options['missingFieldsMessage'] ?? null;
|
||||
$invalidChannelMessage ??= $options['invalidChannelMessage'] ?? null;
|
||||
$validateAgainstAllChannels ??= $options['validateAgainstAllChannels'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->constraints = $constraints ?? $this->constraints;
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ChannelDefaultLocaleEnabled extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.channel.default_locale.enabled',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.channel.default_locale.enabled';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class CountryCodeExists extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.country.code.not_exist',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.country.code.not_exist';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class CustomerGroupCodeExists extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.customer_group.code.not_exist',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.customer_group.code.not_exist';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ExistingChannelCode extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.product_variant.channel_pricing.existing_code',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.product_variant.channel_pricing.existing_code';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class HasAllPricesDefined extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.product_variant.channel_pricing.price.not_defined',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.product_variant.channel_pricing.price.not_defined';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class HasAllVariantPricesDefined extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.product.variants.all_prices_defined',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.product.variants.all_prices_defined';
|
||||
|
|
|
|||
|
|
@ -19,24 +19,44 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class HasEnabledEntity extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $objectManager = null,
|
||||
string $message = 'Must have at least one enabled entity',
|
||||
string $repositoryMethod = 'findBy',
|
||||
?string $message = null,
|
||||
?string $repositoryMethod = null,
|
||||
?string $errorPath = null,
|
||||
string $enabledPath = 'enabled',
|
||||
?string $enabledPath = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$objectManager ??= $options['objectManager'] ?? null;
|
||||
$message ??= $options['message'] ?? null;
|
||||
$repositoryMethod ??= $options['repositoryMethod'] ?? null;
|
||||
$errorPath ??= $options['errorPath'] ?? null;
|
||||
$enabledPath ??= $options['enabledPath'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->objectManager = $objectManager;
|
||||
$this->message = $message;
|
||||
$this->repositoryMethod = $repositoryMethod;
|
||||
$this->errorPath = $errorPath;
|
||||
$this->enabledPath = $enabledPath;
|
||||
$this->objectManager = $objectManager ?? $this->objectManager;
|
||||
$this->message = $message ?? $this->message;
|
||||
$this->repositoryMethod = $repositoryMethod ?? $this->repositoryMethod;
|
||||
$this->errorPath = $errorPath ?? $this->errorPath;
|
||||
$this->enabledPath = $enabledPath ?? $this->enabledPath;
|
||||
}
|
||||
|
||||
public ?string $objectManager = null;
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class MaxInteger extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.max_integer',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.max_integer';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class OrderPaymentMethodEligibility extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.order.payment_method_eligibility',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.order.payment_method_eligibility';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class OrderProductEligibility extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.order.product_eligibility',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.order.product_eligibility';
|
||||
|
|
|
|||
|
|
@ -19,14 +19,40 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class OrderShippingMethodEligibility extends Constraint
|
||||
{
|
||||
public string $message = 'sylius.order.shipping_method_eligibility';
|
||||
|
||||
public string $methodNotAvailableMessage = 'sylius.order.shipping_method_not_available';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
public string $message = 'sylius.order.shipping_method_eligibility',
|
||||
public string $methodNotAvailableMessage = 'sylius.order.shipping_method_not_available',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?string $methodNotAvailableMessage = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$methodNotAvailableMessage ??= $options['methodNotAvailableMessage'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message ?? $this->message;
|
||||
$this->methodNotAvailableMessage = $methodNotAvailableMessage ?? $this->methodNotAvailableMessage;
|
||||
}
|
||||
|
||||
public function getMessage(): string
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ProductCodeExists extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.product.code.not_exist',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.product.code.not_exist';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ProductImageVariantsBelongToOwner extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.product_image.product_variant.not_belong_to_owner',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.product_image.product_variant.not_belong_to_owner';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ProductVariantCodeExists extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.product_variant.code.not_exist',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.product_variant.code.not_exist';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ProvinceCodeExists extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.province.code.not_exist',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.province.code.not_exist';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class RegisteredUser extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'This email is already registered. Please log in.',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'This email is already registered. Please log in.';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ResendOrderConfirmationEmailWithValidOrderState extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.resend_order_confirmation_email.invalid_order_state',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.resend_order_confirmation_email.invalid_order_state';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ResendShipmentConfirmationEmailWithValidShipmentState extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.resend_shipment_confirmation_email.invalid_shipment_state',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.resend_shipment_confirmation_email.invalid_shipment_state';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class TaxonCodeExists extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.taxon.code.not_exist',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.taxon.code.not_exist';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class TranslationForExistingLocales extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.translation.locale_code.invalid',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.translation.locale_code.invalid';
|
||||
|
|
|
|||
|
|
@ -23,14 +23,29 @@ class UniqueReviewerEmail extends Constraint
|
|||
public $message = 'sylius.review.author.already_exists';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message ?? $this->message;
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class ZoneCodeExists extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.zone.code.not_exist',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/core-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.zone.code.not_exist';
|
||||
|
|
|
|||
|
|
@ -23,14 +23,29 @@ class DifferentSourceTargetCurrency extends Constraint
|
|||
public $message = 'sylius.exchange_rate.different_source_target_currency';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/currency-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message ?? $this->message;
|
||||
|
|
|
|||
|
|
@ -23,14 +23,29 @@ class UniqueCurrencyPair extends Constraint
|
|||
public $message = 'sylius.exchange_rate.unique_currency_pair';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/currency-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message ?? $this->message;
|
||||
|
|
|
|||
|
|
@ -19,22 +19,41 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class InStock extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.cart_item.not_available',
|
||||
string $shortMessage = 'sylius.cart_item.insufficient_stock',
|
||||
string $stockablePath = 'stockable',
|
||||
string $quantityPath = 'quantity',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?string $shortMessage = null,
|
||||
?string $stockablePath = null,
|
||||
?string $quantityPath = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/inventory-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$shortMessage ??= $options['shortMessage'] ?? null;
|
||||
$stockablePath ??= $options['stockablePath'] ?? null;
|
||||
$quantityPath ??= $options['quantityPath'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->shortMessage = $shortMessage;
|
||||
$this->stockablePath = $stockablePath;
|
||||
$this->quantityPath = $quantityPath;
|
||||
$this->message = $message ?? $this->message;
|
||||
$this->shortMessage = $shortMessage ?? $this->shortMessage;
|
||||
$this->stockablePath = $stockablePath ?? $this->stockablePath;
|
||||
$this->quantityPath = $quantityPath ?? $this->quantityPath;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.cart_item.not_available';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class GatewayFactoryExists extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $invalidGatewayFactory = 'sylius.gateway_config.invalid_gateway_factory',
|
||||
?array $options = null,
|
||||
?string $invalidGatewayFactory = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/payment-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$invalidGatewayFactory ??= $options['invalidGatewayFactory'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->invalidGatewayFactory = $invalidGatewayFactory;
|
||||
$this->invalidGatewayFactory = $invalidGatewayFactory ?? $this->invalidGatewayFactory;
|
||||
}
|
||||
|
||||
public string $invalidGatewayFactory = 'sylius.gateway_config.invalid_gateway_factory';
|
||||
|
|
|
|||
|
|
@ -22,14 +22,29 @@ final class ProductVariantCombination extends Constraint
|
|||
public string $message = 'sylius.product_variant.combination';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/product-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message ?? $this->message;
|
||||
|
|
|
|||
|
|
@ -21,15 +21,32 @@ final class ProductVariantOptionValuesConfiguration extends Constraint
|
|||
{
|
||||
public string $message = 'sylius.product_variant.option_values.not_configured';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.product_variant.option_values.not_configured',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/product-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public function validatedBy(): string
|
||||
|
|
|
|||
|
|
@ -22,14 +22,29 @@ final class UniqueSimpleProductCode extends Constraint
|
|||
public string $message = 'sylius.simple_product.code.unique';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/product-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message ?? $this->message;
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class CatalogPromotionActionType extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $invalidType = 'sylius.catalog_promotion_action.type.invalid',
|
||||
?array $options = null,
|
||||
?string $invalidType = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/promotion-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$invalidType ??= $options['invalidType'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->invalidType = $invalidType;
|
||||
$this->invalidType = $invalidType ?? $this->invalidType;
|
||||
}
|
||||
|
||||
public string $invalidType = 'sylius.catalog_promotion_action.type.invalid';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class CatalogPromotionScopeType extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $invalidType = 'sylius.catalog_promotion_scope.type.invalid',
|
||||
?array $options = null,
|
||||
?string $invalidType = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/promotion-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$invalidType ??= $options['invalidType'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->invalidType = $invalidType;
|
||||
$this->invalidType = $invalidType ?? $this->invalidType;
|
||||
}
|
||||
|
||||
public string $invalidType = 'sylius.catalog_promotion_scope.type.invalid';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class CouponPossibleGenerationAmount extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.promotion_coupon_generator_instruction.possible_generation_amount',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/promotion-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.promotion_coupon_generator_instruction.possible_generation_amount';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class PromotionActionType extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $invalidType = 'sylius.promotion_action.invalid_type',
|
||||
?array $options = null,
|
||||
?string $invalidType = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/promotion-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$invalidType ??= $options['invalidType'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->invalidType = $invalidType;
|
||||
$this->invalidType = $invalidType ?? $this->invalidType;
|
||||
}
|
||||
|
||||
public string $invalidType = 'sylius.promotion_action.invalid_type';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class PromotionDateRange extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.promotion.end_date_cannot_be_set_prior_start_date',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/promotion-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.promotion.end_date_cannot_be_set_prior_start_date';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class PromotionNotCouponBased extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.promotion_coupon.promotion.not_coupon_based',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/promotion-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.promotion_coupon.promotion.not_coupon_based';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class PromotionRuleType extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $invalidType = 'sylius.promotion_rule.invalid_type',
|
||||
?array $options = null,
|
||||
?string $invalidType = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/promotion-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$invalidType ??= $options['invalidType'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->invalidType = $invalidType;
|
||||
$this->invalidType = $invalidType ?? $this->invalidType;
|
||||
}
|
||||
|
||||
public string $invalidType = 'sylius.promotion_rule.invalid_type';
|
||||
|
|
|
|||
|
|
@ -19,16 +19,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
#[\Attribute]
|
||||
final class PromotionSubjectCoupon extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.promotion_coupon.is_invalid',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/promotion-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.promotion_coupon.is_invalid';
|
||||
|
|
|
|||
|
|
@ -22,14 +22,29 @@ final class ShippingMethodCalculatorExists extends Constraint
|
|||
public string $invalidShippingCalculator = 'sylius.shipping_method.calculator.invalid';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $invalidShippingCalculator = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/shipping-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$invalidShippingCalculator ??= $options['invalidShippingCalculator'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->invalidShippingCalculator = $invalidShippingCalculator ?? $this->invalidShippingCalculator;
|
||||
|
|
|
|||
|
|
@ -22,14 +22,29 @@ final class ShippingMethodRule extends Constraint
|
|||
public string $invalidType = 'sylius.shipping_method.rule.invalid_type';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
* @param array<string>|null $groups
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
?array $options = null,
|
||||
?string $invalidType = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/shipping-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$invalidType ??= $options['invalidType'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->invalidType = $invalidType ?? $this->invalidType;
|
||||
|
|
|
|||
|
|
@ -21,15 +21,32 @@ final class ValidDeliveryTimeRange extends Constraint
|
|||
{
|
||||
public string $message = 'sylius.form.shipping_method.max_delivery_time_days.greater_or_equal_min';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.form.shipping_method.max_delivery_time_days.greater_or_equal_min',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/shipping-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public function validatedBy(): string
|
||||
|
|
|
|||
|
|
@ -18,16 +18,32 @@ use Symfony\Component\Validator\Constraint;
|
|||
|
||||
final class TaxonParentRelation extends Constraint
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array<string, mixed>|null $options
|
||||
*/
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.taxon.parent.invalid_relation',
|
||||
?array $options = null,
|
||||
?string $message = null,
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
if (\is_array($options)) {
|
||||
trigger_deprecation(
|
||||
'sylius/taxonomy-bundle',
|
||||
'2.3',
|
||||
'Passing an array of options to configure the "%s" constraint is deprecated and will be removed in Sylius 3.0, use named arguments instead.',
|
||||
static::class,
|
||||
);
|
||||
|
||||
$message ??= $options['message'] ?? null;
|
||||
$groups ??= $options['groups'] ?? null;
|
||||
$payload ??= $options['payload'] ?? null;
|
||||
}
|
||||
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
$this->message = $message ?? $this->message;
|
||||
}
|
||||
|
||||
public string $message = 'sylius.taxon.parent.invalid_relation';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue