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
* 4.2: (45 commits)
[Form] various minor fixes
Ensure the parent process is always killed
bugfix: the terminal state was wrong and not reseted
[Console] Fix inconsistent result for choice questions in non-interactive mode
Define null return type for Constraint::getDefaultOption()
[Routing] Fix: annotation loader ignores method's default values
[HttpKernel] Fix DebugHandlersListener constructor docblock
Skip Glob brace test when GLOB_BRACE is unavailable
bumped Symfony version to 4.2.6
updated VERSION for 4.2.5
updated CHANGELOG for 4.2.5
bumped Symfony version to 3.4.25
updated VERSION for 3.4.24
update CONTRIBUTORS for 3.4.24
updated CHANGELOG for 3.4.24
[EventDispatcher] cleanup
fix testIgnoredAttributesInContext
Re-generate icu 64.1 data
Improve PHPdoc / IDE autocomplete for config tree builder
[Bridge][Twig] DebugCommand - fix escaping and filter
...
thrownewConstraintDefinitionException(sprintf('No default option is configured for constraint %s', \get_class($this)));
138
+
if (null === $defaultOption) {
139
+
thrownewConstraintDefinitionException(sprintf('No default option is configured for constraint "%s".', \get_class($this)));
137
140
}
138
141
139
-
if (\array_key_exists($option, $knownOptions)) {
140
-
$this->$option = $options;
141
-
unset($missingOptions[$option]);
142
+
if (\array_key_exists($defaultOption, $knownOptions)) {
143
+
$this->$defaultOption = $options;
144
+
unset($missingOptions[$defaultOption]);
142
145
} else {
143
-
$invalidOptions[] = $option;
146
+
$invalidOptions[] = $defaultOption;
144
147
}
145
148
}
146
149
147
150
if (\count($invalidOptions) > 0) {
148
-
thrownewInvalidOptionsException(sprintf('The options "%s" do not exist in constraint %s', implode('", "', $invalidOptions), \get_class($this)), $invalidOptions);
151
+
thrownewInvalidOptionsException(sprintf('The options "%s" do not exist in constraint "%s".', implode('", "', $invalidOptions), \get_class($this)), $invalidOptions);
149
152
}
150
153
151
154
if (\count($missingOptions) > 0) {
152
-
thrownewMissingOptionsException(sprintf('The options "%s" must be set for constraint %s', implode('", "', array_keys($missingOptions)), \get_class($this)), array_keys($missingOptions));
155
+
thrownewMissingOptionsException(sprintf('The options "%s" must be set for constraint "%s".', implode('", "', array_keys($missingOptions)), \get_class($this)), array_keys($missingOptions));
153
156
}
154
157
}
155
158
@@ -173,7 +176,7 @@ public function __set($option, $value)
173
176
return;
174
177
}
175
178
176
-
thrownewInvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s', $option, \get_class($this)), [$option]);
179
+
thrownewInvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, \get_class($this)), [$option]);
177
180
}
178
181
179
182
/**
@@ -199,7 +202,7 @@ public function __get($option)
199
202
return$this->groups;
200
203
}
201
204
202
-
thrownewInvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s', $option, \get_class($this)), [$option]);
205
+
thrownewInvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, \get_class($this)), [$option]);
203
206
}
204
207
205
208
/**
@@ -229,12 +232,13 @@ public function addImplicitGroupName($group)
229
232
*
230
233
* Override this method to define a default option.
231
234
*
232
-
* @return string
235
+
* @return string|null
233
236
*
234
237
* @see __construct()
235
238
*/
236
239
publicfunctiongetDefaultOption()
237
240
{
241
+
returnnull;
238
242
}
239
243
240
244
/**
@@ -256,7 +260,7 @@ public function getRequiredOptions()
256
260
*
257
261
* By default, this is the fully qualified name of the constraint class
258
262
* suffixed with "Validator". You can override this method to change that
0 commit comments