Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #48170 [Routing] Fix PSR-4 directory loader for abstract classes …
…(derrabus) This PR was merged into the 6.2 branch. Discussion ---------- [Routing] Fix PSR-4 directory loader for abstract classes | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #48168, Replaces #48169 | License | MIT | Doc PR | N/A Commits ------- a232a23 [Routing] Fix PSR-4 directory loader for abstract classes
- Loading branch information
Showing
5 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...Symfony/Component/Routing/Tests/Fixtures/Psr4Controllers/SubNamespace/IrrelevantClass.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* 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; | ||
|
||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
/** | ||
* An irrelevant class. | ||
* | ||
* This fixture is not referenced anywhere. Its presence makes sure, classes without attributes are silently ignored | ||
* when loading routes from a directory. | ||
*/ | ||
final class IrrelevantClass | ||
{ | ||
public function irrelevantAction(): Response | ||
{ | ||
return new Response(status: Response::HTTP_NO_CONTENT); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ny/Component/Routing/Tests/Fixtures/Psr4Controllers/SubNamespace/MyAbstractController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* 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; | ||
|
||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
abstract class MyAbstractController | ||
{ | ||
#[Route('/a/route/from/an/abstract/controller', name: 'from_abstract')] | ||
public function someAction(): Response | ||
{ | ||
return new Response(status: Response::HTTP_NO_CONTENT); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...mfony/Component/Routing/Tests/Fixtures/Psr4Controllers/SubNamespace/MyChildController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* 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; | ||
|
||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
#[Route('/my/child/controller', name: 'my_child_controller_')] | ||
final class MyChildController extends MyAbstractController | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters