NetBeans / Symfony2 Provides Warnings About Unused Usage When Using FOSRestBundle Namespaces

I have the following setup on my PC, Ubuntu: 13.10, NetBeans: 8.0, Symfony: 2.4.3, FOSRestBundle: 1.3.0,

and I have a “false” warning “unused use statement” in my code:

use FOS\RestBundle\Controller\Annotations; 

where later am I

 /** /* @Annotations\View() */ public function someFunction(){} 

The code works if I just ignore the warning; however, if I use NetBeans' Fix Uses (CTRL + SHIFT + I), the instructions for use will be deleted.

I found the corresponding error archive here: https://netbeans.org/bugzilla/show_bug.cgi?id=212932 but the error has the status as resolved.

Other symfony annotations work fine, for example. @Route annotations from Sensio \ Bundle \ FrameworkExtraBundle \ Configuration \ Route

I would like to know if there is a way to remove the “false” warning in my usage instruction.

+7
warnings annotations symfony netbeans fosrestbundle
source share
1 answer

You should check the option in NetBeans:

Tools -> Options -> PHP -> Annotations -> Treat unknown annotation as type annotation

(after you check, close your file, then open it again)

+12
source share

All Articles