Bug #33293
Injection to private variable results in injection of the the wrong class
Status: | New | Start date: | 2012-01-18 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | - | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: | No | Affected Flow version: | FLOW3 1.0.2 |
Description
If you annotate a private declared class variable to inject some class this annotated class won't be injected. Rather the class itself will be injected.
Here is an example:
http://pastebin.com/LJW14jqs
This is a command controller created via kickstarter in a freshly kickstarted package. PhpSession is injected as an example.
With $currentSession declared as protected (which can be seen in the above example) the output is as expected:
You called the example command and class name is "TYPO3\FLOW3\Session\PhpSession".
With $currentSession declared as private the output is the following:
You called the example command and class name is "RD\TEST\Command\TestCommandController_Original".
I am a little confused whether this follows some OOP pattern or is simply a bug. Either way, this can't be the intended behavior.