diff --git a/src/Tricorder/Command/TricorderCommand.php b/src/Tricorder/Command/TricorderCommand.php index 72a774e..75cfab9 100644 --- a/src/Tricorder/Command/TricorderCommand.php +++ b/src/Tricorder/Command/TricorderCommand.php @@ -20,10 +20,9 @@ use Symfony\Component\Console\Output\OutputInterface; use Tricorder\Exception\InvalidArgumentException; use Tricorder\Formatter\MethodFormatter; -use Tricorder\Processor\ArgumentTypeProcessor; +use Tricorder\Processor\ArgumentProcessor; use Tricorder\Processor\ReturnTypeProcessor; use Tricorder\Tag\Extractor\MethodTagExtractor; -use Tricorder\Tag\Extractor\TricorderTagExtractor; /** * Class TricorderCommand @@ -205,7 +204,8 @@ private function scanMethods(SimpleXMLElement $methods) } }); - $this->scanArguments((string)$method->name, $paramTags, $tricorderTags); + $argumentProcessor = new ArgumentProcessor($this->output); + $argumentProcessor->process((string)$method->name, $paramTags, $tricorderTags); // Process ReturnType $processor = new ReturnTypeProcessor($this->output); @@ -215,20 +215,4 @@ private function scanMethods(SimpleXMLElement $methods) $methodFormatter->outputMessage($this->output); } } - - /** - * Iterate through our list of arguments for the method, examining the tags - * to see what the types are - * - * @param string $methodName - * @param array $tags - * @param array $tricorderTags - */ - private function scanArguments($methodName, array $tags, array $tricorderTags) - { - $processor = new ArgumentTypeProcessor($this->output); - foreach ($tags as $tag) { - $processor->process($methodName, $tag, $tricorderTags); - } - } } diff --git a/src/Tricorder/Processor/ArgumentProcessor.php b/src/Tricorder/Processor/ArgumentProcessor.php new file mode 100644 index 0000000..c1ed86c --- /dev/null +++ b/src/Tricorder/Processor/ArgumentProcessor.php @@ -0,0 +1,48 @@ +output = $output; + } + + /** + * Look at the $tags and react accordingly + * + * @param string $methodName + * @param array $tag + * @param array $tricorderTags + */ + public function process($methodName, array $tags, array $tricorderTags) + { + $processor = new ArgumentTypeProcessor($this->output); + foreach ($tags as $tag) { + $processor->process($methodName, $tag, $tricorderTags); + } + } +}