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

[HttpKernel] Fix service arg resolver for controllers as array callables#24970

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

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

As spotted today during a Symfony 4 workshop at SymfonyCon Cluj, setting a controller as an array[SomeController::class, 'helloAction'] works, it is defined as a service, BUT the actions don't get the services as arguments. This is fixing it.

Copy link
Member

@xabbuhxabbuh left a comment

Choose a reason for hiding this comment

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

a test would be nice :)

@weaverryan
Copy link
Member

Aren't workshops useful?

And yea... this important class doesn't have a test at all yet. Maybe we should add one at lunch tomorrow ;)

@Simperfit
Copy link
Contributor

Simperfit commentedNov 15, 2017
edited
Loading

@weaverryan Maybe we should keep that kind of contribution (the tests) for the hackday in 3 days ?

@sroze
Copy link
Contributor

Created tests for the existing behaviour plus the failing test in here:#24972

@nicolas-grekas
Copy link
MemberAuthor

Closing in favor of#24972

@nicolas-grekasnicolas-grekas deleted the fix-service-resolver branchNovember 15, 2017 11:31
nicolas-grekas added a commit that referenced this pull requestNov 16, 2017
…rray callables (sroze, nicolas-grekas)This PR was merged into the 3.4 branch.Discussion----------[HttpKernel] Fix service arg resolver for controllers as array callables| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#24970| License       | MIT| Doc PR        | øReplacing#24970 as I can't push tests directly to@nicolas-grekas' PR.> As spotted today during a Symfony 4 workshop at SymfonyCon Cluj, setting a controller as an array [SomeController::class, 'helloAction'] works, it is defined as a service, BUT the actions don't get the services as arguments. This is fixing it.Commits-------fc3d3bb [HttpKernel] Fix service arg resolver for controllers as array callablesa9e9f36 Add service value resolver tests Prove that the service value resolver will not work with the array notation
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh approved these changes

+1 more reviewer

@ogizanagiogizanagiogizanagi approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

7 participants

@nicolas-grekas@weaverryan@Simperfit@sroze@xabbuh@ogizanagi@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp