@@ -48,13 +48,13 @@ |
||
48 | 48 | parent::configure($configuration); |
49 | 49 | |
50 | 50 | if ('lower' === $this->configuration['case']) { |
51 | - $this->fixFunction = static function (string $content): string { |
|
51 | + $this->fixFunction = static function(string $content): string { |
|
52 | 52 | return strtolower($content); |
53 | 53 | }; |
54 | 54 | } |
55 | 55 | |
56 | 56 | if ('upper' === $this->configuration['case']) { |
57 | - $this->fixFunction = static function (string $content): string { |
|
57 | + $this->fixFunction = static function(string $content): string { |
|
58 | 58 | return strtoupper($content); |
59 | 59 | }; |
60 | 60 | } |
@@ -75,6 +75,6 @@ |
||
75 | 75 | return; |
76 | 76 | } |
77 | 77 | |
78 | - $tokens[0] = new Token([T_OPEN_TAG, rtrim($tokens[0]->getContent()).$this->whitespacesConfig->getLineEnding()]); |
|
78 | + $tokens[0] = new Token([T_OPEN_TAG, rtrim($tokens[0]->getContent()) . $this->whitespacesConfig->getLineEnding()]); |
|
79 | 79 | } |
80 | 80 | } |
@@ -87,12 +87,12 @@ |
||
87 | 87 | $token = $tokens[0]; |
88 | 88 | |
89 | 89 | if (false === strpos($token->getContent(), "\n")) { |
90 | - $tokens[0] = new Token([$token->getId(), rtrim($token->getContent()).$lineEnding]); |
|
90 | + $tokens[0] = new Token([$token->getId(), rtrim($token->getContent()) . $lineEnding]); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | if (false === strpos($tokens[1]->getContent(), "\n")) { |
94 | 94 | if ($tokens[1]->isWhitespace()) { |
95 | - $tokens[1] = new Token([T_WHITESPACE, $lineEnding.$tokens[1]->getContent()]); |
|
95 | + $tokens[1] = new Token([T_WHITESPACE, $lineEnding . $tokens[1]->getContent()]); |
|
96 | 96 | } else { |
97 | 97 | $tokens->insertAt(1, new Token([T_WHITESPACE, $lineEnding])); |
98 | 98 | } |
@@ -232,7 +232,7 @@ |
||
232 | 232 | continue; |
233 | 233 | } |
234 | 234 | |
235 | - $replaced = Preg::replaceCallback('/[^[:ascii:]]/u', static function (array $matches) { |
|
235 | + $replaced = Preg::replaceCallback('/[^[:ascii:]]/u', static function(array $matches) { |
|
236 | 236 | return self::$replacements[$matches[0]] ?? $matches[0] |
237 | 237 | ; |
238 | 238 | }, $token->getContent(), -1, $count); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | --$previousIndex; |
128 | 128 | } |
129 | 129 | if ($tokens[$previousIndex]->isGivenKind(T_OPEN_TAG)) { |
130 | - $whitespace = Preg::replace('/\S/', '', $tokens[$previousIndex]->getContent()).$whitespace; |
|
130 | + $whitespace = Preg::replace('/\S/', '', $tokens[$previousIndex]->getContent()) . $whitespace; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | if (1 !== Preg::match('/\R(\h*)$/', $whitespace, $matches)) { |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | if (!isset($line[0])) { |
155 | 155 | $line = '*'; |
156 | 156 | } elseif ('*' !== $line[0]) { |
157 | - $line = '* '.$line; |
|
157 | + $line = '* ' . $line; |
|
158 | 158 | } |
159 | 159 | |
160 | - $lines[$lineNumber] = $indentation.' '.$line; |
|
160 | + $lines[$lineNumber] = $indentation . ' ' . $line; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $tokens[$index] = new Token([$token->getId(), implode($lineEnding, $lines)]); |
@@ -118,13 +118,13 @@ |
||
118 | 118 | ? sprintf('(?:%s\s+(?:\$\w+\s+)?)?', preg_quote(implode('|', $annotation->getTypes()), '/')) |
119 | 119 | : ''; |
120 | 120 | $content = Preg::replaceCallback( |
121 | - '/^(\s*\*\s*@\w+\s+'.$optionalTypeRegEx.')(\p{Lu}?(?=\p{Ll}|\p{Zs}))(.*)$/', |
|
122 | - static function (array $matches) { |
|
121 | + '/^(\s*\*\s*@\w+\s+' . $optionalTypeRegEx . ')(\p{Lu}?(?=\p{Ll}|\p{Zs}))(.*)$/', |
|
122 | + static function(array $matches) { |
|
123 | 123 | if (\function_exists('mb_strtolower')) { |
124 | - return $matches[1].mb_strtolower($matches[2]).$matches[3]; |
|
124 | + return $matches[1] . mb_strtolower($matches[2]) . $matches[3]; |
|
125 | 125 | } |
126 | 126 | |
127 | - return $matches[1].strtolower($matches[2]).$matches[3]; |
|
127 | + return $matches[1] . strtolower($matches[2]) . $matches[3]; |
|
128 | 128 | }, |
129 | 129 | $startLine->getContent(), |
130 | 130 | 1 |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | parent::configure($configuration); |
109 | 109 | |
110 | 110 | $this->ignoredTags = array_map( |
111 | - static function ($tag) { |
|
111 | + static function($tag) { |
|
112 | 112 | return strtolower($tag); |
113 | 113 | }, |
114 | 114 | $this->configuration['ignored_tags'] |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
159 | - $tokens[$index] = new Token([T_COMMENT, '/*'.ltrim($token->getContent(), '/*')]); |
|
159 | + $tokens[$index] = new Token([T_COMMENT, '/*' . ltrim($token->getContent(), '/*')]); |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | private function fixDocBlock(string $content, string $indent): string |
128 | 128 | { |
129 | - return ltrim(Preg::replace('/^\h*\*/m', $indent.' *', $content)); |
|
129 | + return ltrim(Preg::replace('/^\h*\*/m', $indent . ' *', $content)); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -137,6 +137,6 @@ discard block |
||
137 | 137 | */ |
138 | 138 | private function fixWhitespaceBeforeDocblock(string $content, string $indent): string |
139 | 139 | { |
140 | - return rtrim($content, " \t").$indent; |
|
140 | + return rtrim($content, " \t") . $indent; |
|
141 | 141 | } |
142 | 142 | } |
@@ -83,16 +83,16 @@ |
||
83 | 83 | { |
84 | 84 | return Preg::replaceCallback( |
85 | 85 | '#^/\*\*\h*@var\h+(\S+)\h*(\$\S+)?\h*([^\n]*)\*/$#', |
86 | - static function (array $matches) { |
|
86 | + static function(array $matches) { |
|
87 | 87 | $content = '/** @var'; |
88 | 88 | |
89 | 89 | for ($i = 1, $m = \count($matches); $i < $m; ++$i) { |
90 | 90 | if ('' !== $matches[$i]) { |
91 | - $content .= ' '.$matches[$i]; |
|
91 | + $content .= ' ' . $matches[$i]; |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | |
95 | - return rtrim($content).' */'; |
|
95 | + return rtrim($content) . ' */'; |
|
96 | 96 | }, |
97 | 97 | $content |
98 | 98 | ); |