Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add the kernel.controller_arguments event#18440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromstof:controller_arguments_event
Apr 7, 2016

Conversation

@stof
Copy link
Member

@stofstof commentedApr 5, 2016

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#18362
LicenseMIT
Doc PRsymfony/symfony-docs#6434

I'm not sure this can be integrated in 3.1 due to the feature freeze, but it would be great if it is, as it is a must-have to be able to make the@Security annotation compatible with the new argument resolver system (as we need to be able to run the security assertion after the resolving).

I made the arguments mutable here for consistency withkernel.controller (and@fabpot replied LGTM in the RFC when I suggested it).

stloyd, Taluu, Nicofuma, and linaori reacted with thumbs up emoji
/**
* Allows filtering of controller arguments.
*
* You can call getController() to retrieve the controller and getArgument
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Minor inconsistency:getArgument ->getArgument()

@stofstofforce-pushed thecontroller_arguments_event branch fromdc19f30 todb73ebdCompareApril 5, 2016 07:34
{
switch ($eventName) {
case KernelEvents::CONTROLLER:
case KernelEvents::CONTROLLER_ARGUMENTS:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

you're removing the stopwatch start oncontroller events then, to apply it only oncontroller_arguments events ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@Taluu this is about starting the stopwatch for the controller execution itself. As there is now an event after the resolution of arguments, I starting it there now, as it makes the timing more accurate (in existing versions, the argument resolution is included in the controller time, even though it is also timed on its own)

@stof
Copy link
MemberAuthor

stof commentedApr 6, 2016

@javiereguiluz thanks for writing the doc PR

@stof
Copy link
MemberAuthor

stof commentedApr 6, 2016

@fabpot@nicolas-grekas can you give your mind on whether this PR can still be considered for 3.1 ?

@fabpot
Copy link
Member

That's going to be for 3.2 as we are in feature freeze now (except for old PRs that are about to be finished).

@stof
Copy link
MemberAuthor

stof commentedApr 7, 2016

@fabpot this means that SensioFrameworkExtraBundle@Security annotation will be incompatible with argument resolvers in 3.1 (as it must be evaluated with converted arguments), and so we cannot replace ParamConverter by argument resolvers in the bundle until 3.2.

@HeahDude
Copy link
Contributor

This event was on the table the day before the feature freeze, it's a nice following of#18308, it deserves a nice exception :)

@linaori
Copy link
Contributor

I agree that this might be a nice addition to speed up the development by ~6 months

@stofstofforce-pushed thecontroller_arguments_event branch fromdb73ebd toaf02e2aCompareApril 7, 2016 14:51
@stof
Copy link
MemberAuthor

stof commentedApr 7, 2016

As requested by@fabpot in person, I made the controller callable mutable as well during this event, making it possible to replace the controller by a different callable, after arguments of the original controller are resolved. This is great when wanting to wrap the controller into a callable having a different signature than the original one for instance (@fabpot has such a use case for blackfire btw). And there is a test covering this use case.
As the controller is mutable now, the new event class now extends the FilterControllerEvent

linaori reacted with thumbs up emoji

@fabpot
Copy link
Member

Thank you@stof.

@fabpotfabpot merged commitaf02e2a intosymfony:masterApr 7, 2016
fabpot added a commit that referenced this pull requestApr 7, 2016
This PR was merged into the 3.1-dev branch.Discussion----------Add the kernel.controller_arguments event| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#18362| License       | MIT| Doc PR        |symfony/symfony-docs#6434I'm not sure this can be integrated in 3.1 due to the feature freeze, but it would be great if it is, as it is a must-have to be able to make the ``@Security`` annotation compatible with the new argument resolver system (as we need to be able to run the security assertion after the resolving).I made the arguments mutable here for consistency with ``kernel.controller`` (and@fabpot replied LGTM in the RFC when I suggested it).Commits-------af02e2a Add the kernel.controller_arguments event
@javiereguiluz
Copy link
Member

@stof now that this is merged, please share your thoughts about its docs here:symfony/symfony-docs#6434 Thanks!

@stofstof deleted the controller_arguments_event branchApril 7, 2016 15:42
@HeahDude
Copy link
Contributor

🎉

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@stof@fabpot@HeahDude@linaori@javiereguiluz@Taluu@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp