|
14 | 14 | use Symfony\Component\Config\Loader\LoaderInterface;
|
15 | 15 | use Symfony\Component\Config\Loader\LoaderResolverInterface;
|
16 | 16 | use Symfony\Component\Config\Resource\FileResource;
|
| 17 | +use Symfony\Component\Routing\Attribute\DeprecatedAlias; |
17 | 18 | use Symfony\Component\Routing\Attribute\Route as RouteAttribute;
|
18 | 19 | use Symfony\Component\Routing\Exception\InvalidArgumentException;
|
19 | 20 | use Symfony\Component\Routing\Exception\LogicException;
|
@@ -241,17 +242,17 @@ protected function addRoute(RouteCollection $collection, object $attr, array $gl
|
241 | 242 | $collection->add($name, $route, $priority);
|
242 | 243 | }
|
243 | 244 | foreach ($attr->getAliases() as $aliasAttribute) {
|
244 |
| - if (\is_string($aliasAttribute)) { |
245 |
| - $collection->addAlias($aliasAttribute, $name); |
| 245 | + if ($aliasAttribute instanceof DeprecatedAlias) { |
| 246 | + $alias = $collection->addAlias($aliasAttribute->getAliasName(), $name); |
| 247 | + $alias->setDeprecated( |
| 248 | + $aliasAttribute->getPackage(), |
| 249 | + $aliasAttribute->getVersion(), |
| 250 | + $aliasAttribute->getMessage() |
| 251 | + ); |
246 | 252 | continue;
|
247 | 253 | }
|
248 | 254 |
|
249 |
| - $alias = $collection->addAlias($aliasAttribute->getAliasName(), $name); |
250 |
| - $alias->setDeprecated( |
251 |
| - $aliasAttribute->getPackage(), |
252 |
| - $aliasAttribute->getVersion(), |
253 |
| - $aliasAttribute->getMessage() |
254 |
| - ); |
| 255 | + $collection->addAlias($aliasAttribute, $name); |
255 | 256 | }
|
256 | 257 | }
|
257 | 258 | }
|
|
0 commit comments