From 77f6efc601ab8512820679372a8a03a93e582027 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Wed, 18 Oct 2023 11:51:14 +0200 Subject: [PATCH] [FrameworkBundle][Routing] Remove remaining deprecations --- .github/expected-missing-return-types.diff | 10 -- UPGRADE-7.0.md | 10 +- .../Bundle/FrameworkBundle/CHANGELOG.md | 4 + .../Resources/config/routing.php | 9 - .../AttributeRouteControllerLoader.php | 8 +- src/Symfony/Component/Routing/CHANGELOG.md | 4 +- .../Loader/AnnotationDirectoryLoader.php | 25 --- .../Routing/Loader/AttributeClassLoader.php | 168 ++++-------------- .../Loader/AttributeDirectoryLoader.php | 10 +- .../Routing/Loader/AttributeFileLoader.php | 12 +- .../Loader/AttributeDirectoryLoaderTest.php | 11 -- .../Tests/Loader/AttributeFileLoaderTest.php | 11 -- 12 files changed, 58 insertions(+), 224 deletions(-) delete mode 100644 src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php diff --git a/.github/expected-missing-return-types.diff b/.github/expected-missing-return-types.diff index 9117c323c8057..b89ee42adb9a8 100644 --- a/.github/expected-missing-return-types.diff +++ b/.github/expected-missing-return-types.diff @@ -408,16 +408,6 @@ diff --git a/src/Symfony/Component/HttpKernel/KernelInterface.php b/src/Symfony/ - public function shutdown(); + public function shutdown(): void; - /** -diff --git a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php ---- a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php -+++ b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php -@@ -324,5 +324,5 @@ abstract class AnnotationClassLoader implements LoaderInterface - * @return void - */ -- abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot); -+ abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void; - /** diff --git a/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php b/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php --- a/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php diff --git a/UPGRADE-7.0.md b/UPGRADE-7.0.md index 31b033ec2ae7f..4078ede7e7137 100644 --- a/UPGRADE-7.0.md +++ b/UPGRADE-7.0.md @@ -248,7 +248,7 @@ FrameworkBundle * Change default of some config options: | option | default Symfony <7.0 | default in Symfony 7.0+ | - | -------------------------------------------- | -------------------------- | --------------------------------------------------------------------------- | + |----------------------------------------------|----------------------------|-----------------------------------------------------------------------------| | `framework.http_method_override` | `true` | `false` | | `framework.handle_all_throwables` | `false` | `true` | | `framework.php_errors.log` | `'%kernel.debug%'` | `true` | @@ -260,6 +260,10 @@ FrameworkBundle | `framework.validation.email_validation_mode` | `'loose'` | `'html5'` | * Remove the `framework.validation.enable_annotations` config option, use `framework.validation.enable_attributes` instead * Remove the `framework.serializer.enable_annotations` config option, use `framework.serializer.enable_attributes` instead + * Remove the `routing.loader.annotation` service, use the `routing.loader.attribute` service instead + * Remove the `routing.loader.annotation.directory` service, use the `routing.loader.attribute.directory` service instead + * Remove the `routing.loader.annotation.file` service, use the `routing.loader.attribute.file` service instead + * Remove `AnnotatedRouteControllerLoader`, use `AttributeRouteControllerLoader` instead HttpFoundation -------------- @@ -400,7 +404,9 @@ Routing * Add parameter `array $routeParameters` to `UrlMatcher::handleRouteRequirements()` * Remove Doctrine annotations support in favor of native attributes. Use `Symfony\Component\Routing\Annotation\Route` as native attribute now - * Change the constructor signature of `AnnotationClassLoader` to `__construct(?string $env = null)`, passing an annotation reader as first argument is not supported anymore + * Remove `AnnotationClassLoader`, use `AttributeClassLoader` instead + * Remove `AnnotationDirectoryLoader`, use `AttributeDirectoryLoader` instead + * Remove `AnnotationFileLoader`, use `AttributeFileLoader` instead Security -------- diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index c71b9e56e1474..997d79422c539 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -24,6 +24,10 @@ CHANGELOG * Make the `framework.validation.email_validation_mode` config option default to `html5` * Remove the `framework.validation.enable_annotations` config option, use `framework.validation.enable_attributes` instead * Remove the `framework.serializer.enable_annotations` config option, use `framework.serializer.enable_attributes` instead + * Remove the `routing.loader.annotation` service, use the `routing.loader.attribute` service instead + * Remove the `routing.loader.annotation.directory` service, use the `routing.loader.attribute.directory` service instead + * Remove the `routing.loader.annotation.file` service, use the `routing.loader.attribute.file` service instead + * Remove `AnnotatedRouteControllerLoader`, use `AttributeRouteControllerLoader` instead 6.4 --- diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.php index 5fc0cbb3e87fe..8cdbbf33a4fe1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.php @@ -98,9 +98,6 @@ ]) ->tag('routing.loader', ['priority' => -10]) - ->alias('routing.loader.annotation', 'routing.loader.attribute') - ->deprecate('symfony/routing', '6.4', 'The "%alias_id%" service is deprecated, use the "routing.loader.attribute" service instead.') - ->set('routing.loader.attribute.directory', AttributeDirectoryLoader::class) ->args([ service('file_locator'), @@ -108,9 +105,6 @@ ]) ->tag('routing.loader', ['priority' => -10]) - ->alias('routing.loader.annotation.directory', 'routing.loader.attribute.directory') - ->deprecate('symfony/routing', '6.4', 'The "%alias_id%" service is deprecated, use the "routing.loader.attribute.directory" service instead.') - ->set('routing.loader.attribute.file', AttributeFileLoader::class) ->args([ service('file_locator'), @@ -118,9 +112,6 @@ ]) ->tag('routing.loader', ['priority' => -10]) - ->alias('routing.loader.annotation.file', 'routing.loader.attribute.file') - ->deprecate('symfony/routing', '6.4', 'The "%alias_id%" service is deprecated, use the "routing.loader.attribute.file" service instead.') - ->set('routing.loader.psr4', Psr4DirectoryLoader::class) ->args([ service('file_locator'), diff --git a/src/Symfony/Bundle/FrameworkBundle/Routing/AttributeRouteControllerLoader.php b/src/Symfony/Bundle/FrameworkBundle/Routing/AttributeRouteControllerLoader.php index a629f4387891f..7e43e1af5d216 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Routing/AttributeRouteControllerLoader.php +++ b/src/Symfony/Bundle/FrameworkBundle/Routing/AttributeRouteControllerLoader.php @@ -25,10 +25,8 @@ class AttributeRouteControllerLoader extends AttributeClassLoader { /** * Configures the _controller default parameter of a given Route instance. - * - * @return void */ - protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot) + protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void { if ('__invoke' === $method->getName()) { $route->setDefault('_controller', $class->getName()); @@ -51,7 +49,3 @@ protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMetho return str_replace('__', '_', $name); } } - -if (!class_exists(AnnotatedRouteControllerLoader::class, false)) { - class_alias(AttributeRouteControllerLoader::class, AnnotatedRouteControllerLoader::class); -} diff --git a/src/Symfony/Component/Routing/CHANGELOG.md b/src/Symfony/Component/Routing/CHANGELOG.md index 24e9d1cbb2420..41635efc2e0da 100644 --- a/src/Symfony/Component/Routing/CHANGELOG.md +++ b/src/Symfony/Component/Routing/CHANGELOG.md @@ -6,7 +6,9 @@ CHANGELOG * Add argument `$routeParameters` to `UrlMatcher::handleRouteRequirements()` * Remove Doctrine annotations support in favor of native attributes - * Change the constructor signature of `AnnotationClassLoader` to `__construct(?string $env = null)`, passing an annotation reader as first argument is not supported anymore + * Remove `AnnotationClassLoader`, use `AttributeClassLoader` instead + * Remove `AnnotationDirectoryLoader`, use `AttributeDirectoryLoader` instead + * Remove `AnnotationFileLoader`, use `AttributeFileLoader` instead 6.4 --- diff --git a/src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php b/src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php deleted file mode 100644 index 80cec1f5ddf7e..0000000000000 --- a/src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Routing\Loader; - -trigger_deprecation('symfony/routing', '6.4', 'The "%s" class is deprecated, use "%s" instead.', AnnotationDirectoryLoader::class, AttributeDirectoryLoader::class); - -class_exists(AttributeDirectoryLoader::class); - -if (false) { - /** - * @deprecated since Symfony 6.4, to be removed in 7.0, use {@link AttributeDirectoryLoader} instead - */ - class AnnotationDirectoryLoader - { - } -} diff --git a/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php b/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php index 07724f1541647..a1fdca7116694 100644 --- a/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php +++ b/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Routing\Loader; -use Doctrine\Common\Annotations\Reader; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Loader\LoaderResolverInterface; use Symfony\Component\Config\Resource\FileResource; @@ -53,57 +52,18 @@ */ abstract class AttributeClassLoader implements LoaderInterface { - /** - * @var Reader|null - * - * @deprecated in Symfony 6.4, this property will be removed in Symfony 7. - */ - protected $reader; - - /** - * @var string|null - */ - protected $env; - - /** - * @var string - */ - protected $routeAnnotationClass = RouteAnnotation::class; + protected string $routeAnnotationClass = RouteAnnotation::class; + protected int $defaultRouteIndex = 0; - /** - * @var int - */ - protected $defaultRouteIndex = 0; - - private bool $hasDeprecatedAnnotations = false; - - /** - * @param string|null $env - */ - public function __construct($env = null) - { - if ($env instanceof Reader || null === $env && \func_num_args() > 1 && null !== func_get_arg(1)) { - trigger_deprecation('symfony/routing', '6.4', 'Passing an instance of "%s" as first and the environment as second argument to "%s" is deprecated. Pass the environment as first argument instead.', Reader::class, __METHOD__); - - $this->reader = $env; - $env = \func_num_args() > 1 ? func_get_arg(1) : null; - } - - if (\is_string($env) || null === $env) { - $this->env = $env; - } elseif ($env instanceof \Stringable || \is_scalar($env)) { - $this->env = (string) $env; - } else { - throw new \TypeError(__METHOD__.sprintf(': Parameter $env was expected to be a string or null, "%s" given.', get_debug_type($env))); - } + public function __construct( + protected readonly ?string $env = null, + ) { } /** * Sets the annotation class to read route properties from. - * - * @return void */ - public function setRouteAnnotationClass(string $class) + public function setRouteAnnotationClass(string $class): void { $this->routeAnnotationClass = $class; } @@ -124,48 +84,38 @@ public function load(mixed $class, string $type = null): RouteCollection throw new \InvalidArgumentException(sprintf('Annotations from class "%s" cannot be read as it is abstract.', $class->getName())); } - $this->hasDeprecatedAnnotations = false; - - try { - $globals = $this->getGlobals($class); - $collection = new RouteCollection(); - $collection->addResource(new FileResource($class->getFileName())); - if ($globals['env'] && $this->env !== $globals['env']) { - return $collection; - } - $fqcnAlias = false; - foreach ($class->getMethods() as $method) { - $this->defaultRouteIndex = 0; - $routeNamesBefore = array_keys($collection->all()); - foreach ($this->getAnnotations($method) as $annot) { - $this->addRoute($collection, $annot, $globals, $class, $method); - if ('__invoke' === $method->name) { - $fqcnAlias = true; - } - } - - if (1 === $collection->count() - \count($routeNamesBefore)) { - $newRouteName = current(array_diff(array_keys($collection->all()), $routeNamesBefore)); - $collection->addAlias(sprintf('%s::%s', $class->name, $method->name), $newRouteName); - } - } - if (0 === $collection->count() && $class->hasMethod('__invoke')) { - $globals = $this->resetGlobals(); - foreach ($this->getAnnotations($class) as $annot) { - $this->addRoute($collection, $annot, $globals, $class, $class->getMethod('__invoke')); + $globals = $this->getGlobals($class); + $collection = new RouteCollection(); + $collection->addResource(new FileResource($class->getFileName())); + if ($globals['env'] && $this->env !== $globals['env']) { + return $collection; + } + $fqcnAlias = false; + foreach ($class->getMethods() as $method) { + $this->defaultRouteIndex = 0; + $routeNamesBefore = array_keys($collection->all()); + foreach ($this->getAnnotations($method) as $annot) { + $this->addRoute($collection, $annot, $globals, $class, $method); + if ('__invoke' === $method->name) { $fqcnAlias = true; } } - if ($fqcnAlias && 1 === $collection->count()) { - $collection->addAlias($class->name, $invokeRouteName = key($collection->all())); - $collection->addAlias(sprintf('%s::__invoke', $class->name), $invokeRouteName); - } - if ($this->hasDeprecatedAnnotations) { - trigger_deprecation('symfony/routing', '6.4', 'Class "%s" uses Doctrine Annotations to configure routes, which is deprecated. Use PHP attributes instead.', $class->getName()); + if (1 === $collection->count() - \count($routeNamesBefore)) { + $newRouteName = current(array_diff(array_keys($collection->all()), $routeNamesBefore)); + $collection->addAlias(sprintf('%s::%s', $class->name, $method->name), $newRouteName); } - } finally { - $this->hasDeprecatedAnnotations = false; + } + if (0 === $collection->count() && $class->hasMethod('__invoke')) { + $globals = $this->resetGlobals(); + foreach ($this->getAnnotations($class) as $annot) { + $this->addRoute($collection, $annot, $globals, $class, $class->getMethod('__invoke')); + $fqcnAlias = true; + } + } + if ($fqcnAlias && 1 === $collection->count()) { + $collection->addAlias($class->name, $invokeRouteName = key($collection->all())); + $collection->addAlias(sprintf('%s::__invoke', $class->name), $invokeRouteName); } return $collection; @@ -173,10 +123,8 @@ public function load(mixed $class, string $type = null): RouteCollection /** * @param RouteAnnotation $annot or an object that exposes a similar interface - * - * @return void */ - protected function addRoute(RouteCollection $collection, object $annot, array $globals, \ReflectionClass $class, \ReflectionMethod $method) + protected function addRoute(RouteCollection $collection, object $annot, array $globals, \ReflectionClass $class, \ReflectionMethod $method): void { if ($annot->getEnv() && $annot->getEnv() !== $this->env) { return; @@ -263,11 +211,7 @@ protected function addRoute(RouteCollection $collection, object $annot, array $g public function supports(mixed $resource, string $type = null): bool { - if ('annotation' === $type) { - trigger_deprecation('symfony/routing', '6.4', 'The "annotation" route type is deprecated, use the "attribute" route type instead.'); - } - - return \is_string($resource) && preg_match('/^(?:\\\\?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)+$/', $resource) && (!$type || \in_array($type, ['annotation', 'attribute'], true)); + return \is_string($resource) && preg_match('/^(?:\\\\?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)+$/', $resource) && (!$type || 'attribute' === $type); } public function setResolver(LoaderResolverInterface $resolver): void @@ -280,10 +224,8 @@ public function getResolver(): LoaderResolverInterface /** * Gets the default route name for a class method. - * - * @return string */ - protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) + protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method): string { $name = str_replace('\\', '_', $class->name).'_'.$method->name; $name = \function_exists('mb_strtolower') && preg_match('//u', $name) ? mb_strtolower($name, 'UTF-8') : strtolower($name); @@ -298,19 +240,13 @@ protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMetho /** * @return array */ - protected function getGlobals(\ReflectionClass $class) + protected function getGlobals(\ReflectionClass $class): array { $globals = $this->resetGlobals(); - $annot = null; if ($attribute = $class->getAttributes($this->routeAnnotationClass, \ReflectionAttribute::IS_INSTANCEOF)[0] ?? null) { $annot = $attribute->newInstance(); - } - if (!$annot && $annot = $this->reader?->getClassAnnotation($class, $this->routeAnnotationClass)) { - $this->hasDeprecatedAnnotations = true; - } - if ($annot) { if (null !== $annot->getName()) { $globals['name'] = $annot->getName(); } @@ -380,18 +316,12 @@ private function resetGlobals(): array ]; } - /** - * @return Route - */ - protected function createRoute(string $path, array $defaults, array $requirements, array $options, ?string $host, array $schemes, array $methods, ?string $condition) + protected function createRoute(string $path, array $defaults, array $requirements, array $options, ?string $host, array $schemes, array $methods, ?string $condition): Route { return new Route($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition); } - /** - * @return void - */ - abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot); + abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void; /** * @return iterable @@ -401,25 +331,5 @@ private function getAnnotations(\ReflectionClass|\ReflectionMethod $reflection): foreach ($reflection->getAttributes($this->routeAnnotationClass, \ReflectionAttribute::IS_INSTANCEOF) as $attribute) { yield $attribute->newInstance(); } - - if (!$this->reader) { - return; - } - - $annotations = $reflection instanceof \ReflectionClass - ? $this->reader->getClassAnnotations($reflection) - : $this->reader->getMethodAnnotations($reflection); - - foreach ($annotations as $annotation) { - if ($annotation instanceof $this->routeAnnotationClass) { - $this->hasDeprecatedAnnotations = true; - - yield $annotation; - } - } } } - -if (!class_exists(AnnotationClassLoader::class, false)) { - class_alias(AttributeClassLoader::class, AnnotationClassLoader::class); -} diff --git a/src/Symfony/Component/Routing/Loader/AttributeDirectoryLoader.php b/src/Symfony/Component/Routing/Loader/AttributeDirectoryLoader.php index e856bade27819..3254127f23e70 100644 --- a/src/Symfony/Component/Routing/Loader/AttributeDirectoryLoader.php +++ b/src/Symfony/Component/Routing/Loader/AttributeDirectoryLoader.php @@ -67,11 +67,7 @@ public function supports(mixed $resource, string $type = null): bool return false; } - if (\in_array($type, ['annotation', 'attribute'], true)) { - if ('annotation' === $type) { - trigger_deprecation('symfony/routing', '6.4', 'The "annotation" route type is deprecated, use the "attribute" route type instead.'); - } - + if ('attribute' === $type) { return true; } @@ -86,7 +82,3 @@ public function supports(mixed $resource, string $type = null): bool } } } - -if (!class_exists(AnnotationDirectoryLoader::class, false)) { - class_alias(AttributeDirectoryLoader::class, AnnotationDirectoryLoader::class); -} diff --git a/src/Symfony/Component/Routing/Loader/AttributeFileLoader.php b/src/Symfony/Component/Routing/Loader/AttributeFileLoader.php index 52d1494205239..ec6d876b8ec22 100644 --- a/src/Symfony/Component/Routing/Loader/AttributeFileLoader.php +++ b/src/Symfony/Component/Routing/Loader/AttributeFileLoader.php @@ -25,7 +25,7 @@ */ class AttributeFileLoader extends FileLoader { - protected $loader; + protected AttributeClassLoader $loader; public function __construct(FileLocatorInterface $locator, AttributeClassLoader $loader) { @@ -65,11 +65,7 @@ public function load(mixed $file, string $type = null): ?RouteCollection public function supports(mixed $resource, string $type = null): bool { - if ('annotation' === $type) { - trigger_deprecation('symfony/routing', '6.4', 'The "annotation" route type is deprecated, use the "attribute" route type instead.'); - } - - return \is_string($resource) && 'php' === pathinfo($resource, \PATHINFO_EXTENSION) && (!$type || \in_array($type, ['annotation', 'attribute'], true)); + return \is_string($resource) && 'php' === pathinfo($resource, \PATHINFO_EXTENSION) && (!$type || 'attribute' === $type); } /** @@ -139,7 +135,3 @@ protected function findClass(string $file): string|false return false; } } - -if (!class_exists(AnnotationFileLoader::class, false)) { - class_alias(AttributeFileLoader::class, AnnotationFileLoader::class); -} diff --git a/src/Symfony/Component/Routing/Tests/Loader/AttributeDirectoryLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/AttributeDirectoryLoaderTest.php index 22a00a2693b0c..c0db978929b9c 100644 --- a/src/Symfony/Component/Routing/Tests/Loader/AttributeDirectoryLoaderTest.php +++ b/src/Symfony/Component/Routing/Tests/Loader/AttributeDirectoryLoaderTest.php @@ -59,17 +59,6 @@ public function testSupports() $this->assertFalse($this->loader->supports($fixturesDir, 'foo'), '->supports() checks the resource type if specified'); } - /** - * @group legacy - */ - public function testSupportsAnnotations() - { - $fixturesDir = __DIR__.'/../Fixtures'; - - $this->expectDeprecation('Since symfony/routing 6.4: The "annotation" route type is deprecated, use the "attribute" route type instead.'); - $this->assertTrue($this->loader->supports($fixturesDir, 'annotation'), '->supports() checks the resource type if specified'); - } - public function testItSupportsAnyAttribute() { $this->assertTrue($this->loader->supports(__DIR__.'/../Fixtures/even-with-not-existing-folder', 'attribute')); diff --git a/src/Symfony/Component/Routing/Tests/Loader/AttributeFileLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/AttributeFileLoaderTest.php index bfbc7e102b9f8..b60a9c79921d5 100644 --- a/src/Symfony/Component/Routing/Tests/Loader/AttributeFileLoaderTest.php +++ b/src/Symfony/Component/Routing/Tests/Loader/AttributeFileLoaderTest.php @@ -84,17 +84,6 @@ public function testSupports() $this->assertFalse($this->loader->supports($fixture, 'foo'), '->supports() checks the resource type if specified'); } - /** - * @group legacy - */ - public function testSupportsAnnotations() - { - $fixture = __DIR__.'/../Fixtures/annotated.php'; - - $this->expectDeprecation('Since symfony/routing 6.4: The "annotation" route type is deprecated, use the "attribute" route type instead.'); - $this->assertTrue($this->loader->supports($fixture, 'annotation'), '->supports() checks the resource type if specified'); - } - public function testLoadAttributesClassAfterComma() { self::assertCount(0, $this->loader->load(__DIR__.'/../Fixtures/AttributesFixtures/AttributesClassParamAfterCommaController.php'));