@@ -127,7 +127,7 @@ |
||
127 | 127 | |
128 | 128 | $this->file->fixer->addContent( |
129 | 129 | $position, |
130 | - $this->file->getEolChar() . str_repeat(' ', $token['level']) . ' *' |
|
130 | + $this->file->getEolChar().str_repeat(' ', $token['level']).' *' |
|
131 | 131 | ); |
132 | 132 | |
133 | 133 | $this->file->fixer->endChangeset(); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @var string |
38 | 38 | */ |
39 | - private const WARNING_MULTIPLE_RETURNS_FOUND = 'Multiple returns detected. Did you refactor your method? Please ' . |
|
39 | + private const WARNING_MULTIPLE_RETURNS_FOUND = 'Multiple returns detected. Did you refactor your method? Please '. |
|
40 | 40 | 'do not use an early return if your method/function still is cluttered.'; |
41 | 41 | |
42 | 42 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $this->token['scope_closer'] |
66 | 66 | ); |
67 | 67 | |
68 | - return array_filter($returnPositions, function (int $returnPos): bool { |
|
68 | + return array_filter($returnPositions, function(int $returnPos): bool { |
|
69 | 69 | $possibleClosure = $this->file->findPrevious([T_CLOSURE, T_FUNCTION], $returnPos - 1, $this->stackPos); |
70 | 70 | |
71 | 71 | return $possibleClosure === $this->stackPos; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | if (count($returnPositions) > 1) { |
85 | 85 | array_shift($returnPositions); |
86 | 86 | |
87 | - array_walk($returnPositions, function (int $returnPos): void { |
|
87 | + array_walk($returnPositions, function(int $returnPos): void { |
|
88 | 88 | $this->file->addWarning( |
89 | 89 | self::WARNING_MULTIPLE_RETURNS_FOUND, |
90 | 90 | $returnPos, |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @var string |
96 | 96 | */ |
97 | - private const MESSAGE_TAG_MIXED_TYPE = 'We suggest that you avoid the "mixed" type and declare the ' . |
|
97 | + private const MESSAGE_TAG_MIXED_TYPE = 'We suggest that you avoid the "mixed" type and declare the '. |
|
98 | 98 | 'required types in detail.'; |
99 | 99 | |
100 | 100 | /** |
@@ -195,13 +195,13 @@ discard block |
||
195 | 195 | $this->stackPos - 1 |
196 | 196 | ); |
197 | 197 | |
198 | - $tagPosBeforeThis = array_filter($tagPosBeforeThis, function (int $position) { |
|
198 | + $tagPosBeforeThis = array_filter($tagPosBeforeThis, function(int $position) { |
|
199 | 199 | return $this->tokens[$position]['content'] === '@param'; |
200 | 200 | }); |
201 | 201 | |
202 | 202 | $varOfThisTag = array_values($this->varTokens)[count($tagPosBeforeThis)]; |
203 | 203 | |
204 | - return '/(?P<type>[\w|\|\[\]]*) ?(?P<var>' . preg_quote($varOfThisTag['content'], '/') . |
|
204 | + return '/(?P<type>[\w|\|\[\]]*) ?(?P<var>'.preg_quote($varOfThisTag['content'], '/'). |
|
205 | 205 | ') ?(?P<desc>.*)/m'; |
206 | 206 | } |
207 | 207 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | ->setToken($this->token); |
222 | 222 | } |
223 | 223 | |
224 | - $this->varTokens = array_filter($this->tokens, function (array $token) use ($varPositions): bool { |
|
224 | + $this->varTokens = array_filter($this->tokens, function(array $token) use ($varPositions): bool { |
|
225 | 225 | return in_array($token['pointer'], $varPositions, true); |
226 | 226 | }); |
227 | 227 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * |
44 | 44 | * @var string |
45 | 45 | */ |
46 | - private const MESSAGE_TAG_MIXED_TYPE = 'We suggest that you avoid the "mixed" type and declare the ' . |
|
46 | + private const MESSAGE_TAG_MIXED_TYPE = 'We suggest that you avoid the "mixed" type and declare the '. |
|
47 | 47 | 'required types in detail.'; |
48 | 48 | |
49 | 49 | /** |
@@ -328,7 +328,7 @@ |
||
328 | 328 | ); |
329 | 329 | |
330 | 330 | if ($sniffName) { |
331 | - $sniffFQCN .= '.' . $sniffName; |
|
331 | + $sniffFQCN .= '.'.$sniffName; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | return $sniffFQCN; |
@@ -105,12 +105,12 @@ discard block |
||
105 | 105 | $file->fixer->beginChangeset(); |
106 | 106 | |
107 | 107 | if ($this->isCustomArrayType($returnTypeHint)) { |
108 | - $returnTypeHint = ($returnTypeHint[0] === '?' ? '?' : '') . 'array'; |
|
108 | + $returnTypeHint = ($returnTypeHint[0] === '?' ? '?' : '').'array'; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | $file->fixer->addContent( |
112 | 112 | $this->token['parenthesis_closer'], |
113 | - ': ' . $returnTypeHint |
|
113 | + ': '.$returnTypeHint |
|
114 | 114 | ); |
115 | 115 | |
116 | 116 | $file->fixer->endChangeset(); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | // We add the question mark if there is a nullable type. |
148 | 148 | if (in_array($type, self::NULL_TYPES, true) && ($typeCount > 1)) { |
149 | - $returnTypeHint = '?' . $returnTypeHint; |
|
149 | + $returnTypeHint = '?'.$returnTypeHint; |
|
150 | 150 | continue; // We still need this continue to prevent further execution of the questionmark. |
151 | 151 | } |
152 | 152 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | */ |
289 | 289 | private function loadFixableTypes(?array $returnTypes): array |
290 | 290 | { |
291 | - return array_filter($returnTypes ?? [], function (string $returnType): bool { |
|
291 | + return array_filter($returnTypes ?? [], function(string $returnType): bool { |
|
292 | 292 | return $this->isFixableReturnType($returnType); |
293 | 293 | }); |
294 | 294 | } |