@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * Check if the provided string begins with a tag |
| 31 | 31 | * @param string $subject |
| 32 | - * @return bool |
|
| 32 | + * @return integer |
|
| 33 | 33 | */ |
| 34 | 34 | public static function isTag($subject) |
| 35 | 35 | { |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @param string $subject |
| 43 | 43 | * @param string[] &$matches Sets $matches['tag'] and $matches['description'] |
| 44 | - * @return bool |
|
| 44 | + * @return integer |
|
| 45 | 45 | */ |
| 46 | 46 | public static function splitTagAndContent($subject, &$matches) |
| 47 | 47 | { |
@@ -101,7 +101,6 @@ discard block |
||
| 101 | 101 | * - "@tag $variable description" |
| 102 | 102 | * - "@tag type $variable description" |
| 103 | 103 | * |
| 104 | - * @param string $subject |
|
| 105 | 104 | * @param string[] &$matches Sets $matches['variable'] and |
| 106 | 105 | * $matches['description']; might set $matches['type']. |
| 107 | 106 | * @return bool |
@@ -115,10 +114,9 @@ discard block |
||
| 115 | 114 | |
| 116 | 115 | /** |
| 117 | 116 | * Determine if tag is "@tag $variable description" |
| 118 | - * @param string $subject |
|
| 119 | 117 | * @param string[] &$matches Sets $matches['variable'] and |
| 120 | 118 | * $matches['description'] |
| 121 | - * @return bool |
|
| 119 | + * @return integer |
|
| 122 | 120 | */ |
| 123 | 121 | public function hasVariableAndDescription(&$matches) |
| 124 | 122 | { |
@@ -129,10 +127,9 @@ discard block |
||
| 129 | 127 | /** |
| 130 | 128 | * Determine if tag is "@tag type $variable description" |
| 131 | 129 | * |
| 132 | - * @param string $subject |
|
| 133 | 130 | * @param string[] &$matches Sets $matches['variable'], |
| 134 | 131 | * $matches['description'] and $matches['type']. |
| 135 | - * @return bool |
|
| 132 | + * @return integer |
|
| 136 | 133 | */ |
| 137 | 134 | public function hasTypeVariableAndDescription(&$matches) |
| 138 | 135 | { |
@@ -142,10 +139,9 @@ discard block |
||
| 142 | 139 | |
| 143 | 140 | /** |
| 144 | 141 | * Determine if tag is "@tag word description" |
| 145 | - * @param string $subject |
|
| 146 | 142 | * @param string[] &$matches Sets $matches['word'] and |
| 147 | 143 | * $matches['description'] |
| 148 | - * @return bool |
|
| 144 | + * @return integer |
|
| 149 | 145 | */ |
| 150 | 146 | public function hasWordAndDescription(&$matches) |
| 151 | 147 | { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public static function splitTagAndContent($subject, &$matches) |
| 47 | 47 | { |
| 48 | - $regex = '/' . self::TAG_REGEX . self::DESCRIPTION_REGEX . '/s'; |
|
| 48 | + $regex = '/'.self::TAG_REGEX.self::DESCRIPTION_REGEX.'/s'; |
|
| 49 | 49 | return preg_match($regex, $subject, $matches); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function __toString() |
| 94 | 94 | { |
| 95 | - return '@' . $this->getTag() . ' ' . $this->getContent(); |
|
| 95 | + return '@'.$this->getTag().' '.$this->getContent(); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function hasVariableAndDescription(&$matches) |
| 124 | 124 | { |
| 125 | - $regex = '/^\s*' . self::VARIABLE_OR_WORD_REGEX . self::DESCRIPTION_REGEX . '/s'; |
|
| 125 | + $regex = '/^\s*'.self::VARIABLE_OR_WORD_REGEX.self::DESCRIPTION_REGEX.'/s'; |
|
| 126 | 126 | return preg_match($regex, $this->getContent(), $matches); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function hasTypeVariableAndDescription(&$matches) |
| 138 | 138 | { |
| 139 | - $regex = '/^\s*' . self::TYPE_REGEX . self::VARIABLE_REGEX . self::DESCRIPTION_REGEX . '/s'; |
|
| 139 | + $regex = '/^\s*'.self::TYPE_REGEX.self::VARIABLE_REGEX.self::DESCRIPTION_REGEX.'/s'; |
|
| 140 | 140 | return preg_match($regex, $this->getContent(), $matches); |
| 141 | 141 | } |
| 142 | 142 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public function hasWordAndDescription(&$matches) |
| 151 | 151 | { |
| 152 | - $regex = '/^\s*' . self::WORD_REGEX . self::DESCRIPTION_REGEX . '/s'; |
|
| 152 | + $regex = '/^\s*'.self::WORD_REGEX.self::DESCRIPTION_REGEX.'/s'; |
|
| 153 | 153 | return preg_match($regex, $this->getContent(), $matches); |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -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); |