[SF8] Use named arguments for Validator constraint constructor

This commit is contained in:
TheMilek 2026-02-18 13:22:56 +01:00 committed by Grzegorz Sadowski
parent 0fe16b8ffb
commit 4599a797e5
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364

View file

@ -61,6 +61,33 @@ final class ChannelCodeCollection extends Constraint
parent::__construct(groups: $groups, payload: $payload);
}
/**
* @param array<Constraint> $constraints
*/
public function __construct(
array $constraints = [],
bool $allowExtraFields = false,
bool $allowMissingFields = false,
?string $channelAwarePropertyPath = null,
?string $extraFieldsMessage = null,
?string $missingFieldsMessage = null,
string $invalidChannelMessage = 'sylius.channel_code_collection.invalid_channel',
bool $validateAgainstAllChannels = false,
?array $groups = null,
mixed $payload = null,
) {
parent::__construct(groups: $groups, payload: $payload);
$this->constraints = $constraints;
$this->allowExtraFields = $allowExtraFields;
$this->allowMissingFields = $allowMissingFields;
$this->channelAwarePropertyPath = $channelAwarePropertyPath;
$this->extraFieldsMessage = $extraFieldsMessage;
$this->missingFieldsMessage = $missingFieldsMessage;
$this->invalidChannelMessage = $invalidChannelMessage;
$this->validateAgainstAllChannels = $validateAgainstAllChannels;
}
public function validatedBy(): string
{
return 'sylius_channel_code_collection';