Skip to content

Commit

Permalink
Fix ImageValidator attribute arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkounay committed Oct 12, 2023
1 parent af26e92 commit b397681
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Validator/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Arkounay\Bundle\UxMediaBundle\Validator;

use Symfony\Component\Validator\Attribute\HasNamedArguments;
use Symfony\Component\Validator\Constraint;

/**
Expand All @@ -10,7 +11,15 @@
#[\Attribute]
class Image extends Constraint
{
public $message = 'ux_media_validation.image';

public $supportedExtensions = ImageValidator::SUPPORTED_EXTENSIONS;
#[HasNamedArguments]
public function __construct(
public string $message = 'ux_media_validation.image',
public array $supportedExtensions = ImageValidator::SUPPORTED_EXTENSIONS,
array $groups = null,
mixed $payload = null,
) {
parent::__construct([], $groups, $payload);
}

}

0 comments on commit b397681

Please sign in to comment.