@@ -22,7 +22,7 @@ |
||
| 22 | 22 | /** |
| 23 | 23 | * The message for the error. |
| 24 | 24 | */ |
| 25 | - private const MESSAGE_TAG_MISSING_DATES = 'Please provide the version since when its deprecated and when it will ' . |
|
| 25 | + private const MESSAGE_TAG_MISSING_DATES = 'Please provide the version since when its deprecated and when it will '. |
|
| 26 | 26 | 'be removed (Pattern: %s).'; |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | /** |
| 75 | 75 | * The message for the mixed type warning. |
| 76 | 76 | */ |
| 77 | - private const MESSAGE_TAG_MIXED_TYPE = 'We suggest that you avoid the "mixed" type and declare the ' . |
|
| 77 | + private const MESSAGE_TAG_MIXED_TYPE = 'We suggest that you avoid the "mixed" type and declare the '. |
|
| 78 | 78 | 'required types in detail.'; |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | { |
| 198 | 198 | $varOfThisTag = $this->getArgumentTokenOfTag(); |
| 199 | 199 | |
| 200 | - return '/(?P<type>[\w|\|\[\]]*) ?(?P<var>' . preg_quote($varOfThisTag['content'], '/') . |
|
| 200 | + return '/(?P<type>[\w|\|\[\]]*) ?(?P<var>'.preg_quote($varOfThisTag['content'], '/'). |
|
| 201 | 201 | ') ?(?P<desc>.*)/m'; |
| 202 | 202 | } |
| 203 | 203 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | ))->setToken($this->token); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - $this->varTokens = array_filter($this->tokens, function (array $token) use ($varPositions): bool { |
|
| 237 | + $this->varTokens = array_filter($this->tokens, function(array $token) use ($varPositions): bool { |
|
| 238 | 238 | return in_array($token['pointer'], $varPositions, true); |
| 239 | 239 | }); |
| 240 | 240 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $this->stackPos - 1 |
| 257 | 257 | ); |
| 258 | 258 | |
| 259 | - $tagPosBeforeThis = array_filter($tagPosBeforeThis, function (int $position) { |
|
| 259 | + $tagPosBeforeThis = array_filter($tagPosBeforeThis, function(int $position) { |
|
| 260 | 260 | return $this->tokens[$position]['content'] === '@param'; |
| 261 | 261 | }); |
| 262 | 262 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * Error message for multiple returns. |
| 34 | 34 | */ |
| 35 | - private const WARNING_MULTIPLE_RETURNS_FOUND = 'Multiple returns detected. Did you refactor your method? Please ' . |
|
| 35 | + private const WARNING_MULTIPLE_RETURNS_FOUND = 'Multiple returns detected. Did you refactor your method? Please '. |
|
| 36 | 36 | 'do not use an early return if your method/function still is cluttered.'; |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $this->token['scope_closer'] |
| 62 | 62 | ); |
| 63 | 63 | |
| 64 | - return array_filter($returnPositions, function (int $returnPos): bool { |
|
| 64 | + return array_filter($returnPositions, function(int $returnPos): bool { |
|
| 65 | 65 | $possibleClosure = $this->file->findPrevious([T_CLOSURE, T_FUNCTION], $returnPos - 1, $this->stackPos); |
| 66 | 66 | |
| 67 | 67 | return $possibleClosure === $this->stackPos; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | if (count($returnPositions) > 1) { |
| 81 | 81 | array_shift($returnPositions); |
| 82 | 82 | |
| 83 | - array_walk($returnPositions, function (int $returnPos): void { |
|
| 83 | + array_walk($returnPositions, function(int $returnPos): void { |
|
| 84 | 84 | $this->file->addWarning( |
| 85 | 85 | self::WARNING_MULTIPLE_RETURNS_FOUND, |
| 86 | 86 | $returnPos, |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | /** |
| 88 | 88 | * Loads the tokens for the positions. |
| 89 | 89 | * |
| 90 | - * @param array $subTokenPoss |
|
| 90 | + * @param integer[] $subTokenPoss |
|
| 91 | 91 | * |
| 92 | 92 | * @return array |
| 93 | 93 | */ |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * |
| 43 | 43 | * @var string |
| 44 | 44 | */ |
| 45 | - private const MESSAGE_WRONG_POSITION = 'Your php structure is at a wrong position. ' . |
|
| 45 | + private const MESSAGE_WRONG_POSITION = 'Your php structure is at a wrong position. '. |
|
| 46 | 46 | 'The sorting order is: T_USE, T_CONST, T_VARIABLE, T_FUNCTION. We expect a %s (%s).'; |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | private function loadTokensForPositions(array $subTokenPoss): array |
| 95 | 95 | { |
| 96 | - $subTokens = array_map(function (int $position): array { |
|
| 96 | + $subTokens = array_map(function(int $position): array { |
|
| 97 | 97 | return $this->tokens[$position]; |
| 98 | 98 | }, $subTokenPoss); |
| 99 | 99 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | private function removeUnwantedTokens(array $subTokens): array |
| 124 | 124 | { |
| 125 | - return array_filter($subTokens, function (array $subToken): bool { |
|
| 125 | + return array_filter($subTokens, function(array $subToken): bool { |
|
| 126 | 126 | switch ($subToken['code']) { |
| 127 | 127 | case T_VARIABLE: |
| 128 | 128 | $return = (new PropertyHelper($this->file))->isProperty($subToken['pointer']); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | private function sortTokens(array $subTokens): array |
| 163 | 163 | { |
| 164 | - uasort($subTokens, function (array $leftToken, array $rightToken): int { |
|
| 164 | + uasort($subTokens, function(array $leftToken, array $rightToken): int { |
|
| 165 | 165 | // Don't change the structure by default. |
| 166 | 166 | $return = $leftToken['line'] <=> $rightToken['line']; |
| 167 | 167 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | /** |
| 36 | 36 | * The message for the mixed type warning. |
| 37 | 37 | */ |
| 38 | - private const MESSAGE_MIXED_TYPE = 'We suggest that you avoid the "mixed" type and declare the ' . |
|
| 38 | + private const MESSAGE_MIXED_TYPE = 'We suggest that you avoid the "mixed" type and declare the '. |
|
| 39 | 39 | 'required types in detail.'; |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | if ($sniffName) { |
| 48 | - $sniffClassName .= '.' . $sniffName; |
|
| 48 | + $sniffClassName .= '.'.$sniffName; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | return $sniffClassName; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | private function checkForFluentSetterErrors(File $phpcsFile, int $functionPos, int $classPos): void |
| 95 | 95 | { |
| 96 | 96 | $tokens = $phpcsFile->getTokens(); |
| 97 | - $errorData = $phpcsFile->getDeclarationName($classPos) . '::' . $phpcsFile->getDeclarationName($functionPos); |
|
| 97 | + $errorData = $phpcsFile->getDeclarationName($classPos).'::'.$phpcsFile->getDeclarationName($functionPos); |
|
| 98 | 98 | |
| 99 | 99 | $functionToken = $tokens[$functionPos]; |
| 100 | 100 | $openBracePtr = $functionToken['scope_opener']; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | ); |
| 137 | 137 | |
| 138 | 138 | if ($sniffName) { |
| 139 | - $sniffClassName .= '.' . $sniffName; |
|
| 139 | + $sniffClassName .= '.'.$sniffName; |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | return $sniffClassName; |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | $phpcsFile->fixer->beginChangeset(); |
| 216 | 216 | $phpcsFile->fixer->addNewlineBefore($closingBracePtr - 1); |
| 217 | - $phpcsFile->fixer->addContentBefore($closingBracePtr - 1, $expectedReturnSpaces . 'return $this;'); |
|
| 217 | + $phpcsFile->fixer->addContentBefore($closingBracePtr - 1, $expectedReturnSpaces.'return $this;'); |
|
| 218 | 218 | $phpcsFile->fixer->addNewlineBefore($closingBracePtr - 1); |
| 219 | 219 | $phpcsFile->fixer->endChangeset(); |
| 220 | 220 | } |