From 6ae6af014139278f0eb075dfdeb3723efc929976 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 9 Nov 2022 14:28:29 +0100 Subject: [PATCH] [Routing] Make sure enums don't confuse the PSR-4 loader --- .../SubNamespace/IrrelevantEnum.php | 24 +++++++++++++++++++ .../SubNamespace/IrrelevantInterface.php | 9 +++++++ 2 files changed, 33 insertions(+) create mode 100644 src/Symfony/Component/Routing/Tests/Fixtures/Psr4Controllers/SubNamespace/IrrelevantEnum.php diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/Psr4Controllers/SubNamespace/IrrelevantEnum.php b/src/Symfony/Component/Routing/Tests/Fixtures/Psr4Controllers/SubNamespace/IrrelevantEnum.php new file mode 100644 index 0000000000000..db84fe6cee15f --- /dev/null +++ b/src/Symfony/Component/Routing/Tests/Fixtures/Psr4Controllers/SubNamespace/IrrelevantEnum.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Routing\Tests\Fixtures\Psr4Controllers\SubNamespace; + +/** + * An irrelevant enum. + * + * This fixture is not referenced anywhere. Its presence makes sure, enums are silently ignored when loading routes + * from a directory. + */ +enum IrrelevantEnum +{ + case Foo; + case Bar; +} diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/Psr4Controllers/SubNamespace/IrrelevantInterface.php b/src/Symfony/Component/Routing/Tests/Fixtures/Psr4Controllers/SubNamespace/IrrelevantInterface.php index eb7dac654eebf..8e96349eb4f11 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/Psr4Controllers/SubNamespace/IrrelevantInterface.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/Psr4Controllers/SubNamespace/IrrelevantInterface.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\Routing\Tests\Fixtures\Psr4Controllers\SubNamespace; interface IrrelevantInterface