Skip to content

Commit 572421c

Browse files
[7.0] Cleanup legacy code paths
1 parent 03e731a commit 572421c

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

Loader/AttributeClassLoader.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,10 @@ public function getResolver(): LoaderResolverInterface
222222

223223
/**
224224
* Gets the default route name for a class method.
225+
*
226+
* @return string
225227
*/
226-
protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method): string
228+
protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method)
227229
{
228230
$name = str_replace('\\', '_', $class->name).'_'.$method->name;
229231
$name = \function_exists('mb_strtolower') && preg_match('//u', $name) ? mb_strtolower($name, 'UTF-8') : strtolower($name);
@@ -319,7 +321,10 @@ protected function createRoute(string $path, array $defaults, array $requirement
319321
return new Route($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
320322
}
321323

322-
abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void;
324+
/**
325+
* @return void
326+
*/
327+
abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot);
323328

324329
/**
325330
* @return iterable<int, RouteAnnotation>

Loader/Psr4DirectoryLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function load(mixed $resource, string $type = null): ?RouteCollection
4848

4949
public function supports(mixed $resource, string $type = null): bool
5050
{
51-
return ('attribute' === $type || 'annotation' === $type) && \is_array($resource) && isset($resource['path'], $resource['namespace']);
51+
return 'attribute' === $type && \is_array($resource) && isset($resource['path'], $resource['namespace']);
5252
}
5353

5454
public function forDirectory(string $currentDirectory): static

Tests/Loader/AttributeDirectoryLoaderTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Routing\Tests\Loader;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1615
use Symfony\Component\Config\FileLocator;
1716
use Symfony\Component\Routing\Loader\AttributeDirectoryLoader;
1817
use Symfony\Component\Routing\Tests\Fixtures\AttributedClasses\BarClass;
@@ -23,8 +22,6 @@
2322

2423
class AttributeDirectoryLoaderTest extends TestCase
2524
{
26-
use ExpectDeprecationTrait;
27-
2825
private AttributeDirectoryLoader $loader;
2926
private TraceableAttributeClassLoader $classLoader;
3027

Tests/Loader/AttributeFileLoaderTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Routing\Tests\Loader;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1615
use Symfony\Component\Config\FileLocator;
1716
use Symfony\Component\Routing\Loader\AttributeFileLoader;
1817
use Symfony\Component\Routing\Tests\Fixtures\AttributedClasses\FooClass;
@@ -29,8 +28,6 @@
2928

3029
class AttributeFileLoaderTest extends TestCase
3130
{
32-
use ExpectDeprecationTrait;
33-
3431
private AttributeFileLoader $loader;
3532
private TraceableAttributeClassLoader $classLoader;
3633

0 commit comments

Comments
 (0)