Netbeans自动完成与PHP包含文件

When I include PHP file with MySQL connection, for example, the autocomplete just doesn't work.

Let's say I have a connection file:

$servername = "localhost";
$username = "username";
$password = "password";
$db = "example";

$conn = new mysqli($servername, $username, $password, $db);

When I write something like this in the same file -

$statement = $conn->

... It gives me a hint for the method prepare(). But when I create another file and include the connection like this:

include 'connection.php'; And then write the same thing... It just doesn't recognize the methods.

I tried the solutions from here:NetBeans auto-completion from included file not working?

The folder is included in the 'Include Path' section, also the options in the Code Completion are set, but still, it doesn't even autocomplete the file name when I am including it with include or require.

Is this a bug or it's just not a supported feature in Net Beans?

EDIT: Found a solution. Everytime I use this variable I have to write annotation like this:

/* @var $conn mysqli */

Aren't there other ways? In phpstorm for example, it's not needed.