@@ -232,7 +232,7 @@ |
||
232 | 232 | * @param string $rule |
233 | 233 | * @param string $tag |
234 | 234 | * |
235 | - * @return bool|string |
|
235 | + * @return string|false |
|
236 | 236 | */ |
237 | 237 | private function hasFixCallback(string $rule, string $tag) |
238 | 238 | { |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | /** |
152 | 152 | * The callback to sort tokens. |
153 | 153 | * |
154 | - * 1. @return goes to the bottom |
|
154 | + * 1. @return integer to the bottom |
|
155 | 155 | * 2. Single tags are group alphabetically in the top group. |
156 | 156 | * 3. Groups are sorted then by occurrence, that the largest group is the last one before the return. |
157 | 157 | * 4. Same annotations are kept in the order of their code. |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @param array $rightToken Provided by usort. |
161 | 161 | * @param array $tagCounts Saves the occurence count for every tag. |
162 | 162 | * |
163 | - * @return int |
|
163 | + * @return integer |
|
164 | 164 | */ |
165 | 165 | private function compareTokensForSorting(array $leftToken, array $rightToken, array $tagCounts): int |
166 | 166 | { |
@@ -230,27 +230,27 @@ discard block |
||
230 | 230 | |
231 | 231 | // Insert new line between groups. |
232 | 232 | if ($isGroupSwitch) { |
233 | - $newContent .= $lineStartingPadding . '*' . $eolChar; |
|
233 | + $newContent .= $lineStartingPadding.'*'.$eolChar; |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | // Create the new Tag. |
237 | 237 | // WARNING We do not need a line break in the tag summary. |
238 | - $newContent .= $lineStartingPadding . '* ' . trim($thisTagContent); |
|
238 | + $newContent .= $lineStartingPadding.'* '.trim($thisTagContent); |
|
239 | 239 | |
240 | 240 | if ($tag['contents']) { |
241 | 241 | $prevLine = $tag['line']; |
242 | 242 | foreach ($tag['contents'] as $subToken) { |
243 | 243 | // If we have a line switch, we need to create the correct indentation from before ... |
244 | 244 | if ($withLineSwitch = $subToken['line'] > $prevLine) { |
245 | - $newContent .= $eolChar . |
|
246 | - $lineStartingPadding . '*' . |
|
245 | + $newContent .= $eolChar. |
|
246 | + $lineStartingPadding.'*'. |
|
247 | 247 | str_repeat(' ', $subToken['column'] - strlen($lineStartingPadding) - 2); |
248 | 248 | |
249 | 249 | $prevLine = $subToken['line']; |
250 | 250 | } |
251 | 251 | |
252 | 252 | // ... if we have no line switch, then an additional whitespace is enough. |
253 | - $newContent .= ($withLineSwitch ? '' : ' ') . $subToken['content']; |
|
253 | + $newContent .= ($withLineSwitch ? '' : ' ').$subToken['content']; |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $withReturn = $isReturn; |
261 | 261 | } |
262 | 262 | |
263 | - $newContent .= $lineStartingPadding . '*/' . $eolChar; |
|
263 | + $newContent .= $lineStartingPadding.'*/'.$eolChar; |
|
264 | 264 | |
265 | 265 | return $newContent; |
266 | 266 | } |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | $fixer->addContentBefore( |
334 | 334 | $token['pointer'], |
335 | - $this->file->getEolChar() . $lineStartPadding . '* ' |
|
335 | + $this->file->getEolChar().$lineStartPadding.'* ' |
|
336 | 336 | ); |
337 | 337 | |
338 | 338 | $fixer->endChangeset(); |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $barrier = 0; |
349 | 349 | $tokens = $this->docTagHelper->getTagTokens(); |
350 | 350 | |
351 | - $tokens = array_filter($tokens, function (array $token) use (&$barrier): bool { |
|
351 | + $tokens = array_filter($tokens, function(array $token) use (&$barrier): bool { |
|
352 | 352 | $allowed = true; |
353 | 353 | |
354 | 354 | if ($barrier) { |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | { |
444 | 444 | $tagCounts = $this->docTagHelper->getTagCounts($tokens); |
445 | 445 | |
446 | - usort($tokens, function (array $leftToken, array $rightToken) use ($tagCounts): int { |
|
446 | + usort($tokens, function(array $leftToken, array $rightToken) use ($tagCounts): int { |
|
447 | 447 | return $this->compareTokensForSorting($leftToken, $rightToken, $tagCounts); |
448 | 448 | }); |
449 | 449 |
@@ -104,7 +104,7 @@ |
||
104 | 104 | $commaPointers = TokenHelper::findNextAll($file, T_COMMA, $usePos + 1, $endPos); |
105 | 105 | foreach ($commaPointers as $commaPos) { |
106 | 106 | $pointerAfterComma = TokenHelper::findNextEffective($file, $commaPos + 1); |
107 | - $fixer->replaceToken($commaPos, ';' . $file->eolChar . $indentation . 'use '); |
|
107 | + $fixer->replaceToken($commaPos, ';'.$file->eolChar.$indentation.'use '); |
|
108 | 108 | for ($i = $commaPos + 1; $i < $pointerAfterComma; $i++) { |
109 | 109 | $fixer->replaceToken($i, ''); |
110 | 110 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | return implode( |
200 | 200 | $file->eolChar, |
201 | 201 | array_map( |
202 | - function (UseStatement $useStatement) use ($file): string { |
|
202 | + function(UseStatement $useStatement) use ($file): string { |
|
203 | 203 | $unqualifiedName = NamespaceHelper::getUnqualifiedNameFromFullyQualifiedName( |
204 | 204 | $useStatement->getFullyQualifiedTypeName() |
205 | 205 | ); |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | */ |
302 | 302 | private function sortUseStatements(): void |
303 | 303 | { |
304 | - uasort($this->useStatements, function (UseStatement $prevStatement, UseStatement $nextStatement) { |
|
304 | + uasort($this->useStatements, function(UseStatement $prevStatement, UseStatement $nextStatement) { |
|
305 | 305 | return $this->compareUseStatements($prevStatement, $nextStatement); |
306 | 306 | }); |
307 | 307 | } |