Commit c67c4910 by Carsten Brandt

fixed apidoc inherit

parent 595faca9
...@@ -166,6 +166,14 @@ class Context extends Component ...@@ -166,6 +166,14 @@ class Context extends Component
foreach ($class->methods as $m) { foreach ($class->methods as $m) {
if ($m->hasTag('inheritdoc')) { if ($m->hasTag('inheritdoc')) {
$inheritedMethod = $this->inheritMethodRecursive($m, $class); $inheritedMethod = $this->inheritMethodRecursive($m, $class);
if (!$inheritedMethod) {
$this->errors[] = [
'line' => $m->startLine,
'file' => $class->sourceFile,
'message' => "Method {$m->name} has no parent to inherit from in {$class->name}.",
];
continue;
}
foreach (['shortDescription', 'description', 'return', 'returnType', 'returnTypes', 'exceptions'] as $property) { foreach (['shortDescription', 'description', 'return', 'returnType', 'returnTypes', 'exceptions'] as $property) {
if (empty($m->$property) || is_string($m->$property) && trim($m->$property) === '') { if (empty($m->$property) || is_string($m->$property) && trim($m->$property) === '') {
$m->$property = $inheritedMethod->$property; $m->$property = $inheritedMethod->$property;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment