Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Routing] Annotation loader parsing #19283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alsma opened this issue Jul 4, 2016 · 4 comments
Closed

[Routing] Annotation loader parsing #19283

alsma opened this issue Jul 4, 2016 · 4 comments

Comments

@alsma
Copy link

alsma commented Jul 4, 2016

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();
}
@salahm
Copy link

salahm commented Jul 8, 2016

Hi,

This bug seems to be not reproductible, can you give us please more information about execution context (php version...) ?

@alsma
Copy link
Author

alsma commented Jul 8, 2016

@salahm mac os x 10.11.2 tested on symfony 2.8.2

alexandrsmaga-> php -v
PHP 7.0.6 (cli) (built: Jul  5 2016 22:18:59) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
    with blackfire v1.10.6-refs/heads/prod+1369-internal, https://blackfire.io, by Blackfireio Inc.

@alsma
Copy link
Author

alsma commented Jul 8, 2016

here is screenshot of the error

screen shot 2016-07-08 at 15 36 37

@xabbuh
Copy link
Member

xabbuh commented Jul 9, 2016

Please update to the latest patch version. This was fixed by #18907 (and reported before in #18633) which was first included in Symfony 2.3.42, 2.7.14, 2.8.7, and 3.0.7.

@xabbuh xabbuh closed this as completed Jul 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants