Closed
Description
Hello.
I've just found strange issue with routing annotation loader and traits.
I'm getting error Class AppBundle\Controller\getDoctrine does not exist in /path/sf282/src/AppBundle/Controller/
. After some debugging I came to \Symfony\Component\Routing\Loader\AnnotationFileLoader::findClass
, so probably there some bug.
I have trait inside controller directory, and routing configured to parse annotations inside directory
app:
resource: "@AppBundle/Controller/"
type: annotation
<?php
namespace AppBundle\Controller;
use Doctrine\Common\Persistence\ManagerRegistry;
use AppBundle\Entity\SomeExistingEntity;
trait SomeTrait
{
public function getMyRepo()
{
return $this->getDoctrine()->getRepository(SomeExistingEntity::class);
}
/**
* @return ManagerRegistry
*/
abstract protected function getDoctrine();
}