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 ('' !== $route->getCondition() && $route->getCondition() !== $condition) {
265
+
trigger_deprecation('symfony/routing', '7.3', 'Overriding a route\'s condition with its group\'s is deprecated, you should remove it from the route.');
266
+
}
267
+
259
268
$route->setCondition($condition);
260
269
}
261
270
}
@@ -267,10 +276,18 @@ public function setCondition(?string $condition): void
267
276
*/
268
277
publicfunctionaddDefaults(array$defaults): void
269
278
{
270
-
if ($defaults) {
271
-
foreach ($this->routesas$route) {
272
-
$route->addDefaults($defaults);
279
+
if (!$defaults) {
280
+
return;
281
+
}
282
+
283
+
foreach ($this->routesas$route) {
284
+
foreach ($defaultsas$name => $value) {
285
+
if ($route->hasDefault($name) && $route->getDefault($name) !== $value) {
286
+
trigger_deprecation('symfony/routing', '7.3', 'Overriding a route\'s default with its group\'s is deprecated, you should remove it from the route.');
287
+
}
273
288
}
289
+
290
+
$route->addDefaults($defaults);
274
291
}
275
292
}
276
293
@@ -281,10 +298,18 @@ public function addDefaults(array $defaults): void
if ($route->hasRequirement($key) && $route->getRequirement($key) !== $regex) {
308
+
trigger_deprecation('symfony/routing', '7.3', 'Overriding a route\'s requirement with its group\'s is deprecated, you should remove it from the route.');
309
+
}
287
310
}
311
+
312
+
$route->addRequirements($requirements);
288
313
}
289
314
}
290
315
@@ -295,10 +320,18 @@ public function addRequirements(array $requirements): void
295
320
*/
296
321
publicfunctionaddOptions(array$options): void
297
322
{
298
-
if ($options) {
299
-
foreach ($this->routesas$route) {
300
-
$route->addOptions($options);
323
+
if (!$options) {
324
+
return;
325
+
}
326
+
327
+
foreach ($this->routesas$route) {
328
+
foreach ($optionsas$name => $value) {
329
+
if ($route->hasOption($name) && $route->getOption($name) !== $value) {
330
+
trigger_deprecation('symfony/routing', '7.3', 'Overriding a route\'s option with its group\'s is deprecated, you should remove it from the route.');
331
+
}
301
332
}
333
+
334
+
$route->addOptions($options);
302
335
}
303
336
}
304
337
@@ -310,6 +343,10 @@ public function addOptions(array $options): void
$this->expectUserDeprecationMessage('Since symfony/routing 7.3: Overriding a route\'s default with its group\'s is deprecated, you should remove it from the route.');
$this->expectUserDeprecationMessage('Since symfony/routing 7.3: Overriding a route\'s requirement with its group\'s is deprecated, you should remove it from the route.');
$this->expectUserDeprecationMessage('Since symfony/routing 7.3: Overriding a route\'s option with its group\'s is deprecated, you should remove it from the route.');
$this->expectUserDeprecationMessage('Since symfony/routing 7.3: Overriding a route\'s host with its group\'s is deprecated, you should remove it from the route.');
$this->expectUserDeprecationMessage('Since symfony/routing 7.3: Overriding a route\'s condition with its group\'s is deprecated, you should remove it from the route.');
$this->expectUserDeprecationMessage('Since symfony/routing 7.3: Overriding a route\'s schemes with its group\'s is deprecated, you should remove it from the route.');
$this->expectUserDeprecationMessage('Since symfony/routing 7.3: Overriding a route\'s methods with its group\'s is deprecated, you should remove it from the route.');
0 commit comments