Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Routing] Annotation loader parsing #19283

Copy link
Copy link
Closed
@alsma

Description

@alsma
Issue body actions

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.

Here is my project structure
screen shot 2016-07-04 at 16 59 00

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();
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.