mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
Fix validation constraints
This commit is contained in:
parent
5f61db6245
commit
f3ce0775dc
3 changed files with 24 additions and 3 deletions
|
|
@ -62,12 +62,11 @@ final class ChannelCodeCollection extends Constraint
|
|||
}
|
||||
|
||||
/**
|
||||
* @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,
|
||||
|
|
@ -79,7 +78,7 @@ final class ChannelCodeCollection extends Constraint
|
|||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
parent::__construct($options, $groups, $payload);
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->constraints = $constraints ?? $this->constraints;
|
||||
$this->allowExtraFields = $allowExtraFields ?? $this->allowExtraFields;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,17 @@ final class ProductVariantOptionValuesConfiguration extends Constraint
|
|||
parent::__construct(groups: $groups, payload: $payload);
|
||||
}
|
||||
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.product_variant.option_values.not_configured',
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return 'sylius.validator.product_variant_option_values_configuration';
|
||||
|
|
|
|||
|
|
@ -45,6 +45,17 @@ final class ValidDeliveryTimeRange extends Constraint
|
|||
parent::__construct(groups: $groups, payload: $payload);
|
||||
}
|
||||
|
||||
#[HasNamedArguments]
|
||||
public function __construct(
|
||||
string $message = 'sylius.form.shipping_method.max_delivery_time_days.greater_or_equal_min',
|
||||
?array $groups = null,
|
||||
mixed $payload = null,
|
||||
) {
|
||||
parent::__construct(groups: $groups, payload: $payload);
|
||||
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return 'sylius_shipping_method_valid_delivery_time_range';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue