Skip to content

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

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 16, 2017

Conversation

sroze
Copy link
Contributor

@sroze sroze commented Nov 15, 2017

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.

@sroze sroze changed the base branch from master to 3.4 November 15, 2017 09:45
@sroze
Copy link
Contributor Author

sroze commented Nov 15, 2017

Not sure why fabbot complains about the PR header 🤔 It looks like fabbot do not support copy/pasted tables :)

@sroze
Copy link
Contributor Author

sroze commented Nov 15, 2017

AppVeyor's issue is unrelated.

@nicolas-grekas
Copy link
Member

@sroze could you please squash the PR so that there are only two commits: mine and yours?

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Nov 15, 2017
sroze and others added 2 commits November 15, 2017 13:29
Prove that the service value resolver will not work with the array notation
@sroze sroze force-pushed the fix-service-resolver-with-tests branch from 5a7fc76 to fc3d3bb Compare November 15, 2017 11:29
@sroze
Copy link
Contributor Author

sroze commented Nov 15, 2017

@nicolas-grekas done

@nicolas-grekas
Copy link
Member

Thank you @sroze.

@nicolas-grekas nicolas-grekas merged commit fc3d3bb into symfony:3.4 Nov 16, 2017
nicolas-grekas added a commit that referenced this pull request Nov 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 callables
a9e9f36 Add service value resolver tests Prove that the service value resolver will not work with the array notation
This was referenced Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants