Lets say I have parent class with some variable, which has phpdoc:
class Parent
{
/**
* This variable stores some important value that
* is going to be changed in child classes
* @var integer
*/
public $variable = 0;
}
Now I am writing child class, which has this variable overriden:
class Child extends Parent
{
public $variable = 10;
}
So my question is: what phpdoc should I write for $variable in Child class, so I do not have to copy and paste variable description? Same question goes for methods. Help is much appreciated.
Update: I've asked this question after I've seen errors after creating phpdoc, like "No summary for property $variable" in Child class. If I add this summary - error disappears, but phpdoc shows description from Parent class anyway, no matter what I write in Child class. What am I doing wrong?
{@inheritdoc}maybe?{@inheritdoc}religiously on class methods/variables, not just for classes. And their docs compile just fine. In fact, even Symfony use it so it's definitely the right way to go