@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $value = self::xmlToVariable($item); |
98 | 98 | |
99 | 99 | if ($entry->hasAttribute('key')) { |
100 | - $variable[(string) $entry->getAttribute('key')] = $value; |
|
100 | + $variable[(string)$entry->getAttribute('key')] = $value; |
|
101 | 101 | } else { |
102 | 102 | $variable[] = $value; |
103 | 103 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } catch (ReflectionException $e) { |
127 | 127 | throw new Exception( |
128 | 128 | $e->getMessage(), |
129 | - (int) $e->getCode(), |
|
129 | + (int)$e->getCode(), |
|
130 | 130 | $e |
131 | 131 | ); |
132 | 132 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $className = $class->getName(); |
127 | 127 | |
128 | 128 | return new self( |
129 | - (string) $class->getDocComment(), |
|
129 | + (string)$class->getDocComment(), |
|
130 | 130 | false, |
131 | 131 | self::extractAnnotationsFromReflector($class), |
132 | 132 | $class->getStartLine(), |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | public static function ofMethod(ReflectionMethod $method, string $classNameInHierarchy): self |
144 | 144 | { |
145 | 145 | return new self( |
146 | - (string) $method->getDocComment(), |
|
146 | + (string)$method->getDocComment(), |
|
147 | 147 | true, |
148 | 148 | self::extractAnnotationsFromReflector($method), |
149 | 149 | $method->getStartLine(), |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | } catch (ReflectionException $e) { |
411 | 411 | throw new Exception( |
412 | 412 | $e->getMessage(), |
413 | - (int) $e->getCode(), |
|
413 | + (int)$e->getCode(), |
|
414 | 414 | $e |
415 | 415 | ); |
416 | 416 | // @codeCoverageIgnoreEnd |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | //removing initial ' * ' for docComment |
503 | 503 | $docComment = str_replace("\r\n", "\n", $docComment); |
504 | 504 | $docComment = preg_replace('/' . '\n' . '\s*' . '\*' . '\s?' . '/', "\n", $docComment); |
505 | - $docComment = (string) substr($docComment, 0, -1); |
|
505 | + $docComment = (string)substr($docComment, 0, -1); |
|
506 | 506 | |
507 | 507 | return rtrim($docComment, "\n"); |
508 | 508 | } |
@@ -511,14 +511,14 @@ discard block |
||
511 | 511 | private static function parseDocBlock(string $docBlock): array |
512 | 512 | { |
513 | 513 | // Strip away the docblock header and footer to ease parsing of one line annotations |
514 | - $docBlock = (string) substr($docBlock, 3, -2); |
|
514 | + $docBlock = (string)substr($docBlock, 3, -2); |
|
515 | 515 | $annotations = []; |
516 | 516 | |
517 | 517 | if (preg_match_all('/@(?P<name>[A-Za-z_-]+)(?:[ \t]+(?P<value>.*?))?[ \t]*\r?$/m', $docBlock, $matches)) { |
518 | 518 | $numMatches = count($matches[0]); |
519 | 519 | |
520 | 520 | for ($i = 0; $i < $numMatches; $i++) { |
521 | - $annotations[$matches['name'][$i]][] = (string) $matches['value'][$i]; |
|
521 | + $annotations[$matches['name'][$i]][] = (string)$matches['value'][$i]; |
|
522 | 522 | } |
523 | 523 | } |
524 | 524 | |
@@ -534,8 +534,8 @@ discard block |
||
534 | 534 | $annotations = array_merge( |
535 | 535 | $annotations, |
536 | 536 | ...array_map( |
537 | - static function (ReflectionClass $trait): array { |
|
538 | - return self::parseDocBlock((string) $trait->getDocComment()); |
|
537 | + static function(ReflectionClass $trait): array { |
|
538 | + return self::parseDocBlock((string)$trait->getDocComment()); |
|
539 | 539 | }, |
540 | 540 | array_values($reflector->getTraits()) |
541 | 541 | ) |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | |
545 | 545 | return array_merge( |
546 | 546 | $annotations, |
547 | - self::parseDocBlock((string) $reflector->getDocComment()) |
|
547 | + self::parseDocBlock((string)$reflector->getDocComment()) |
|
548 | 548 | ); |
549 | 549 | } |
550 | 550 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } catch (ReflectionException $e) { |
58 | 58 | throw new Exception( |
59 | 59 | $e->getMessage(), |
60 | - (int) $e->getCode(), |
|
60 | + (int)$e->getCode(), |
|
61 | 61 | $e |
62 | 62 | ); |
63 | 63 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } catch (ReflectionException $e) { |
83 | 83 | throw new Exception( |
84 | 84 | $e->getMessage(), |
85 | - (int) $e->getCode(), |
|
85 | + (int)$e->getCode(), |
|
86 | 86 | $e |
87 | 87 | ); |
88 | 88 | } |
@@ -237,7 +237,7 @@ |
||
237 | 237 | } catch (ReflectionException $e) { |
238 | 238 | throw new Exception( |
239 | 239 | $e->getMessage(), |
240 | - (int) $e->getCode(), |
|
240 | + (int)$e->getCode(), |
|
241 | 241 | $e |
242 | 242 | ); |
243 | 243 | } |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | |
302 | 302 | if ($this->colors) { |
303 | 303 | $color = self::STATUS_STYLES[$result['status']]['color'] ?? ''; |
304 | - $prefix = array_map(static function ($p) use ($color) { |
|
304 | + $prefix = array_map(static function($p) use ($color) { |
|
305 | 305 | return Color::colorize($color, $p); |
306 | 306 | }, self::PREFIX_DECORATED); |
307 | 307 | } |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $color = 'fg-magenta'; |
355 | 355 | } |
356 | 356 | |
357 | - return Color::colorize($color, ' ' . (int) ceil($time * 1000) . ' ' . Color::dim('ms')); |
|
357 | + return Color::colorize($color, ' ' . (int)ceil($time * 1000) . ' ' . Color::dim('ms')); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | private function printNonSuccessfulTestsSummary(int $numberOfExecutedTests): void |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | $annotationWithPlaceholders = false; |
149 | 149 | |
150 | - $callback = static function (string $variable): string { |
|
150 | + $callback = static function(string $variable): string { |
|
151 | 151 | return sprintf('/%s(?=\b)/', preg_quote($variable, '/')); |
152 | 152 | }; |
153 | 153 | |
@@ -181,9 +181,9 @@ discard block |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | if (is_int($test->dataName())) { |
184 | - $data = Color::dim(' with data set ') . Color::colorize('fg-cyan', (string) $test->dataName()); |
|
184 | + $data = Color::dim(' with data set ') . Color::colorize('fg-cyan', (string)$test->dataName()); |
|
185 | 185 | } else { |
186 | - $data = Color::dim(' with ') . Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $test->dataName())); |
|
186 | + $data = Color::dim(' with ') . Color::colorize('fg-cyan', Color::visualizeWhitespace((string)$test->dataName())); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | return $data; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | return $buffer; |
201 | 201 | } |
202 | 202 | |
203 | - $string = (string) preg_replace('#\d+$#', '', $name, -1, $count); |
|
203 | + $string = (string)preg_replace('#\d+$#', '', $name, -1, $count); |
|
204 | 204 | |
205 | 205 | if (in_array($string, $this->strings, true)) { |
206 | 206 | $name = $string; |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | } catch (ReflectionException $e) { |
260 | 260 | throw new UtilException( |
261 | 261 | $e->getMessage(), |
262 | - (int) $e->getCode(), |
|
262 | + (int)$e->getCode(), |
|
263 | 263 | $e |
264 | 264 | ); |
265 | 265 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | } catch (ReflectionException $e) { |
280 | 280 | throw new UtilException( |
281 | 281 | $e->getMessage(), |
282 | - (int) $e->getCode(), |
|
282 | + (int)$e->getCode(), |
|
283 | 283 | $e |
284 | 284 | ); |
285 | 285 | } |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $reflector = new ReflectionObject($value); |
293 | 293 | |
294 | 294 | if ($reflector->hasMethod('__toString')) { |
295 | - $value = (string) $value; |
|
295 | + $value = (string)$value; |
|
296 | 296 | } else { |
297 | 297 | $value = get_class($value); |
298 | 298 | } |
@@ -318,8 +318,8 @@ discard block |
||
318 | 318 | } |
319 | 319 | |
320 | 320 | if ($this->useColor) { |
321 | - $providedData = array_map(static function ($value) { |
|
322 | - return Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $value, true)); |
|
321 | + $providedData = array_map(static function($value) { |
|
322 | + return Color::colorize('fg-cyan', Color::visualizeWhitespace((string)$value, true)); |
|
323 | 323 | }, $providedData); |
324 | 324 | } |
325 | 325 |
@@ -376,7 +376,7 @@ |
||
376 | 376 | return implode( |
377 | 377 | PHP_EOL, |
378 | 378 | array_map( |
379 | - static function (string $text) use ($prefix) { |
|
379 | + static function(string $text) use ($prefix) { |
|
380 | 380 | return ' ' . $prefix . ($text ? ' ' . $text : ''); |
381 | 381 | }, |
382 | 382 | preg_split('/\r\n|\r|\n/', $message) |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | $groups = array_filter( |
162 | 162 | $test->getGroups(), |
163 | - static function ($group) { |
|
163 | + static function($group) { |
|
164 | 164 | return !($group === 'small' || $group === 'medium' || $group === 'large' || strpos($group, '__phpunit_') === 0); |
165 | 165 | } |
166 | 166 | ); |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | $testNode->setAttribute('methodName', $test->getName()); |
172 | 172 | $testNode->setAttribute('prettifiedClassName', $this->prettifier->prettifyTestClass(get_class($test))); |
173 | 173 | $testNode->setAttribute('prettifiedMethodName', $this->prettifier->prettifyTestCase($test)); |
174 | - $testNode->setAttribute('status', (string) $test->getStatus()); |
|
175 | - $testNode->setAttribute('time', (string) $time); |
|
176 | - $testNode->setAttribute('size', (string) $test->getSize()); |
|
174 | + $testNode->setAttribute('status', (string)$test->getStatus()); |
|
175 | + $testNode->setAttribute('time', (string)$time); |
|
176 | + $testNode->setAttribute('size', (string)$test->getSize()); |
|
177 | 177 | $testNode->setAttribute('groups', implode(',', $groups)); |
178 | 178 | |
179 | 179 | foreach ($groups as $group) { |
@@ -217,11 +217,11 @@ discard block |
||
217 | 217 | |
218 | 218 | if (isset($inlineAnnotations['given'], $inlineAnnotations['when'], $inlineAnnotations['then'])) { |
219 | 219 | $testNode->setAttribute('given', $inlineAnnotations['given']['value']); |
220 | - $testNode->setAttribute('givenStartLine', (string) $inlineAnnotations['given']['line']); |
|
220 | + $testNode->setAttribute('givenStartLine', (string)$inlineAnnotations['given']['line']); |
|
221 | 221 | $testNode->setAttribute('when', $inlineAnnotations['when']['value']); |
222 | - $testNode->setAttribute('whenStartLine', (string) $inlineAnnotations['when']['line']); |
|
222 | + $testNode->setAttribute('whenStartLine', (string)$inlineAnnotations['when']['line']); |
|
223 | 223 | $testNode->setAttribute('then', $inlineAnnotations['then']['value']); |
224 | - $testNode->setAttribute('thenStartLine', (string) $inlineAnnotations['then']['line']); |
|
224 | + $testNode->setAttribute('thenStartLine', (string)$inlineAnnotations['then']['line']); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | if ($this->exception !== null) { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } catch (ReflectionException $e) { |
238 | 238 | throw new Exception( |
239 | 239 | $e->getMessage(), |
240 | - (int) $e->getCode(), |
|
240 | + (int)$e->getCode(), |
|
241 | 241 | $e |
242 | 242 | ); |
243 | 243 | } |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | foreach ($steps as $step) { |
247 | 247 | if (isset($step['file']) && $step['file'] === $file) { |
248 | - $testNode->setAttribute('exceptionLine', (string) $step['line']); |
|
248 | + $testNode->setAttribute('exceptionLine', (string)$step['line']); |
|
249 | 249 | |
250 | 250 | break; |
251 | 251 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | ); |
73 | 73 | } |
74 | 74 | |
75 | - $this->stream = fsockopen($tmp[0], (int) $tmp[1]); |
|
75 | + $this->stream = fsockopen($tmp[0], (int)$tmp[1]); |
|
76 | 76 | |
77 | 77 | return; |
78 | 78 | } |