Clarification For Using @var On Local Variable Declaration

72 views
Skip to first unread message

Chad Retz

unread,
Nov 10, 2015, 11:52:40 AM11/10/15
to PHP Framework Interoperability Group
The proposed standard for PHPDoc at https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md#824-var for @var says:

"The @var tag MUST contain the name of the element it documents. An exception to this is when property declarations only refer to a single property. In this case the name of the property MAY be omitted."

I note that this specifically says the exception is for a single property declaration but not single variable declarations. Why not? Any links to discussion around this point? Just looking for clarification.

Mike van Riel

unread,
Nov 29, 2015, 7:01:55 AM11/29/15
to php...@googlegroups.com
Hello Chad,

Single variable declarations are outside scope for PSR-5; this is a construct that has been introduced by IDEs to assist with autocompletion and would make the current proposal more complicated.

I hope this answers your question,

Kind regards,

Mike van Riel

--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/0942fe60-ba2e-43c5-93da-91cb6a140390%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc
Reply all
Reply to author
Forward
0 new messages