Skip to content

[HttpKernel] Renamed the argument resolver tag #18529

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 1 commit into from
Apr 15, 2016
Merged

[HttpKernel] Renamed the argument resolver tag #18529

merged 1 commit into from
Apr 15, 2016

Conversation

linaori
Copy link
Contributor

@linaori linaori commented Apr 13, 2016

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? not if merged before 3.1
Deprecations? no
Tests pass? yes
Fixed tickets ~
License MIT
Doc PR ~

Changed as discussed several times: #18510 (comment), symfony/symfony-docs#6422 (comment).

@stof
Copy link
Member

stof commented Apr 13, 2016

if this does not require any change in the testsuite, it looks like we are missing some tests...

@linaori
Copy link
Contributor Author

linaori commented Apr 13, 2016

@stof this is functionally tested only (implicitly), I can add a compiler pass unit-test though.

@javiereguiluz
Copy link
Member

👍

@linaori
Copy link
Contributor Author

linaori commented Apr 13, 2016

Added a test and named the compiler pass properly, it was still having "Controller" which is not part of the tag anymore.

@nicolas-grekas
Copy link
Member

👍

@@ -20,7 +20,7 @@
*
* @author Iltar van der Berg <kjarli@gmail.com>
*/
class ControllerArgumentValueResolverPass implements CompilerPassInterface
class ArgumentValueResolverPass implements CompilerPassInterface
Copy link
Member

Choose a reason for hiding this comment

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

This rename looks wrong to me. Compiler passes is in the Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler namespace, which gives no hints as to what Argument refers to.

@fabpot
Copy link
Member

fabpot commented Apr 13, 2016

👎 I'm all for having shorter names, but they need to be self-descriptive as well. Here, we're not talking about any argument, but only controller arguments.

@javiereguiluz
Copy link
Member

Other alternatives considered:

  • controller.value_resolver
  • controller.argument_value_resolver
  • controller.argument_value
  • controller.argument_resolver

@xabbuh
Copy link
Member

xabbuh commented Apr 13, 2016

If we were to change this, I would vote for controller.argument_value_resolver.

@linaori
Copy link
Contributor Author

linaori commented Apr 13, 2016

@xabbuh That's actually the same length as before:

  • controller_argument.value_resolver
  • controller.argument_value_resolver

@xabbuh
Copy link
Member

xabbuh commented Apr 13, 2016

@iltar That's true. But it still conveys the proper meaning while making the namespace more clear imo. To me all other suggestions lose too much information.

@linaori
Copy link
Contributor Author

linaori commented Apr 13, 2016

That's true, in that case I will also name the class the same as before again.

@linaori
Copy link
Contributor Author

linaori commented Apr 14, 2016

Rebased to a clean commit, if everyone agrees on the name, I will update my other PRs

@fabpot
Copy link
Member

fabpot commented Apr 14, 2016

👍

@xabbuh
Copy link
Member

xabbuh commented Apr 14, 2016

Why do you mock the DI related classes in the test? Imo you should rather use the real classes and check that the definitions are modified as expected.

@linaori
Copy link
Contributor Author

linaori commented Apr 14, 2016

@xabbuh I can do that, this was simply copied from the other tests

);

$definition = new Definition(ArgumentResolver::class, array(null, array()));
$container = $this->getMock(ContainerBuilder::class, array('findTaggedServiceIds'));
Copy link
Member

Choose a reason for hiding this comment

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

You can just create a ContainerBuilder instance here (like, for example, done in the FormPassTest and CachePoolPassTest).

Copy link
Member

Choose a reason for hiding this comment

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

and the same for the other test methods as well

@linaori
Copy link
Contributor Author

linaori commented Apr 15, 2016

@xabbuh, no more mocking ;)

@fabpot
Copy link
Member

fabpot commented Apr 15, 2016

Thank you @iltar.

@fabpot fabpot merged commit cd10057 into symfony:master Apr 15, 2016
fabpot added a commit that referenced this pull request Apr 15, 2016
This PR was merged into the 3.1-dev branch.

Discussion
----------

[HttpKernel] Renamed the argument resolver tag

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | not if merged before 3.1
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Changed as discussed several times: #18510 (comment), symfony/symfony-docs#6422 (comment).

Commits
-------

cd10057 Renamed argument resolver tag, added test
@linaori linaori deleted the feature/controller-argument-tag branch February 8, 2019 13:38
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.

7 participants