Question

I have the following set up 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 I have,

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

The code is working, if I just ignore the warning; however, If I use NetBeans feature "Fix Uses (CTRL+SHIFT+I), the required use statement would be deleted.

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

Other Symfony annotations work fine, e.g. the @Route annotation from Sensio\Bundle\FrameworkExtraBundle\Configuration\Route

I would like to know if there is any way to remove the "false" warning on my use statement.

Was it helpful?

Solution

You must check an option in NetBeans :

Tools -> Options -> PHP -> Annotations -> Treat unknown annotation as Type Annotation

(after you check, close your file, then reopen it)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top