Bug #33293

Injection to private variable results in injection of the the wrong class

Added by Christof Rodejohann almost 10 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-01-18
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

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.

No data to display

Also available in: Atom PDF