-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compatibility for
#[MapEntity]
(Case 178313) (#16)
Listen to `ControllerArgumentsEvent` instead of `ControllerEvent`. This event was introduced in Symfony 3.1 and matches our needs better: - We can get the controller action arguments in a more direct way and iterate over them only (typically fewer than request attributes) - We no longer need to care about the priority of our listener, as the `ControllerArgumentsEvent` is dispatched only after the arguments have been resolved - This allows us to get arguments resolved in other ways, e.g. via a `#[MapEntity]` attribute Other improvements: - Declare all clases final (none of them is supposed to be extended and part of the bundle's API) - Refactorings: rename parameters, remove redundant logic, rename method to be more precise, refactor unit tests for conciseness
- Loading branch information
1 parent
b3e71a1
commit b35a956
Showing
6 changed files
with
145 additions
and
185 deletions.
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
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
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
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
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,16 @@ | ||
<?php | ||
|
||
namespace Webfactory\SlugValidationBundle\Tests\EventListener; | ||
|
||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
/** | ||
* Test controller with an action that has a named argument, so that e.g. the slug parameter name can be determined. | ||
*/ | ||
final class TestController | ||
{ | ||
public function testAction(mixed $object): Response | ||
{ | ||
return new Response(); | ||
} | ||
} |
Oops, something went wrong.