Skip to content

Commit 400030f

Browse files
committedMar 13, 2023
bug #218 [Validator] Fix 1.x enum constraint with named arguments (ogizanagi)
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
2 parents aa551c9 + a322a07 commit 400030f

File tree

2 files changed

+2
-1
lines changed
  • src/Bridge/Symfony/Validator/Constraint
  • tests/Unit/Bridge/Symfony/Validator/Constraint

2 files changed

+2
-1
lines changed
 

‎src/Bridge/Symfony/Validator/Constraint/Enum.php

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function __construct(
5050
) {
5151
parent::__construct(
5252
$class, // "class" is the default option here and supersedes "choices" from parent class.
53+
null,
5354
$callback,
5455
$multiple,
5556
$strict,

‎tests/Unit/Bridge/Symfony/Validator/Constraint/EnumTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function provide testNoChoicesSetsUserCallback data(): iterable
102102
use Elao\Enum\Bridge\Symfony\Validator\Constraint\Enum;
103103
use Elao\Enum\Tests\Fixtures\Enum\SimpleEnum;
104104
105-
return new Enum(class: SimpleEnum::class, callback: 'allowedValues');
105+
return new Enum(class: SimpleEnum::class, callback: 'allowedValues', message: 'foo');
106106
PHP), !self::isSf52()];
107107
}
108108
}

0 commit comments

Comments
 (0)
Please sign in to comment.