@@ -21,6 +21,9 @@ |
||
| 21 | 21 | $this->tags = []; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param string $line |
|
| 26 | + */ |
|
| 24 | 27 | public function parseLine($line) |
| 25 | 28 | { |
| 26 | 29 | if (DocblockTag::isTag($line)) { |
@@ -230,6 +230,9 @@ |
||
| 230 | 230 | return !empty($nextLine); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | + /** |
|
| 234 | + * @param DocblockTag[] $tags |
|
| 235 | + */ |
|
| 233 | 236 | protected function processAllTags($tags) |
| 234 | 237 | { |
| 235 | 238 | // Iterate over all of the tags, and process them as necessary. |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | protected function processCommandTag($tag) |
| 63 | 63 | { |
| 64 | 64 | if (!$tag->hasWordAndDescription($matches)) { |
| 65 | - throw new \Exception('Could not determine command name from tag ' . (string)$tag); |
|
| 65 | + throw new \Exception('Could not determine command name from tag '.(string)$tag); |
|
| 66 | 66 | } |
| 67 | 67 | $commandName = $matches['word']; |
| 68 | 68 | $this->commandInfo->setName($commandName); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | protected function processArgumentTag($tag) |
| 90 | 90 | { |
| 91 | 91 | if (!$tag->hasVariable($matches)) { |
| 92 | - throw new \Exception('Could not determine argument name from tag ' . (string)$tag); |
|
| 92 | + throw new \Exception('Could not determine argument name from tag '.(string)$tag); |
|
| 93 | 93 | } |
| 94 | 94 | if ($matches['variable'] == $this->optionParamName()) { |
| 95 | 95 | return; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | protected function processOptionTag($tag) |
| 104 | 104 | { |
| 105 | 105 | if (!$tag->hasVariable($matches)) { |
| 106 | - throw new \Exception('Could not determine option name from tag ' . (string)$tag); |
|
| 106 | + throw new \Exception('Could not determine option name from tag '.(string)$tag); |
|
| 107 | 107 | } |
| 108 | 108 | $this->addOptionOrArgumentTag($tag, $this->commandInfo->options(), $matches['variable'], $matches['description']); |
| 109 | 109 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | protected function processDefaultTag($tag) |
| 123 | 123 | { |
| 124 | 124 | if (!$tag->hasVariable($matches)) { |
| 125 | - throw new \Exception('Could not determine parameter name for default value from tag ' . (string)$tag); |
|
| 125 | + throw new \Exception('Could not determine parameter name for default value from tag '.(string)$tag); |
|
| 126 | 126 | } |
| 127 | 127 | $variableName = $matches['variable']; |
| 128 | 128 | $defaultValue = $this->interpretDefaultValue($matches['description']); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | { |
| 144 | 144 | $lines = explode("\n", $tag->getContent()); |
| 145 | 145 | $usage = trim(array_shift($lines)); |
| 146 | - $description = static::removeLineBreaks(implode("\n", array_map(function ($line) { |
|
| 146 | + $description = static::removeLineBreaks(implode("\n", array_map(function($line) { |
|
| 147 | 147 | return trim($line); |
| 148 | 148 | }, $lines))); |
| 149 | 149 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | // The return type might be a variable -- '$this'. It will |
| 167 | 167 | // usually be a type, like RowsOfFields, or \Namespace\RowsOfFields. |
| 168 | 168 | if (!$tag->hasVariableAndDescription($matches)) { |
| 169 | - throw new \Exception('Could not determine return type from tag ' . (string)$tag); |
|
| 169 | + throw new \Exception('Could not determine return type from tag '.(string)$tag); |
|
| 170 | 170 | } |
| 171 | 171 | // Look at namespace and `use` statments to make returnType a fqdn |
| 172 | 172 | $returnType = $matches['variable']; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | // Trim all of the lines individually. |
| 217 | 217 | $lines = |
| 218 | 218 | array_map( |
| 219 | - function ($line) { |
|
| 219 | + function($line) { |
|
| 220 | 220 | return trim($line); |
| 221 | 221 | }, |
| 222 | 222 | $lines |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | // Everything up to the first blank line goes in the description. |
| 226 | 226 | $description = array_shift($lines); |
| 227 | 227 | while ($this->nextLineIsNotEmpty($lines)) { |
| 228 | - $description .= ' ' . array_shift($lines); |
|
| 228 | + $description .= ' '.array_shift($lines); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | // Everything else goes in the help. |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | // If there is no 'use' statement for the className, then |
| 36 | 36 | // generate an effective classname from the namespace |
| 37 | 37 | if (!isset($this->classCache[$filename][$className])) { |
| 38 | - $this->classCache[$filename][$className] = $namespaceName . '\\' . $className; |
|
| 38 | + $this->classCache[$filename][$className] = $namespaceName.'\\'.$className; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | fclose($handle); |
@@ -151,8 +151,8 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | public function ignoreNamespacePart($base, $ignore) |
| 153 | 153 | { |
| 154 | - $replacementPart = '\\' . $base . '\\'; |
|
| 155 | - $ignoredPart = $replacementPart . $ignore . '\\'; |
|
| 154 | + $replacementPart = '\\'.$base.'\\'; |
|
| 155 | + $ignoredPart = $replacementPart.$ignore.'\\'; |
|
| 156 | 156 | $this->strippedNamespaces[$ignoredPart] = $replacementPart; |
| 157 | 157 | |
| 158 | 158 | return $this; |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | // Strip out any part of the namespace the client did not want. |
| 256 | 256 | // @see CommandFileDiscovery::ignoreNamespacePart |
| 257 | 257 | return array_map( |
| 258 | - function ($fqcn) { |
|
| 258 | + function($fqcn) { |
|
| 259 | 259 | return str_replace( |
| 260 | 260 | array_keys($this->strippedNamespaces), |
| 261 | 261 | array_values($this->strippedNamespaces), |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | protected function getSearchDepth() |
| 319 | 319 | { |
| 320 | - return $this->searchDepth <= 0 ? '== 0' : '<= ' . $this->searchDepth; |
|
| 320 | + return $this->searchDepth <= 0 ? '== 0' : '<= '.$this->searchDepth; |
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /** |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | return $this->joinParts( |
| 416 | 416 | '\\', |
| 417 | 417 | $namespaceParts, |
| 418 | - function ($item) { |
|
| 418 | + function($item) { |
|
| 419 | 419 | return !is_numeric($item) && !empty($item); |
| 420 | 420 | } |
| 421 | 421 | ); |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | $path = $this->joinParts( |
| 435 | 435 | '/', |
| 436 | 436 | $pathParts, |
| 437 | - function ($item) { |
|
| 437 | + function($item) { |
|
| 438 | 438 | return !empty($item); |
| 439 | 439 | } |
| 440 | 440 | ); |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | protected function joinParts($delimiter, $parts, $filterFunction) |
| 452 | 452 | { |
| 453 | 453 | $parts = array_map( |
| 454 | - function ($item) use ($delimiter) { |
|
| 454 | + function($item) use ($delimiter) { |
|
| 455 | 455 | return rtrim($item, $delimiter); |
| 456 | 456 | }, |
| 457 | 457 | $parts |