简体   繁体   中英

How to use Grouped Use statements with Symfony3?

I have PHP 7.1 installed on my machine and I'm developping an application with Symfony. When I tried to group my use statements from same namespace I got an error, saying that they were never declared.

My use :

use Sensio\Bundle\FrameworkExtraBundle\Configuration\{
    Route, Method
};

The error shown int the browser:

[Semantical Error] The annotation "@Route" in method AppBundle\Controller\EpisodiosController::listarAction() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /home/vinicius/Documentos/controle-de-series/src/AppBundle/Controller/ (which is being imported from "/home/vinicius/Documentos/controle-de-series/app/config/routing.yml").

Did I miss something?

Thanks in advance.

I figured out that the error is a bug concerning to the annotations, and not to the hole framework. So, splitting the use statements of the annotations worked just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM