8

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.

1 Answer 1

15

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)

Sign up to request clarification or add additional context in comments.

1 Comment

Great, and I've been looking for this answer for a long time :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.