[TYPO3-mvc] could not analyse class:clientRepository maybe not loaded error in 6.x

Xavier Perseguers xavier at typo3.org
Tue Apr 2 07:56:13 CEST 2013


Hi,

> Ok I found the reason:
> 
> I use Phpstorm and my IDE is rewriting my Code taking the Path into the
> use namespace.
> 
> ...
> use DMF\DmfTemplate\Domain\Repository\ClientRepository;
> 
> class ClientController extends
> \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
> 
>     /**
>      * clientRepository
>      *
>      * @var ClientRepository
>      * @inject
>      */
>     protected $clientRepository;
> ...
> 
> This is not working and I'll get an the error. So I need the full
> qualified name in the comments and everything works as expected. Is this
> intend to be like this?

AFAIK the code is parsing the PhpDoc to extract the name of the class to
be injected and is using the Reflection PHP object to do that. With
"use", you have a non fully qualified class name and it would force the
injector to manually parse the enclosing PHP file itself to get a list
of "use" statements, test each of them in turn until finding the correct
FQCN. I guess, this is just too much work (could cost quite much even if
cached in the end) and was simply not implemented.

Kind regards

-- 
Xavier Perseguers
Release Manager TYPO3 4.6

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-project-typo3v4mvc mailing list