This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Bundle
Fabien Potencier f9b0aaa488 bug #18289 [FrameworkBundle] Return the invokable service if its name is the class name (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #18289).

Discussion
----------

[FrameworkBundle] Return the invokable service if its name is the class name

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

 if a service is invokable and has the same name than its class name, the controller resolver of FrameworkBundle doesn't retrieve the service and tries to construct a new instance of the class instead.

This is a very rare edge case, but this fix is useful for dunglas/DunglasActionBundle#36: referencing auto-registered controllers following the ADR style in YAML and XML routing files will be more intuitive.

Currently: `defaults:  { _controller: 'Your\Action\FQN:__invoke' }`, after this fix: `defaults:  { _controller: 'Your\Action\FQN' }`.

This PR also fix a currently useless test.

Commits
-------

70b9309 [FrameworkBundle] Return the invokable service if its name is the class name
2016-03-25 18:28:09 +01:00
..
DebugBundle Merge branch '3.0' 2016-02-13 10:24:02 +01:00
FrameworkBundle bug #18289 [FrameworkBundle] Return the invokable service if its name is the class name (dunglas) 2016-03-25 18:28:09 +01:00
SecurityBundle [Security] Use auth trust resolver to determine anonymous in ContextListener 2016-03-23 10:01:34 -07:00
TwigBundle [FrameworkBundle][TwigBundle] Make EngineInterface autowirable 2016-03-20 21:44:43 +01:00
WebProfilerBundle Merge branch '3.0' 2016-03-23 14:33:04 +01:00