reflection->getDocComment(); if (empty($docComment)) { return; } $phpdoc = $this->createDocBlock(); // First set the description (synopsis) and help. $this->commandInfo->setDescription((string)$phpdoc->getSummary()); $this->commandInfo->setHelp((string)$phpdoc->getDescription()); $this->processAllTags($phpdoc); } public function createDocBlock() { $docBlockFactory = \phpDocumentor\Reflection\DocBlockFactory::createInstance(); $contextFactory = new \phpDocumentor\Reflection\Types\ContextFactory(); return $docBlockFactory->create( $this->reflection, $contextFactory->createFromReflector($this->reflection) ); } protected function getTagContents($tag) { return (string)$tag; } /** * Store the data from a @param annotation in our argument descriptions. */ protected function processParamTag($tag) { if (!$tag instanceof Param) { return; } return parent::processParamTag($tag); } /** * Store the data from a @return annotation in our argument descriptions. */ protected function processReturnTag($tag) { if (!$tag instanceof Return_) { return; } // If there is a spurrious trailing space on the return type, remove it. $this->commandInfo->setReturnType(trim($this->getTagContents($tag))); } }