views:

120

answers:

2

For a few days now I'm using NetBeans 6.8 for doing PHP work. But even if a class-file is included and the methods are public and there's phpDoc used, NetBeans everytime shows "No Suggestions" in the window.

E.g. I type

$user->

and press CTRL+Space, I do expect all the methods and variables but there aren't shown any. ideas?

+1  A: 

Make sure netbeans do know what is stored in $user. Every method should have proper @return annotation with either scalar name/array or class name.

If user class is named User, your user getter should look like

/**
@return User
*/
function getUser() {
    //some code
    return $user; //instance of User
}
Mikulas Dite
I tried it with @return, but it doesn't had any effect it seems as if NetBeans just ignores classes from other files, since furthermore there aren't shown any Variables.
Flexx
@Mikulas Dite you seem to be talking about the docs; I believe the issue is not that there are no docs, but that NetBeans can't find the methods.
Jan Kuboschek
+1  A: 
 $foo = new Bar();

When ctrl click on Bar (or right click -> Go to definition) you should go the the Bar class.
To the __construct() to be precise.

If netbeans doenst jump, that means it doesn't know where the Bar class is defined.
$foo-> ctrl+space Would then say "No suggestions"

In your case:

$user = new User();
$user->

If $user is a parameter:

/**
 * @param User $user
 */
 function myFunction($user) {
    $user->

check that you got /** and not just /*

If $user is retrieved via a function:

 /**
  * @return User
  */
  function getUser() {
     // impl
  }
  $user = getUser();
  $user->
Bob Fanger
It doens't work for included files, please see my new question for that: http://stackoverflow.com/questions/2996711/how-to-get-suggestions-in-netbeans-for-included-files
Flexx