Skip to content

Commit 857ac6f

Browse files
committed
[Routing] Make sure enums don't confuse the PSR-4 loader
1 parent 647420d commit 857ac6f

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Routing\Tests\Fixtures\Psr4Controllers\SubNamespace;
13+
14+
/**
15+
* An irrelevant enum.
16+
*
17+
* This fixture is not referenced anywhere. Its presence makes sure, enums are silently ignored when loading routes
18+
* from a directory.
19+
*/
20+
enum IrrelevantEnum
21+
{
22+
case Foo;
23+
case Bar;
24+
}

Tests/Fixtures/Psr4Controllers/SubNamespace/IrrelevantInterface.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\Routing\Tests\Fixtures\Psr4Controllers\SubNamespace;
413

514
interface IrrelevantInterface

0 commit comments

Comments
 (0)