You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (null === $options && (\func_num_args() > 0 || (new \ReflectionMethod($this, 'getRequiredOptions'))->getDeclaringClass()->getName() === self::class)) {
114
+
if (null !== $groups) {
115
+
$this->groups = $groups;
116
+
}
117
+
$this->payload = $payload;
118
+
119
+
return;
120
+
}
121
+
122
+
trigger_deprecation('symfony/validator', '7.4', 'Support for evaluating options in the base Constraint class is deprecated. Initialize properties in the constructor of %s instead.', static::class);
123
+
113
124
$options = $this->normalizeOptions($options);
114
125
if (null !== $groups) {
115
126
$options['groups'] = $groups;
@@ -122,6 +133,8 @@ public function __construct(mixed $options = null, ?array $groups = null, mixed
Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/AbstractComparison.php
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -39,16 +39,15 @@ public function __construct(mixed $value = null, ?string $propertyPath = null, ?
39
39
} elseif (null !== $value) {
40
40
if (\is_array($options)) {
41
41
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
if (\is_array($constraints) && !array_is_list($constraints)) {
36
-
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
if (\is_array($constraints) && !array_is_list($constraints)) {
45
47
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Blank.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ public function __construct(?array $options = null, ?string $message = null, ?ar
41
41
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Callback.php
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -44,20 +44,21 @@ public function __construct(array|string|callable|null $callback = null, ?array
44
44
if (!\is_array($callback) || (!isset($callback['callback']) && !isset($callback['groups']) && !isset($callback['payload']))) {
45
45
if (\is_array($options)) {
46
46
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
47
-
} else {
48
-
$options = [];
49
47
}
50
-
51
-
$options['callback'] = $callback;
52
48
} else {
53
49
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/CardScheme.php
+9-4Lines changed: 9 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -62,23 +62,28 @@ public function __construct(array|string|null $schemes, ?string $message = null,
62
62
} else {
63
63
if (\is_array($options)) {
64
64
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
if (\is_array($exclude) && !array_is_list($exclude)) {
36
-
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
43
43
}
44
44
45
-
$this->exclude = array_flip((array) $exclude);
45
+
$exclude = array_flip((array) $exclude);
46
+
$this->exclude = $exclude;
46
47
}
47
48
48
49
if (\is_array($options) && \array_key_exists('groups', $options)) {
49
50
thrownewConstraintDefinitionException(\sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__));
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
0 commit comments