@@ -4,8 +4,6 @@ |
||
| 4 | 4 | use phpDocumentor\Reflection\DocBlock; |
| 5 | 5 | use phpDocumentor\Reflection\DocBlock\Tag\ParamTag; |
| 6 | 6 | use phpDocumentor\Reflection\DocBlock\Tag\ReturnTag; |
| 7 | -use Consolidation\AnnotatedCommand\Parser\CommandInfo; |
|
| 8 | -use Consolidation\AnnotatedCommand\Parser\DefaultsWithDescriptions; |
|
| 9 | 7 | |
| 10 | 8 | /** |
| 11 | 9 | * Given a class and method name, parse the annotations in the |
@@ -255,7 +255,7 @@ |
||
| 255 | 255 | { |
| 256 | 256 | $names = array_merge( |
| 257 | 257 | (array)$names, |
| 258 | - ($annotationData == null) ? [] : array_map(function ($item) { |
|
| 258 | + ($annotationData == null) ? [] : array_map(function($item) { |
|
| 259 | 259 | return "@$item"; |
| 260 | 260 | }, $annotationData->keys()) |
| 261 | 261 | ); |
@@ -207,6 +207,7 @@ discard block |
||
| 207 | 207 | /** |
| 208 | 208 | * Given a docblock description in the form "$variable description", |
| 209 | 209 | * return the variable name and description via the 'match' parameter. |
| 210 | + * @param string $source |
|
| 210 | 211 | */ |
| 211 | 212 | protected function pregMatchNameAndDescription($source, &$match) |
| 212 | 213 | { |
@@ -220,6 +221,7 @@ discard block |
||
| 220 | 221 | /** |
| 221 | 222 | * Given a docblock description in the form "$variable description", |
| 222 | 223 | * return the variable name and description via the 'match' parameter. |
| 224 | + * @param string $source |
|
| 223 | 225 | */ |
| 224 | 226 | protected function pregMatchOptionNameAndDescription($source, &$match) |
| 225 | 227 | { |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | /** |
| 38 | 38 | * For internal use only; indicates that the function to be called |
| 39 | 39 | * should be passed an InputInterface &/or an OutputInterface. |
| 40 | - * @param booean $usesInputInterface |
|
| 40 | + * @param boolean $usesInputInterface |
|
| 41 | 41 | * @param boolean $usesOutputInterface |
| 42 | 42 | * @return self |
| 43 | 43 | */ |
@@ -38,6 +38,9 @@ discard block |
||
| 38 | 38 | protected $usesOutputInterface; |
| 39 | 39 | protected $returnType; |
| 40 | 40 | |
| 41 | + /** |
|
| 42 | + * @param string $name |
|
| 43 | + */ |
|
| 41 | 44 | public function __construct($name = null) |
| 42 | 45 | { |
| 43 | 46 | $commandInfo = false; |
@@ -67,6 +70,9 @@ discard block |
||
| 67 | 70 | return $this; |
| 68 | 71 | } |
| 69 | 72 | |
| 73 | + /** |
|
| 74 | + * @param CommandProcessor $commandProcessor |
|
| 75 | + */ |
|
| 70 | 76 | public function setCommandProcessor($commandProcessor) |
| 71 | 77 | { |
| 72 | 78 | $this->commandProcessor = $commandProcessor; |
@@ -120,6 +126,9 @@ discard block |
||
| 120 | 126 | return $this; |
| 121 | 127 | } |
| 122 | 128 | |
| 129 | + /** |
|
| 130 | + * @param CommandInfo $commandInfo |
|
| 131 | + */ |
|
| 123 | 132 | public function setCommandInfo($commandInfo) |
| 124 | 133 | { |
| 125 | 134 | $this->setDescription($commandInfo->getDescription()); |
@@ -198,6 +207,10 @@ discard block |
||
| 198 | 207 | return $dom; |
| 199 | 208 | } |
| 200 | 209 | |
| 210 | + /** |
|
| 211 | + * @param \DOMDocument $dom |
|
| 212 | + * @param string $tagName |
|
| 213 | + */ |
|
| 201 | 214 | protected function getSingleElementByTagName($dom, $parent, $tagName) |
| 202 | 215 | { |
| 203 | 216 | // There should always be exactly one '<command>' element. |
@@ -275,6 +288,9 @@ discard block |
||
| 275 | 288 | return InputArgument::OPTIONAL; |
| 276 | 289 | } |
| 277 | 290 | |
| 291 | + /** |
|
| 292 | + * @param CommandInfo $commandInfo |
|
| 293 | + */ |
|
| 278 | 294 | public function setCommandOptions($commandInfo, $automaticOptions = []) |
| 279 | 295 | { |
| 280 | 296 | $inputOptions = $commandInfo->inputOptions(); |
@@ -345,6 +361,9 @@ discard block |
||
| 345 | 361 | ); |
| 346 | 362 | } |
| 347 | 363 | |
| 364 | + /** |
|
| 365 | + * @param Hooks\CommandInfo[] $commandInfoList |
|
| 366 | + */ |
|
| 348 | 367 | public function optionsHookForHookAnnotations($commandInfoList) |
| 349 | 368 | { |
| 350 | 369 | foreach ($commandInfoList as $commandInfo) { |
@@ -3,8 +3,6 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Consolidation\AnnotatedCommand\Hooks\HookManager; |
| 5 | 5 | use Consolidation\AnnotatedCommand\Parser\CommandInfo; |
| 6 | -use Consolidation\OutputFormatters\FormatterManager; |
|
| 7 | -use Consolidation\OutputFormatters\Options\FormatterOptions; |
|
| 8 | 6 | use Consolidation\AnnotatedCommand\Help\HelpDocumentAlter; |
| 9 | 7 | use Symfony\Component\Console\Command\Command; |
| 10 | 8 | use Symfony\Component\Console\Input\InputArgument; |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | namespace Consolidation\AnnotatedCommand\Parser; |
| 3 | 3 | |
| 4 | 4 | use Symfony\Component\Console\Input\InputOption; |
| 5 | -use Consolidation\AnnotatedCommand\Parser\Internal\CommandDocBlockParser; |
|
| 6 | 5 | use Consolidation\AnnotatedCommand\Parser\Internal\CommandDocBlockParserFactory; |
| 7 | 6 | use Consolidation\AnnotatedCommand\AnnotationData; |
| 8 | 7 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | /** |
| 31 | 31 | * @var boolean |
| 32 | 32 | * @var string |
| 33 | - */ |
|
| 33 | + */ |
|
| 34 | 34 | protected $docBlockIsParsed = false; |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -137,6 +137,9 @@ discard block |
||
| 137 | 137 | return filemtime($path) != $cache['mtime']; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | + /** |
|
| 141 | + * @param string $methodName |
|
| 142 | + */ |
|
| 140 | 143 | protected function constructFromClassAndMethod($classNameOrInstance, $methodName) |
| 141 | 144 | { |
| 142 | 145 | $this->otherAnnotations = new AnnotationData(); |
@@ -400,7 +403,7 @@ discard block |
||
| 400 | 403 | /** |
| 401 | 404 | * Return the list of refleaction parameters. |
| 402 | 405 | * |
| 403 | - * @return ReflectionParameter[] |
|
| 406 | + * @return \ReflectionParameter[] |
|
| 404 | 407 | */ |
| 405 | 408 | public function getParameters() |
| 406 | 409 | { |
@@ -540,7 +543,7 @@ discard block |
||
| 540 | 543 | * Examine the parameters of the method for this command, and |
| 541 | 544 | * build a list of commandline arguements for them. |
| 542 | 545 | * |
| 543 | - * @return array |
|
| 546 | + * @return DefaultsWithDescriptions |
|
| 544 | 547 | */ |
| 545 | 548 | protected function determineAgumentClassifications() |
| 546 | 549 | { |
@@ -560,6 +563,7 @@ discard block |
||
| 560 | 563 | * Examine the provided parameter, and determine whether it |
| 561 | 564 | * is a parameter that will be filled in with a positional |
| 562 | 565 | * commandline argument. |
| 566 | + * @param DefaultsWithDescriptions $result |
|
| 563 | 567 | */ |
| 564 | 568 | protected function addParameterToResult($result, $param) |
| 565 | 569 | { |
@@ -650,6 +654,8 @@ discard block |
||
| 650 | 654 | /** |
| 651 | 655 | * Given a list that might be 'a b c' or 'a, b, c' or 'a,b,c', |
| 652 | 656 | * convert the data into the last of these forms. |
| 657 | + * @param string $text |
|
| 658 | + * @return string |
|
| 653 | 659 | */ |
| 654 | 660 | protected static function convertListToCommaSeparated($text) |
| 655 | 661 | { |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | public function replaceRawAnnotations($annotationData) |
| 229 | 229 | { |
| 230 | - $this->otherAnnotations = new AnnotationData((array) $annotationData); |
|
| 230 | + $this->otherAnnotations = new AnnotationData((array)$annotationData); |
|
| 231 | 231 | return $this; |
| 232 | 232 | } |
| 233 | 233 | |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | // Convert to an array and merge if there are multiple |
| 337 | 337 | // instances of the same annotation defined. |
| 338 | 338 | if (isset($this->otherAnnotations[$name])) { |
| 339 | - $content = array_merge((array) $this->otherAnnotations[$name], (array)$content); |
|
| 339 | + $content = array_merge((array)$this->otherAnnotations[$name], (array)$content); |
|
| 340 | 340 | } |
| 341 | 341 | $this->otherAnnotations[$name] = $content; |
| 342 | 342 | } |
@@ -693,8 +693,8 @@ discard block |
||
| 693 | 693 | */ |
| 694 | 694 | protected function convertName($camel) |
| 695 | 695 | { |
| 696 | - $splitter="-"; |
|
| 697 | - $camel=preg_replace('/(?!^)[[:upper:]][[:lower:]]/', '$0', preg_replace('/(?!^)[[:upper:]]+/', $splitter.'$0', $camel)); |
|
| 696 | + $splitter = "-"; |
|
| 697 | + $camel = preg_replace('/(?!^)[[:upper:]][[:lower:]]/', '$0', preg_replace('/(?!^)[[:upper:]]+/', $splitter.'$0', $camel)); |
|
| 698 | 698 | $camel = preg_replace("/$splitter/", ':', $camel, 1); |
| 699 | 699 | return strtolower($camel); |
| 700 | 700 | } |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | protected function getSearchDepth() |
| 249 | 249 | { |
| 250 | - return $this->searchDepth <= 0 ? '== 0' : '<= ' . $this->searchDepth; |
|
| 250 | + return $this->searchDepth <= 0 ? '== 0' : '<= '.$this->searchDepth; |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | /** |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | return $this->joinParts( |
| 342 | 342 | '\\', |
| 343 | 343 | $namespaceParts, |
| 344 | - function ($item) { |
|
| 344 | + function($item) { |
|
| 345 | 345 | return !is_numeric($item) && !empty($item); |
| 346 | 346 | } |
| 347 | 347 | ); |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $path = $this->joinParts( |
| 361 | 361 | '/', |
| 362 | 362 | $pathParts, |
| 363 | - function ($item) { |
|
| 363 | + function($item) { |
|
| 364 | 364 | return !empty($item); |
| 365 | 365 | } |
| 366 | 366 | ); |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | protected function joinParts($delimiter, $parts, $filterFunction) |
| 378 | 378 | { |
| 379 | 379 | $parts = array_map( |
| 380 | - function ($item) use ($delimiter) { |
|
| 380 | + function($item) use ($delimiter) { |
|
| 381 | 381 | return rtrim($item, $delimiter); |
| 382 | 382 | }, |
| 383 | 383 | $parts |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function get($key) |
| 36 | 36 | { |
| 37 | - return (array) $this->dataStore->get($key); |
|
| 37 | + return (array)$this->dataStore->get($key); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | public function __construct($values = [], $defaultDefault = null) |
| 33 | 33 | { |
| 34 | 34 | $this->values = $values; |
| 35 | - $this->hasDefault = array_filter($this->values, function ($value) { |
|
| 35 | + $this->hasDefault = array_filter($this->values, function($value) { |
|
| 36 | 36 | return isset($value); |
| 37 | 37 | }); |
| 38 | 38 | $this->descriptions = []; |