If a class defines an actual property, then getter/setter methods using the same name should not have any effect on the property docs.
For example, given this class:
class Student extends BaseObject
{
/**
* @var int The student's birth year
*/
public $birthYear;
/**
* Returns the student's birth year.
*
* @return int The student's birth year.
*/
public function getBirthYear()
{
return true;
}
}
Currently yii2-apidoc will document birthYear as a read-only property because it has a corresponding getter, but no setter. Which is obviously not true.
I think if a property is actually defined by a class, whether it's protected or public, then any getter/setter methods that have the same name should ignore it, and just be documented separately.
If a class defines an actual property, then getter/setter methods using the same name should not have any effect on the property docs.
For example, given this class:
Currently yii2-apidoc will document
birthYear
as a read-only property because it has a corresponding getter, but no setter. Which is obviously not true.I think if a property is actually defined by a class, whether it's
protected
orpublic
, then any getter/setter methods that have the same name should ignore it, and just be documented separately.Additional info