2

i've got a variable $user that is of data type User (a class).

i've got it in a class method so i can't just type:

/**
 * @var User
 */
$user = Factory::getInstance('User');

because that will work only with class properties, not method variables like in this case.

how could i tell netbeans that that variable is of data type User in a method?

Thanks!

never_had_a_name
  • 90,630
  • 105
  • 267
  • 383

1 Answers1

1

From this answer, you can do this:

$user = Factory::getInstance('User');
/* @var $user User */

//netbeans should now autocomplete $user->
Community
  • 1
  • 1
Tom Haigh
  • 57,217
  • 21
  • 114
  • 142