@@ -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); |
@@ -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. |
@@ -144,6 +144,9 @@ discard block |
||
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
147 | + /** |
|
148 | + * @param string $description |
|
149 | + */ |
|
147 | 150 | protected function splitOutDefault($description) |
148 | 151 | { |
149 | 152 | if (!preg_match('#(.*)(Default: *)(.*)#', trim($description), $matches)) { |
@@ -283,6 +286,9 @@ discard block |
||
283 | 286 | return !empty($nextLine); |
284 | 287 | } |
285 | 288 | |
289 | + /** |
|
290 | + * @param DocblockTag[] $tags |
|
291 | + */ |
|
286 | 292 | protected function processAllTags($tags) |
287 | 293 | { |
288 | 294 | // Iterate over all of the tags, and process them as necessary. |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | { |
155 | 155 | $replacementPart = '\\'; |
156 | 156 | if (!empty($base)) { |
157 | - $replacementPart .= $base . '\\'; |
|
157 | + $replacementPart .= $base.'\\'; |
|
158 | 158 | } |
159 | - $ignoredPart = $replacementPart . $ignore . '\\'; |
|
159 | + $ignoredPart = $replacementPart.$ignore.'\\'; |
|
160 | 160 | $this->strippedNamespaces[$ignoredPart] = $replacementPart; |
161 | 161 | |
162 | 162 | return $this; |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | // Strip out any part of the namespace the client did not want. |
260 | 260 | // @see CommandFileDiscovery::ignoreNamespacePart |
261 | 261 | return array_map( |
262 | - function ($fqcn) { |
|
262 | + function($fqcn) { |
|
263 | 263 | return str_replace( |
264 | 264 | array_keys($this->strippedNamespaces), |
265 | 265 | array_values($this->strippedNamespaces), |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | */ |
322 | 322 | protected function getSearchDepth() |
323 | 323 | { |
324 | - return $this->searchDepth <= 0 ? '== 0' : '<= ' . $this->searchDepth; |
|
324 | + return $this->searchDepth <= 0 ? '== 0' : '<= '.$this->searchDepth; |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | /** |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | return $this->joinParts( |
420 | 420 | '\\', |
421 | 421 | $namespaceParts, |
422 | - function ($item) { |
|
422 | + function($item) { |
|
423 | 423 | return !is_numeric($item) && !empty($item); |
424 | 424 | } |
425 | 425 | ); |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | $path = $this->joinParts( |
439 | 439 | '/', |
440 | 440 | $pathParts, |
441 | - function ($item) { |
|
441 | + function($item) { |
|
442 | 442 | return !empty($item); |
443 | 443 | } |
444 | 444 | ); |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | protected function joinParts($delimiter, $parts, $filterFunction) |
456 | 456 | { |
457 | 457 | $parts = array_map( |
458 | - function ($item) use ($delimiter) { |
|
458 | + function($item) use ($delimiter) { |
|
459 | 459 | return rtrim($item, $delimiter); |
460 | 460 | }, |
461 | 461 | $parts |
@@ -64,6 +64,9 @@ |
||
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
67 | + /** |
|
68 | + * @param Command $command |
|
69 | + */ |
|
67 | 70 | public function findAndAddHookOptions($command) |
68 | 71 | { |
69 | 72 | if (!$command instanceof AnnotatedCommand) { |
@@ -39,6 +39,9 @@ |
||
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
42 | + /** |
|
43 | + * @param callable $determiner |
|
44 | + */ |
|
42 | 45 | protected function callDeterminer($determiner, $result) |
43 | 46 | { |
44 | 47 | if ($determiner instanceof StatusDeterminerInterface) { |
@@ -210,6 +210,9 @@ |
||
210 | 210 | return !empty($path) && ($path != '-'); |
211 | 211 | } |
212 | 212 | |
213 | + /** |
|
214 | + * @param string $optionOrArg |
|
215 | + */ |
|
213 | 216 | protected function getOptionOrArg(InputInterface $input, $optionOrArg) |
214 | 217 | { |
215 | 218 | if ($input->hasOption($optionOrArg)) { |
@@ -37,7 +37,7 @@ |
||
37 | 37 | if (is_array($data)) { |
38 | 38 | $this->offsetSet($key, array_merge($data, $value)); |
39 | 39 | } elseif (is_scalar($data)) { |
40 | - $this->offsetSet($key, $data . $value); |
|
40 | + $this->offsetSet($key, $data.$value); |
|
41 | 41 | } |
42 | 42 | return $this; |
43 | 43 | } |
@@ -13,11 +13,17 @@ |
||
13 | 13 | $this->register('Symfony\Component\Console\Output\OutputInterface', $this); |
14 | 14 | } |
15 | 15 | |
16 | + /** |
|
17 | + * @param string $interfaceName |
|
18 | + */ |
|
16 | 19 | public function register($interfaceName, ParameterInjector $injector) |
17 | 20 | { |
18 | 21 | $this->injectors[$interfaceName] = $injector; |
19 | 22 | } |
20 | 23 | |
24 | + /** |
|
25 | + * @param CommandData $commandData |
|
26 | + */ |
|
21 | 27 | public function args($commandData) |
22 | 28 | { |
23 | 29 | return array_merge( |