Bug #61193

DependencyInjection with @var uses everything as classname

Added by Guido Wehner over 6 years ago. Updated almost 5 years ago.

Status:
Rejected
Priority:
Won't have this time
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2014-08-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hello,

this is my first issue.

If you use dependency injection in your controller und you use @var to describe the type of the variable the ClassInfoFactory uses everything after @var as class name

In function buildClassInfoFromClassname($className) the className isn't parsed or formatted.

I need to write the name of the property after the type

Reference for phpdoc @var
[[http://phpdoc.org/docs/latest/references/phpdoc/tags/var.html]]

I need to write

/**
 * @var \BM\Simpleblog\Domain\Repository\BlogRepository $blogRepository
 * @inject
 */
protected $blogRepository;

but then "BM\Simpleblog\Domain\Repository\BlogRepository $blogRepository" is used as className.

$className = preg_replace("/(\s.*)/", "", $className);
would do the job, but I cannot say if it breaks tests or why there is no parsing the variable, maybe there are reasons I dont know.

Also available in: Atom PDF