Skip to content

Commit

Permalink
bug #218 [Validator] Fix 1.x enum constraint with named arguments (og…
Browse files Browse the repository at this point in the history
…izanagi)

This PR was merged into the 1.x-dev branch.

Discussion
----------

[Validator] Fix 1.x enum constraint with named arguments

Fixes #217

Poke `@benji07` , could you give it a try? 🙏🏻

Commits
-------

a322a07 [Validator] Fix 1.x enum constraint with named arguments
  • Loading branch information
ogizanagi committed Mar 13, 2023
2 parents aa551c9 + a322a07 commit 400030f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Bridge/Symfony/Validator/Constraint/Enum.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function __construct(
) {
parent::__construct(
$class, // "class" is the default option here and supersedes "choices" from parent class.
null,
$callback,
$multiple,
$strict,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function provide testNoChoicesSetsUserCallback data(): iterable
use Elao\Enum\Bridge\Symfony\Validator\Constraint\Enum;
use Elao\Enum\Tests\Fixtures\Enum\SimpleEnum;
return new Enum(class: SimpleEnum::class, callback: 'allowedValues');
return new Enum(class: SimpleEnum::class, callback: 'allowedValues', message: 'foo');
PHP), !self::isSf52()];
}
}
Expand Down

0 comments on commit 400030f

Please sign in to comment.