|
@@ 62-72 (lines=11) @@
|
| 59 |
|
/** |
| 60 |
|
* Set the name of the command from a @command or @name annotation. |
| 61 |
|
*/ |
| 62 |
|
protected function processCommandTag($tag) |
| 63 |
|
{ |
| 64 |
|
if (!$tag->hasWordAndDescription($matches)) { |
| 65 |
|
throw new \Exception('Could not determine command name from tag ' . (string)$tag); |
| 66 |
|
} |
| 67 |
|
$commandName = $matches['word']; |
| 68 |
|
$this->commandInfo->setName($commandName); |
| 69 |
|
// We also store the name in the 'other annotations' so that is is |
| 70 |
|
// possible to determine if the method had a @command annotation. |
| 71 |
|
$this->commandInfo->addAnnotation($tag->getTag(), $commandName); |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
/** |
| 75 |
|
* The @description and @desc annotations may be used in |
|
@@ 164-173 (lines=10) @@
|
| 161 |
|
/** |
| 162 |
|
* Store the data from a @return annotation in our argument descriptions. |
| 163 |
|
*/ |
| 164 |
|
protected function processReturnTag($tag) |
| 165 |
|
{ |
| 166 |
|
if (!$tag->hasWordAndDescription($matches)) { |
| 167 |
|
throw new \Exception('Could not determine return type from tag ' . (string)$tag); |
| 168 |
|
} |
| 169 |
|
// Look at namespace and `use` statments to make returnType a fqdn |
| 170 |
|
$returnType = $matches['word']; |
| 171 |
|
$returnType = $this->findFullyQualifiedClass($returnType); |
| 172 |
|
$this->commandInfo->setReturnType($returnType); |
| 173 |
|
} |
| 174 |
|
|
| 175 |
|
protected function findFullyQualifiedClass($className) |
| 176 |
|
{ |