Inheriting metadata from parent structures
suggest change@inheritDoc copies the parent method's documentation into the child. Change the base documentation once and every child that inherits it picks up that change.
abstract class FooBase
{
/**
* @param int $a First parameter to add
* @param int $b Second parameter to add
* @return int
*/
public function sum($a, $b) {}
}
class ConcreteFoo extends FooBase
{
/**
* @inheritDoc
*/
public function sum($a, $b)
{
return $a + $b;
}
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents