I\'m fairly new to PHP, and I just started using NetBeans to develop my PHP code.
Out of the blue, as I entered a variable in a query, a dialog popped up and asked me to
If you want to declare the type of a variable in the case where the variable is not a class property but just a variable that holds some returned value, use single star comments followed by @var followed by your variable name and finally followed by the type of that variable. For example:
/* @var $errorMessage NotificationMessage */
$errorMessage= $allMessages->rewind()->current();
will tell NetBeans or PhpStorm that $errorMessage is an instance of NotificationMessage, and you should get the code completion for that variable.