开发者

"No Suggestions" in NetBeans

For a few days now I'm using NetBeans 6.8 for doing PHP work. But even if a class开发者_JAVA技巧-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?


 $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->


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
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜