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
@@ -128,7 +136,7 @@ public function __construct($options = null)
128
136
if ($options && \is_array($options) && \is_string(key($options))) {
129
137
foreach ($optionsas$option => $value) {
130
138
if (\array_key_exists($option, $knownOptions)) {
131
-
$this->$option = $value;
139
+
$normalizedOptions[$option] = $value;
132
140
unset($missingOptions[$option]);
133
141
} else {
134
142
$invalidOptions[] = $option;
@@ -140,7 +148,7 @@ public function __construct($options = null)
140
148
}
141
149
142
150
if (\array_key_exists($defaultOption, $knownOptions)) {
143
-
$this->$defaultOption = $options;
151
+
$normalizedOptions[$defaultOption] = $options;
144
152
unset($missingOptions[$defaultOption]);
145
153
} else {
146
154
$invalidOptions[] = $defaultOption;
@@ -154,6 +162,8 @@ public function __construct($options = null)
154
162
if (\count($missingOptions) > 0) {
155
163
thrownewMissingOptionsException(sprintf('The options "%s" must be set for constraint "%s".', implode('", "', array_keys($missingOptions)), static::class), array_keys($missingOptions));
if (isset($options[$this->getCompositeOption()])) {
30
+
thrownewConstraintDefinitionException(sprintf('You can\'t redefine the "%s" option. Use the %s::getConstraints() method instead.', $this->getCompositeOption(), __CLASS__));
$this->expectExceptionMessage('You can\'t redefine the "constraints" option. Use the Symfony\Component\Validator\Constraints\Compound::getConstraints() method instead.');
0 commit comments