Is it possible to declare protected
or private
class @proptery using PhpDoc?
/**
* Class Node
* @package app\models
* @property string $name
*/
class Node
{
}
Is it possible to declare protected
or private
class @proptery using PhpDoc?
/**
* Class Node
* @package app\models
* @property string $name
*/
class Node
{
}
I don't think so. For @property
, public
is implied, even if it's read-only or write-only. The point of such tags is about documenting interfaces that can't be inferred. A private/protected variable is really internal to the class so it's only relevant to child classes which should be written as if they already know this. You can still leave a plain docblock immediately before you declare it, though.