I’m experiencing some problems in auto-complete feature of NetBeans. I’m using NetBeans for a Symfony2 PHP project and phpDocumentor mainly for auto-complete feature (not for generating documentation).
What’s the right syntax between these (or it’s basically the same)?
Fully qualified class names:
class MyClass
{
/**
* @param \MyCompany\MyBundle\Entity\User $user
* @return string
*/
public function myFunction(\MyCompany\MyBundle\Entity\User $user) { }
}
Class names:
use \MyCompany\MyBundle\Entity\User;
class MyClass
{
/**
* @param User $user
* @return string
*/
public function myFunction(User $user) { }
}
Technically they are both correct.
Zend Studio (Eclipse) won’t generate auto-completions unless the target class is part of the current project’s Build Path. Maybe NetBeans has something similar?
Exactly what problems are you having?
EDIT
FYI, you do need to use a FQCN for return values, even if the right namespace is already in use. For example, if
MyClass::myFunction()returns a User, you’d want to do this