Skip to content
Advertisement

Netbeans PHPDoc local variable not working

I am trying to document my code more often and now I’m writing a class and want it to be fully documented. However, for some strange reason, local variable documentation (with PHPDoc of course) doesn’t work..

I got this:

JavaScript

So when I type ‘the’ and press space, and go to my function in Netbeans, it shows the function documentation.

But, when I type ‘aVa’ inside the function and press space and go to my variable, it says ‘PHPDoc not found’.

I know in this case it wouldn’t be a problem, but in a big function with lots of code it could actually be useful. However, for some reason it doesn’t work and I have no clue why.

Advertisement

Answer

I don’t think you can document internal variables like that. You can document class variable declarations and function parameters but the documentation doesn’t say anything about a local function variable

You may use the @var tag to document the “Type” of properties, sometimes called class variables. Examples

JavaScript

Even compound statements may be documented:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement