@@ -267,7 +267,7 @@ |
||
267 | 267 | $type = substr($content, 3); |
268 | 268 | |
269 | 269 | $tokens[$assertCall['index']] = new Token([T_STRING, $isPositive ? 'assertInternalType' : 'assertNotInternalType']); |
270 | - $tokens[$testIndex] = new Token([T_CONSTANT_ENCAPSED_STRING, "'".$type."'"]); |
|
270 | + $tokens[$testIndex] = new Token([T_CONSTANT_ENCAPSED_STRING, "'" . $type . "'"]); |
|
271 | 271 | $tokens[$testOpenIndex] = new Token(','); |
272 | 272 | |
273 | 273 | $tokens->clearTokenAndMergeSurroundingWhitespace($testCloseIndex); |
@@ -105,7 +105,7 @@ |
||
105 | 105 | |
106 | 106 | $token->setContent(Preg::replace( |
107 | 107 | '/(\n( +\*)?) *$/', |
108 | - '$1'.str_repeat(' ', 4 * ($indentLevel + $extraIndentLevel) + 1), |
|
108 | + '$1' . str_repeat(' ', 4 * ($indentLevel + $extraIndentLevel) + 1), |
|
109 | 109 | $token->getContent() |
110 | 110 | )); |
111 | 111 |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | // Remove new lines in opening token |
78 | 78 | if ($newlineInOpening) { |
79 | - $tokens[$openingTokenIndex] = new Token([T_OPEN_TAG, rtrim($openingToken->getContent()).' ']); |
|
79 | + $tokens[$openingTokenIndex] = new Token([T_OPEN_TAG, rtrim($openingToken->getContent()) . ' ']); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | return; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if (null !== $openingToken) { |
88 | 88 | // Use the configured line ending for the PHP opening tag |
89 | 89 | $content = rtrim($openingToken->getContent()); |
90 | - $newContent = $content.$lineEnding; |
|
90 | + $newContent = $content . $lineEnding; |
|
91 | 91 | $tokens[$openingTokenIndex] = new Token([T_OPEN_TAG, $newContent]); |
92 | 92 | --$newlinesForWhitespaceToken; |
93 | 93 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | if ($previous->isWhitespace()) { |
104 | 104 | // Fix the previous whitespace token |
105 | - $tokens[$previousIndex] = new Token([T_WHITESPACE, str_repeat($lineEnding, $newlinesForWhitespaceToken).substr($previous->getContent(), strrpos($previous->getContent(), "\n") + 1)]); |
|
105 | + $tokens[$previousIndex] = new Token([T_WHITESPACE, str_repeat($lineEnding, $newlinesForWhitespaceToken) . substr($previous->getContent(), strrpos($previous->getContent(), "\n") + 1)]); |
|
106 | 106 | } else { |
107 | 107 | // Add a new whitespace token |
108 | 108 | $tokens->insertAt($index, new Token([T_WHITESPACE, str_repeat($lineEnding, $newlinesForWhitespaceToken)])); |
@@ -127,6 +127,6 @@ |
||
127 | 127 | return; |
128 | 128 | } |
129 | 129 | |
130 | - $this->content .= $matches[1].$matches[2]; |
|
130 | + $this->content .= $matches[1] . $matches[2]; |
|
131 | 131 | } |
132 | 132 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public function setTypes(array $types): void |
212 | 212 | { |
213 | - $pattern = '/'.preg_quote($this->getTypesContent(), '/').'/'; |
|
213 | + $pattern = '/' . preg_quote($this->getTypesContent(), '/') . '/'; |
|
214 | 214 | |
215 | 215 | $this->lines[0]->setContent(Preg::replace($pattern, implode('|', $types), $this->lines[0]->getContent(), 1)); |
216 | 216 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public function getNormalizedTypes(): array |
226 | 226 | { |
227 | - $normalized = array_map(static function (string $type) { |
|
227 | + $normalized = array_map(static function(string $type) { |
|
228 | 228 | return strtolower($type); |
229 | 229 | }, $this->getTypes()); |
230 | 230 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | } |
290 | 290 | |
291 | 291 | $matchingResult = Preg::match( |
292 | - '{^(?:\s*\*|/\*\*)\s*@'.$name.'\s+'.TypeExpression::REGEX_TYPES.'(?:[*\h\v].*)?\r?$}sx', |
|
292 | + '{^(?:\s*\*|/\*\*)\s*@' . $name . '\s+' . TypeExpression::REGEX_TYPES . '(?:[*\h\v].*)?\r?$}sx', |
|
293 | 293 | $this->lines[0]->getContent(), |
294 | 294 | $matches |
295 | 295 | ); |
@@ -122,14 +122,14 @@ |
||
122 | 122 | { |
123 | 123 | while ('' !== $value) { |
124 | 124 | Preg::match( |
125 | - '{^'.self::REGEX_TYPES.'$}x', |
|
125 | + '{^' . self::REGEX_TYPES . '$}x', |
|
126 | 126 | $value, |
127 | 127 | $matches |
128 | 128 | ); |
129 | 129 | |
130 | 130 | $this->types[] = $matches['type']; |
131 | 131 | $value = Preg::replace( |
132 | - '/^'.preg_quote($matches['type'], '/').'(\h*\|\h*)?/', |
|
132 | + '/^' . preg_quote($matches['type'], '/') . '(\h*\|\h*)?/', |
|
133 | 133 | '', |
134 | 134 | $value |
135 | 135 | ); |
@@ -138,18 +138,18 @@ discard block |
||
138 | 138 | |
139 | 139 | if ('' === $lineContent) { |
140 | 140 | $this->lines = [ |
141 | - new Line('/**'.$lineEnd), |
|
142 | - new Line($indent.' *'.$lineEnd), |
|
143 | - new Line($indent.' */'), |
|
141 | + new Line('/**' . $lineEnd), |
|
142 | + new Line($indent . ' *' . $lineEnd), |
|
143 | + new Line($indent . ' */'), |
|
144 | 144 | ]; |
145 | 145 | |
146 | 146 | return; |
147 | 147 | } |
148 | 148 | |
149 | 149 | $this->lines = [ |
150 | - new Line('/**'.$lineEnd), |
|
151 | - new Line($indent.' * '.$lineContent.$lineEnd), |
|
152 | - new Line($indent.' */'), |
|
150 | + new Line('/**' . $lineEnd), |
|
151 | + new Line($indent . ' * ' . $lineContent . $lineEnd), |
|
152 | + new Line($indent . ' */'), |
|
153 | 153 | ]; |
154 | 154 | } |
155 | 155 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | $usefulLines = array_filter( |
163 | 163 | $this->lines, |
164 | - static function (Line $line) { |
|
164 | + static function(Line $line) { |
|
165 | 165 | return $line->containsUsefulContent(); |
166 | 166 | } |
167 | 167 | ); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $lineContent = $this->getSingleLineDocBlockEntry(array_shift($usefulLines)); |
176 | 176 | } |
177 | 177 | |
178 | - $this->lines = [new Line('/** '.$lineContent.' */')]; |
|
178 | + $this->lines = [new Line('/** ' . $lineContent . ' */')]; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | public function getAnnotation(int $pos): ?Annotation |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | public function getAnnotationsOfType($types): array |
198 | 198 | { |
199 | 199 | $annotations = []; |
200 | - $types = (array) $types; |
|
200 | + $types = (array)$types; |
|
201 | 201 | |
202 | 202 | foreach ($this->getAnnotations() as $annotation) { |
203 | 203 | $tag = $annotation->getTag()->getName(); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | throw $e; |
34 | 34 | } |
35 | 35 | |
36 | - return 'Failed to create Phar instance. '.$e->getMessage(); |
|
36 | + return 'Failed to create Phar instance. ' . $e->getMessage(); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | return null; |
@@ -64,7 +64,7 @@ |
||
64 | 64 | throw new \RuntimeException(sprintf( |
65 | 65 | 'Failed to read content from "%s".%s', |
66 | 66 | $realPath, |
67 | - $error ? ' '.$error['message'] : '' |
|
67 | + $error ? ' ' . $error['message'] : '' |
|
68 | 68 | )); |
69 | 69 | } |
70 | 70 |