From 4cf7a0c57b7b4374cb8b85660cab6bcacb5cf22b Mon Sep 17 00:00:00 2001 From: "richard.gooding" Date: Sat, 29 Aug 2015 14:02:05 +0100 Subject: [PATCH] Fixed docblock parsing on methods that have a @return tag --- src/Console/ConsoleCommand.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Console/ConsoleCommand.php b/src/Console/ConsoleCommand.php index 017651d..54325c9 100644 --- a/src/Console/ConsoleCommand.php +++ b/src/Console/ConsoleCommand.php @@ -4,6 +4,7 @@ use Cubex\Cubex; use Cubex\ICubexAware; use phpDocumentor\Reflection\DocBlock; +use phpDocumentor\Reflection\DocBlock\Tag\ParamTag; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -106,11 +107,11 @@ protected function createFromActionableMethod(\ReflectionClass $class) $descriptions = []; foreach($propBlock->getTags() as $tag) { - /** - * @var $tag \phpDocumentor\Reflection\DocBlock\Tag\ParamTag - */ - $tagName = substr($tag->getVariableName(), 1); - $descriptions[$tagName] = $tag->getDescription(); + if($tag instanceof ParamTag) + { + $tagName = substr($tag->getVariableName(), 1); + $descriptions[$tagName] = $tag->getDescription(); + } } foreach($method->getParameters() as $paramNum => $parameter)