mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 18:13:13 +00:00
Allow omitting method return type
Support for `@method myMethod()` was missing but according to the docs of phpdocumentor this is possible.
This commit is contained in:
committed by
Jaap van Otterdijk
parent
8ba1708217
commit
b453d2c304
@@ -125,6 +125,11 @@ final class Method extends BaseTag implements Factory\StaticMethod
|
||||
list(, $static, $returnType, $methodName, $arguments, $description) = $matches;
|
||||
|
||||
$static = $static === 'static';
|
||||
|
||||
if ($returnType === '') {
|
||||
$returnType = 'void';
|
||||
}
|
||||
|
||||
$returnType = $typeResolver->resolve($returnType, $context);
|
||||
$description = $descriptionFactory->create($description, $context);
|
||||
|
||||
@@ -196,11 +201,11 @@ final class Method extends BaseTag implements Factory\StaticMethod
|
||||
$arguments[] = $argument['type'] . ' $' . $argument['name'];
|
||||
}
|
||||
|
||||
return ($this->isStatic() ? 'static ' : '')
|
||||
return trim(($this->isStatic() ? 'static ' : '')
|
||||
. (string)$this->returnType . ' '
|
||||
. $this->methodName
|
||||
. '(' . implode(', ', $arguments) . ')'
|
||||
. ($this->description ? ' ' . $this->description->render() : '');
|
||||
. ($this->description ? ' ' . $this->description->render() : ''));
|
||||
}
|
||||
|
||||
private function filterArguments($arguments)
|
||||
|
||||
Reference in New Issue
Block a user