@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $this->lastTestFailed = true; |
171 | 171 | $this->testResultMessage = $this->formatTestResultMessage( |
172 | 172 | $this->formatWithColor('fg-yellow', '✘'), |
173 | - (string) $t, |
|
173 | + (string)$t, |
|
174 | 174 | $time, |
175 | 175 | true |
176 | 176 | ); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $this->lastTestFailed = true; |
182 | 182 | $this->testResultMessage = $this->formatTestResultMessage( |
183 | 183 | $this->formatWithColor('fg-yellow', '✘'), |
184 | - (string) $e, |
|
184 | + (string)$e, |
|
185 | 185 | $time, |
186 | 186 | true |
187 | 187 | ); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $this->lastTestFailed = true; |
193 | 193 | $this->testResultMessage = $this->formatTestResultMessage( |
194 | 194 | $this->formatWithColor('fg-red', '✘'), |
195 | - (string) $e, |
|
195 | + (string)$e, |
|
196 | 196 | $time, |
197 | 197 | true |
198 | 198 | ); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $this->lastTestFailed = true; |
204 | 204 | $this->testResultMessage = $this->formatTestResultMessage( |
205 | 205 | $this->formatWithColor('fg-yellow', '∅'), |
206 | - (string) $t, |
|
206 | + (string)$t, |
|
207 | 207 | $time, |
208 | 208 | false |
209 | 209 | ); |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $this->lastTestFailed = true; |
215 | 215 | $this->testResultMessage = $this->formatTestResultMessage( |
216 | 216 | $this->formatWithColor('fg-yellow', '☢'), |
217 | - (string) $t, |
|
217 | + (string)$t, |
|
218 | 218 | $time, |
219 | 219 | false |
220 | 220 | ); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $this->lastTestFailed = true; |
226 | 226 | $this->testResultMessage = $this->formatTestResultMessage( |
227 | 227 | $this->formatWithColor('fg-yellow', '→'), |
228 | - (string) $t, |
|
228 | + (string)$t, |
|
229 | 229 | $time, |
230 | 230 | false |
231 | 231 | ); |
@@ -361,14 +361,14 @@ discard block |
||
361 | 361 | private function getFormattedRuntime(float $time): string |
362 | 362 | { |
363 | 363 | if ($time > 5) { |
364 | - return $this->formatWithColor('fg-red', \sprintf('[%.2f ms]', $time * 1000)); |
|
364 | + return $this->formatWithColor('fg-red', \sprintf('[%.2f ms]', $time*1000)); |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | if ($time > 1) { |
368 | - return $this->formatWithColor('fg-yellow', \sprintf('[%.2f ms]', $time * 1000)); |
|
368 | + return $this->formatWithColor('fg-yellow', \sprintf('[%.2f ms]', $time*1000)); |
|
369 | 369 | } |
370 | 370 | |
371 | - return \sprintf('[%.2f ms]', $time * 1000); |
|
371 | + return \sprintf('[%.2f ms]', $time*1000); |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | private function getFormattedAdditionalInformation(string $resultMessage, bool $verbose): string |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | \implode( |
387 | 387 | "\n", |
388 | 388 | \array_map( |
389 | - function (string $text) { |
|
389 | + function(string $text) { |
|
390 | 390 | return \sprintf(' │ %s', $text); |
391 | 391 | }, |
392 | 392 | \explode("\n", $resultMessage) |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | return; |
402 | 402 | } |
403 | 403 | |
404 | - if ((\count($this->nonSuccessfulTestResults) / $numberOfExecutedTests) >= 0.7) { |
|
404 | + if ((\count($this->nonSuccessfulTestResults)/$numberOfExecutedTests) >= 0.7) { |
|
405 | 405 | return; |
406 | 406 | } |
407 | 407 |
@@ -263,13 +263,13 @@ discard block |
||
263 | 263 | |
264 | 264 | foreach ($this->xpath->query('extensions/extension') as $extension) { |
265 | 265 | /** @var DOMElement $extension */ |
266 | - $class = (string) $extension->getAttribute('class'); |
|
266 | + $class = (string)$extension->getAttribute('class'); |
|
267 | 267 | $file = ''; |
268 | 268 | $arguments = $this->getConfigurationArguments($extension->childNodes); |
269 | 269 | |
270 | 270 | if ($extension->getAttribute('file')) { |
271 | 271 | $file = $this->toAbsolutePath( |
272 | - (string) $extension->getAttribute('file'), |
|
272 | + (string)$extension->getAttribute('file'), |
|
273 | 273 | true |
274 | 274 | ); |
275 | 275 | } |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | if ($tmp->length === 1) { |
301 | 301 | if ($tmp->item(0)->hasAttribute('addUncoveredFilesFromWhitelist')) { |
302 | 302 | $addUncoveredFilesFromWhitelist = $this->getBoolean( |
303 | - (string) $tmp->item(0)->getAttribute( |
|
303 | + (string)$tmp->item(0)->getAttribute( |
|
304 | 304 | 'addUncoveredFilesFromWhitelist' |
305 | 305 | ), |
306 | 306 | true |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | |
310 | 310 | if ($tmp->item(0)->hasAttribute('processUncoveredFilesFromWhitelist')) { |
311 | 311 | $processUncoveredFilesFromWhitelist = $this->getBoolean( |
312 | - (string) $tmp->item(0)->getAttribute( |
|
312 | + (string)$tmp->item(0)->getAttribute( |
|
313 | 313 | 'processUncoveredFilesFromWhitelist' |
314 | 314 | ), |
315 | 315 | false |
@@ -374,13 +374,13 @@ discard block |
||
374 | 374 | |
375 | 375 | foreach ($this->xpath->query('listeners/listener') as $listener) { |
376 | 376 | /** @var DOMElement $listener */ |
377 | - $class = (string) $listener->getAttribute('class'); |
|
377 | + $class = (string)$listener->getAttribute('class'); |
|
378 | 378 | $file = ''; |
379 | 379 | $arguments = $this->getConfigurationArguments($listener->childNodes); |
380 | 380 | |
381 | 381 | if ($listener->getAttribute('file')) { |
382 | 382 | $file = $this->toAbsolutePath( |
383 | - (string) $listener->getAttribute('file'), |
|
383 | + (string)$listener->getAttribute('file'), |
|
384 | 384 | true |
385 | 385 | ); |
386 | 386 | } |
@@ -404,8 +404,8 @@ discard block |
||
404 | 404 | |
405 | 405 | foreach ($this->xpath->query('logging/log') as $log) { |
406 | 406 | /** @var DOMElement $log */ |
407 | - $type = (string) $log->getAttribute('type'); |
|
408 | - $target = (string) $log->getAttribute('target'); |
|
407 | + $type = (string)$log->getAttribute('type'); |
|
408 | + $target = (string)$log->getAttribute('target'); |
|
409 | 409 | |
410 | 410 | if (!$target) { |
411 | 411 | continue; |
@@ -416,35 +416,35 @@ discard block |
||
416 | 416 | if ($type === 'coverage-html') { |
417 | 417 | if ($log->hasAttribute('lowUpperBound')) { |
418 | 418 | $result['lowUpperBound'] = $this->getInteger( |
419 | - (string) $log->getAttribute('lowUpperBound'), |
|
419 | + (string)$log->getAttribute('lowUpperBound'), |
|
420 | 420 | 50 |
421 | 421 | ); |
422 | 422 | } |
423 | 423 | |
424 | 424 | if ($log->hasAttribute('highLowerBound')) { |
425 | 425 | $result['highLowerBound'] = $this->getInteger( |
426 | - (string) $log->getAttribute('highLowerBound'), |
|
426 | + (string)$log->getAttribute('highLowerBound'), |
|
427 | 427 | 90 |
428 | 428 | ); |
429 | 429 | } |
430 | 430 | } elseif ($type === 'coverage-crap4j') { |
431 | 431 | if ($log->hasAttribute('threshold')) { |
432 | 432 | $result['crap4jThreshold'] = $this->getInteger( |
433 | - (string) $log->getAttribute('threshold'), |
|
433 | + (string)$log->getAttribute('threshold'), |
|
434 | 434 | 30 |
435 | 435 | ); |
436 | 436 | } |
437 | 437 | } elseif ($type === 'coverage-text') { |
438 | 438 | if ($log->hasAttribute('showUncoveredFiles')) { |
439 | 439 | $result['coverageTextShowUncoveredFiles'] = $this->getBoolean( |
440 | - (string) $log->getAttribute('showUncoveredFiles'), |
|
440 | + (string)$log->getAttribute('showUncoveredFiles'), |
|
441 | 441 | false |
442 | 442 | ); |
443 | 443 | } |
444 | 444 | |
445 | 445 | if ($log->hasAttribute('showOnlySummary')) { |
446 | 446 | $result['coverageTextShowOnlySummary'] = $this->getBoolean( |
447 | - (string) $log->getAttribute('showOnlySummary'), |
|
447 | + (string)$log->getAttribute('showOnlySummary'), |
|
448 | 448 | false |
449 | 449 | ); |
450 | 450 | } |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | ]; |
477 | 477 | |
478 | 478 | foreach ($this->xpath->query('php/includePath') as $includePath) { |
479 | - $path = (string) $includePath->textContent; |
|
479 | + $path = (string)$includePath->textContent; |
|
480 | 480 | |
481 | 481 | if ($path) { |
482 | 482 | $result['include_path'][] = $this->toAbsolutePath($path); |
@@ -485,16 +485,16 @@ discard block |
||
485 | 485 | |
486 | 486 | foreach ($this->xpath->query('php/ini') as $ini) { |
487 | 487 | /** @var DOMElement $ini */ |
488 | - $name = (string) $ini->getAttribute('name'); |
|
489 | - $value = (string) $ini->getAttribute('value'); |
|
488 | + $name = (string)$ini->getAttribute('name'); |
|
489 | + $value = (string)$ini->getAttribute('value'); |
|
490 | 490 | |
491 | 491 | $result['ini'][$name]['value'] = $value; |
492 | 492 | } |
493 | 493 | |
494 | 494 | foreach ($this->xpath->query('php/const') as $const) { |
495 | 495 | /** @var DOMElement $const */ |
496 | - $name = (string) $const->getAttribute('name'); |
|
497 | - $value = (string) $const->getAttribute('value'); |
|
496 | + $name = (string)$const->getAttribute('name'); |
|
497 | + $value = (string)$const->getAttribute('value'); |
|
498 | 498 | |
499 | 499 | $result['const'][$name]['value'] = $this->getBoolean($value, $value); |
500 | 500 | } |
@@ -502,8 +502,8 @@ discard block |
||
502 | 502 | foreach (['var', 'env', 'post', 'get', 'cookie', 'server', 'files', 'request'] as $array) { |
503 | 503 | foreach ($this->xpath->query('php/' . $array) as $var) { |
504 | 504 | /** @var DOMElement $var */ |
505 | - $name = (string) $var->getAttribute('name'); |
|
506 | - $value = (string) $var->getAttribute('value'); |
|
505 | + $name = (string)$var->getAttribute('name'); |
|
506 | + $value = (string)$var->getAttribute('value'); |
|
507 | 507 | $verbatim = false; |
508 | 508 | |
509 | 509 | if ($var->hasAttribute('verbatim')) { |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $value = $data['value']; |
548 | 548 | |
549 | 549 | if (\defined($value)) { |
550 | - $value = (string) \constant($value); |
|
550 | + $value = (string)\constant($value); |
|
551 | 551 | } |
552 | 552 | |
553 | 553 | \ini_set($name, $value); |
@@ -617,13 +617,13 @@ discard block |
||
617 | 617 | |
618 | 618 | if ($root->hasAttribute('cacheTokens')) { |
619 | 619 | $result['cacheTokens'] = $this->getBoolean( |
620 | - (string) $root->getAttribute('cacheTokens'), |
|
620 | + (string)$root->getAttribute('cacheTokens'), |
|
621 | 621 | false |
622 | 622 | ); |
623 | 623 | } |
624 | 624 | |
625 | 625 | if ($root->hasAttribute('columns')) { |
626 | - $columns = (string) $root->getAttribute('columns'); |
|
626 | + $columns = (string)$root->getAttribute('columns'); |
|
627 | 627 | |
628 | 628 | if ($columns === 'max') { |
629 | 629 | $result['columns'] = 'max'; |
@@ -647,281 +647,281 @@ discard block |
||
647 | 647 | */ |
648 | 648 | if ($root->hasAttribute('stderr')) { |
649 | 649 | $result['stderr'] = $this->getBoolean( |
650 | - (string) $root->getAttribute('stderr'), |
|
650 | + (string)$root->getAttribute('stderr'), |
|
651 | 651 | false |
652 | 652 | ); |
653 | 653 | } |
654 | 654 | |
655 | 655 | if ($root->hasAttribute('backupGlobals')) { |
656 | 656 | $result['backupGlobals'] = $this->getBoolean( |
657 | - (string) $root->getAttribute('backupGlobals'), |
|
657 | + (string)$root->getAttribute('backupGlobals'), |
|
658 | 658 | false |
659 | 659 | ); |
660 | 660 | } |
661 | 661 | |
662 | 662 | if ($root->hasAttribute('backupStaticAttributes')) { |
663 | 663 | $result['backupStaticAttributes'] = $this->getBoolean( |
664 | - (string) $root->getAttribute('backupStaticAttributes'), |
|
664 | + (string)$root->getAttribute('backupStaticAttributes'), |
|
665 | 665 | false |
666 | 666 | ); |
667 | 667 | } |
668 | 668 | |
669 | 669 | if ($root->getAttribute('bootstrap')) { |
670 | 670 | $result['bootstrap'] = $this->toAbsolutePath( |
671 | - (string) $root->getAttribute('bootstrap') |
|
671 | + (string)$root->getAttribute('bootstrap') |
|
672 | 672 | ); |
673 | 673 | } |
674 | 674 | |
675 | 675 | if ($root->hasAttribute('convertDeprecationsToExceptions')) { |
676 | 676 | $result['convertDeprecationsToExceptions'] = $this->getBoolean( |
677 | - (string) $root->getAttribute('convertDeprecationsToExceptions'), |
|
677 | + (string)$root->getAttribute('convertDeprecationsToExceptions'), |
|
678 | 678 | true |
679 | 679 | ); |
680 | 680 | } |
681 | 681 | |
682 | 682 | if ($root->hasAttribute('convertErrorsToExceptions')) { |
683 | 683 | $result['convertErrorsToExceptions'] = $this->getBoolean( |
684 | - (string) $root->getAttribute('convertErrorsToExceptions'), |
|
684 | + (string)$root->getAttribute('convertErrorsToExceptions'), |
|
685 | 685 | true |
686 | 686 | ); |
687 | 687 | } |
688 | 688 | |
689 | 689 | if ($root->hasAttribute('convertNoticesToExceptions')) { |
690 | 690 | $result['convertNoticesToExceptions'] = $this->getBoolean( |
691 | - (string) $root->getAttribute('convertNoticesToExceptions'), |
|
691 | + (string)$root->getAttribute('convertNoticesToExceptions'), |
|
692 | 692 | true |
693 | 693 | ); |
694 | 694 | } |
695 | 695 | |
696 | 696 | if ($root->hasAttribute('convertWarningsToExceptions')) { |
697 | 697 | $result['convertWarningsToExceptions'] = $this->getBoolean( |
698 | - (string) $root->getAttribute('convertWarningsToExceptions'), |
|
698 | + (string)$root->getAttribute('convertWarningsToExceptions'), |
|
699 | 699 | true |
700 | 700 | ); |
701 | 701 | } |
702 | 702 | |
703 | 703 | if ($root->hasAttribute('forceCoversAnnotation')) { |
704 | 704 | $result['forceCoversAnnotation'] = $this->getBoolean( |
705 | - (string) $root->getAttribute('forceCoversAnnotation'), |
|
705 | + (string)$root->getAttribute('forceCoversAnnotation'), |
|
706 | 706 | false |
707 | 707 | ); |
708 | 708 | } |
709 | 709 | |
710 | 710 | if ($root->hasAttribute('disableCodeCoverageIgnore')) { |
711 | 711 | $result['disableCodeCoverageIgnore'] = $this->getBoolean( |
712 | - (string) $root->getAttribute('disableCodeCoverageIgnore'), |
|
712 | + (string)$root->getAttribute('disableCodeCoverageIgnore'), |
|
713 | 713 | false |
714 | 714 | ); |
715 | 715 | } |
716 | 716 | |
717 | 717 | if ($root->hasAttribute('processIsolation')) { |
718 | 718 | $result['processIsolation'] = $this->getBoolean( |
719 | - (string) $root->getAttribute('processIsolation'), |
|
719 | + (string)$root->getAttribute('processIsolation'), |
|
720 | 720 | false |
721 | 721 | ); |
722 | 722 | } |
723 | 723 | |
724 | 724 | if ($root->hasAttribute('stopOnDefect')) { |
725 | 725 | $result['stopOnDefect'] = $this->getBoolean( |
726 | - (string) $root->getAttribute('stopOnDefect'), |
|
726 | + (string)$root->getAttribute('stopOnDefect'), |
|
727 | 727 | false |
728 | 728 | ); |
729 | 729 | } |
730 | 730 | |
731 | 731 | if ($root->hasAttribute('stopOnError')) { |
732 | 732 | $result['stopOnError'] = $this->getBoolean( |
733 | - (string) $root->getAttribute('stopOnError'), |
|
733 | + (string)$root->getAttribute('stopOnError'), |
|
734 | 734 | false |
735 | 735 | ); |
736 | 736 | } |
737 | 737 | |
738 | 738 | if ($root->hasAttribute('stopOnFailure')) { |
739 | 739 | $result['stopOnFailure'] = $this->getBoolean( |
740 | - (string) $root->getAttribute('stopOnFailure'), |
|
740 | + (string)$root->getAttribute('stopOnFailure'), |
|
741 | 741 | false |
742 | 742 | ); |
743 | 743 | } |
744 | 744 | |
745 | 745 | if ($root->hasAttribute('stopOnWarning')) { |
746 | 746 | $result['stopOnWarning'] = $this->getBoolean( |
747 | - (string) $root->getAttribute('stopOnWarning'), |
|
747 | + (string)$root->getAttribute('stopOnWarning'), |
|
748 | 748 | false |
749 | 749 | ); |
750 | 750 | } |
751 | 751 | |
752 | 752 | if ($root->hasAttribute('stopOnIncomplete')) { |
753 | 753 | $result['stopOnIncomplete'] = $this->getBoolean( |
754 | - (string) $root->getAttribute('stopOnIncomplete'), |
|
754 | + (string)$root->getAttribute('stopOnIncomplete'), |
|
755 | 755 | false |
756 | 756 | ); |
757 | 757 | } |
758 | 758 | |
759 | 759 | if ($root->hasAttribute('stopOnRisky')) { |
760 | 760 | $result['stopOnRisky'] = $this->getBoolean( |
761 | - (string) $root->getAttribute('stopOnRisky'), |
|
761 | + (string)$root->getAttribute('stopOnRisky'), |
|
762 | 762 | false |
763 | 763 | ); |
764 | 764 | } |
765 | 765 | |
766 | 766 | if ($root->hasAttribute('stopOnSkipped')) { |
767 | 767 | $result['stopOnSkipped'] = $this->getBoolean( |
768 | - (string) $root->getAttribute('stopOnSkipped'), |
|
768 | + (string)$root->getAttribute('stopOnSkipped'), |
|
769 | 769 | false |
770 | 770 | ); |
771 | 771 | } |
772 | 772 | |
773 | 773 | if ($root->hasAttribute('failOnWarning')) { |
774 | 774 | $result['failOnWarning'] = $this->getBoolean( |
775 | - (string) $root->getAttribute('failOnWarning'), |
|
775 | + (string)$root->getAttribute('failOnWarning'), |
|
776 | 776 | false |
777 | 777 | ); |
778 | 778 | } |
779 | 779 | |
780 | 780 | if ($root->hasAttribute('failOnRisky')) { |
781 | 781 | $result['failOnRisky'] = $this->getBoolean( |
782 | - (string) $root->getAttribute('failOnRisky'), |
|
782 | + (string)$root->getAttribute('failOnRisky'), |
|
783 | 783 | false |
784 | 784 | ); |
785 | 785 | } |
786 | 786 | |
787 | 787 | if ($root->hasAttribute('testSuiteLoaderClass')) { |
788 | - $result['testSuiteLoaderClass'] = (string) $root->getAttribute( |
|
788 | + $result['testSuiteLoaderClass'] = (string)$root->getAttribute( |
|
789 | 789 | 'testSuiteLoaderClass' |
790 | 790 | ); |
791 | 791 | } |
792 | 792 | |
793 | 793 | if ($root->hasAttribute('defaultTestSuite')) { |
794 | - $result['defaultTestSuite'] = (string) $root->getAttribute( |
|
794 | + $result['defaultTestSuite'] = (string)$root->getAttribute( |
|
795 | 795 | 'defaultTestSuite' |
796 | 796 | ); |
797 | 797 | } |
798 | 798 | |
799 | 799 | if ($root->getAttribute('testSuiteLoaderFile')) { |
800 | 800 | $result['testSuiteLoaderFile'] = $this->toAbsolutePath( |
801 | - (string) $root->getAttribute('testSuiteLoaderFile') |
|
801 | + (string)$root->getAttribute('testSuiteLoaderFile') |
|
802 | 802 | ); |
803 | 803 | } |
804 | 804 | |
805 | 805 | if ($root->hasAttribute('printerClass')) { |
806 | - $result['printerClass'] = (string) $root->getAttribute( |
|
806 | + $result['printerClass'] = (string)$root->getAttribute( |
|
807 | 807 | 'printerClass' |
808 | 808 | ); |
809 | 809 | } |
810 | 810 | |
811 | 811 | if ($root->getAttribute('printerFile')) { |
812 | 812 | $result['printerFile'] = $this->toAbsolutePath( |
813 | - (string) $root->getAttribute('printerFile') |
|
813 | + (string)$root->getAttribute('printerFile') |
|
814 | 814 | ); |
815 | 815 | } |
816 | 816 | |
817 | 817 | if ($root->hasAttribute('beStrictAboutChangesToGlobalState')) { |
818 | 818 | $result['beStrictAboutChangesToGlobalState'] = $this->getBoolean( |
819 | - (string) $root->getAttribute('beStrictAboutChangesToGlobalState'), |
|
819 | + (string)$root->getAttribute('beStrictAboutChangesToGlobalState'), |
|
820 | 820 | false |
821 | 821 | ); |
822 | 822 | } |
823 | 823 | |
824 | 824 | if ($root->hasAttribute('beStrictAboutOutputDuringTests')) { |
825 | 825 | $result['disallowTestOutput'] = $this->getBoolean( |
826 | - (string) $root->getAttribute('beStrictAboutOutputDuringTests'), |
|
826 | + (string)$root->getAttribute('beStrictAboutOutputDuringTests'), |
|
827 | 827 | false |
828 | 828 | ); |
829 | 829 | } |
830 | 830 | |
831 | 831 | if ($root->hasAttribute('beStrictAboutResourceUsageDuringSmallTests')) { |
832 | 832 | $result['beStrictAboutResourceUsageDuringSmallTests'] = $this->getBoolean( |
833 | - (string) $root->getAttribute('beStrictAboutResourceUsageDuringSmallTests'), |
|
833 | + (string)$root->getAttribute('beStrictAboutResourceUsageDuringSmallTests'), |
|
834 | 834 | false |
835 | 835 | ); |
836 | 836 | } |
837 | 837 | |
838 | 838 | if ($root->hasAttribute('beStrictAboutTestsThatDoNotTestAnything')) { |
839 | 839 | $result['reportUselessTests'] = $this->getBoolean( |
840 | - (string) $root->getAttribute('beStrictAboutTestsThatDoNotTestAnything'), |
|
840 | + (string)$root->getAttribute('beStrictAboutTestsThatDoNotTestAnything'), |
|
841 | 841 | true |
842 | 842 | ); |
843 | 843 | } |
844 | 844 | |
845 | 845 | if ($root->hasAttribute('beStrictAboutTodoAnnotatedTests')) { |
846 | 846 | $result['disallowTodoAnnotatedTests'] = $this->getBoolean( |
847 | - (string) $root->getAttribute('beStrictAboutTodoAnnotatedTests'), |
|
847 | + (string)$root->getAttribute('beStrictAboutTodoAnnotatedTests'), |
|
848 | 848 | false |
849 | 849 | ); |
850 | 850 | } |
851 | 851 | |
852 | 852 | if ($root->hasAttribute('beStrictAboutCoversAnnotation')) { |
853 | 853 | $result['strictCoverage'] = $this->getBoolean( |
854 | - (string) $root->getAttribute('beStrictAboutCoversAnnotation'), |
|
854 | + (string)$root->getAttribute('beStrictAboutCoversAnnotation'), |
|
855 | 855 | false |
856 | 856 | ); |
857 | 857 | } |
858 | 858 | |
859 | 859 | if ($root->hasAttribute('defaultTimeLimit')) { |
860 | 860 | $result['defaultTimeLimit'] = $this->getInteger( |
861 | - (string) $root->getAttribute('defaultTimeLimit'), |
|
861 | + (string)$root->getAttribute('defaultTimeLimit'), |
|
862 | 862 | 1 |
863 | 863 | ); |
864 | 864 | } |
865 | 865 | |
866 | 866 | if ($root->hasAttribute('enforceTimeLimit')) { |
867 | 867 | $result['enforceTimeLimit'] = $this->getBoolean( |
868 | - (string) $root->getAttribute('enforceTimeLimit'), |
|
868 | + (string)$root->getAttribute('enforceTimeLimit'), |
|
869 | 869 | false |
870 | 870 | ); |
871 | 871 | } |
872 | 872 | |
873 | 873 | if ($root->hasAttribute('ignoreDeprecatedCodeUnitsFromCodeCoverage')) { |
874 | 874 | $result['ignoreDeprecatedCodeUnitsFromCodeCoverage'] = $this->getBoolean( |
875 | - (string) $root->getAttribute('ignoreDeprecatedCodeUnitsFromCodeCoverage'), |
|
875 | + (string)$root->getAttribute('ignoreDeprecatedCodeUnitsFromCodeCoverage'), |
|
876 | 876 | false |
877 | 877 | ); |
878 | 878 | } |
879 | 879 | |
880 | 880 | if ($root->hasAttribute('timeoutForSmallTests')) { |
881 | 881 | $result['timeoutForSmallTests'] = $this->getInteger( |
882 | - (string) $root->getAttribute('timeoutForSmallTests'), |
|
882 | + (string)$root->getAttribute('timeoutForSmallTests'), |
|
883 | 883 | 1 |
884 | 884 | ); |
885 | 885 | } |
886 | 886 | |
887 | 887 | if ($root->hasAttribute('timeoutForMediumTests')) { |
888 | 888 | $result['timeoutForMediumTests'] = $this->getInteger( |
889 | - (string) $root->getAttribute('timeoutForMediumTests'), |
|
889 | + (string)$root->getAttribute('timeoutForMediumTests'), |
|
890 | 890 | 10 |
891 | 891 | ); |
892 | 892 | } |
893 | 893 | |
894 | 894 | if ($root->hasAttribute('timeoutForLargeTests')) { |
895 | 895 | $result['timeoutForLargeTests'] = $this->getInteger( |
896 | - (string) $root->getAttribute('timeoutForLargeTests'), |
|
896 | + (string)$root->getAttribute('timeoutForLargeTests'), |
|
897 | 897 | 60 |
898 | 898 | ); |
899 | 899 | } |
900 | 900 | |
901 | 901 | if ($root->hasAttribute('reverseDefectList')) { |
902 | 902 | $result['reverseDefectList'] = $this->getBoolean( |
903 | - (string) $root->getAttribute('reverseDefectList'), |
|
903 | + (string)$root->getAttribute('reverseDefectList'), |
|
904 | 904 | false |
905 | 905 | ); |
906 | 906 | } |
907 | 907 | |
908 | 908 | if ($root->hasAttribute('verbose')) { |
909 | 909 | $result['verbose'] = $this->getBoolean( |
910 | - (string) $root->getAttribute('verbose'), |
|
910 | + (string)$root->getAttribute('verbose'), |
|
911 | 911 | false |
912 | 912 | ); |
913 | 913 | } |
914 | 914 | |
915 | 915 | if ($root->hasAttribute('registerMockObjectsFromTestArgumentsRecursively')) { |
916 | 916 | $result['registerMockObjectsFromTestArgumentsRecursively'] = $this->getBoolean( |
917 | - (string) $root->getAttribute('registerMockObjectsFromTestArgumentsRecursively'), |
|
917 | + (string)$root->getAttribute('registerMockObjectsFromTestArgumentsRecursively'), |
|
918 | 918 | false |
919 | 919 | ); |
920 | 920 | } |
921 | 921 | |
922 | 922 | if ($root->hasAttribute('extensionsDirectory')) { |
923 | 923 | $result['extensionsDirectory'] = $this->toAbsolutePath( |
924 | - (string) $root->getAttribute( |
|
924 | + (string)$root->getAttribute( |
|
925 | 925 | 'extensionsDirectory' |
926 | 926 | ) |
927 | 927 | ); |
@@ -929,14 +929,14 @@ discard block |
||
929 | 929 | |
930 | 930 | if ($root->hasAttribute('cacheResult')) { |
931 | 931 | $result['cacheResult'] = $this->getBoolean( |
932 | - (string) $root->getAttribute('cacheResult'), |
|
932 | + (string)$root->getAttribute('cacheResult'), |
|
933 | 933 | false |
934 | 934 | ); |
935 | 935 | } |
936 | 936 | |
937 | 937 | if ($root->hasAttribute('cacheResultFile')) { |
938 | 938 | $result['cacheResultFile'] = $this->toAbsolutePath( |
939 | - (string) $root->getAttribute('cacheResultFile') |
|
939 | + (string)$root->getAttribute('cacheResultFile') |
|
940 | 940 | ); |
941 | 941 | } |
942 | 942 | |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | |
972 | 972 | if ($root->hasAttribute('resolveDependencies')) { |
973 | 973 | $result['resolveDependencies'] = $this->getBoolean( |
974 | - (string) $root->getAttribute('resolveDependencies'), |
|
974 | + (string)$root->getAttribute('resolveDependencies'), |
|
975 | 975 | false |
976 | 976 | ); |
977 | 977 | } |
@@ -1028,7 +1028,7 @@ discard block |
||
1028 | 1028 | $xsdFilename = __DIR__ . '/../../phpunit.xsd'; |
1029 | 1029 | |
1030 | 1030 | if (\defined('__PHPUNIT_PHAR_ROOT__')) { |
1031 | - $xsdFilename = __PHPUNIT_PHAR_ROOT__ . '/phpunit.xsd'; |
|
1031 | + $xsdFilename = __PHPUNIT_PHAR_ROOT__ . '/phpunit.xsd'; |
|
1032 | 1032 | } |
1033 | 1033 | |
1034 | 1034 | $this->document->schemaValidate($xsdFilename); |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | } |
1065 | 1065 | |
1066 | 1066 | if ($argument->tagName === 'file' || $argument->tagName === 'directory') { |
1067 | - $arguments[] = $this->toAbsolutePath((string) $argument->textContent); |
|
1067 | + $arguments[] = $this->toAbsolutePath((string)$argument->textContent); |
|
1068 | 1068 | } else { |
1069 | 1069 | $arguments[] = Xml::xmlToVariable($argument); |
1070 | 1070 | } |
@@ -1081,7 +1081,7 @@ discard block |
||
1081 | 1081 | { |
1082 | 1082 | if ($testSuiteNode->hasAttribute('name')) { |
1083 | 1083 | $suite = new TestSuite( |
1084 | - (string) $testSuiteNode->getAttribute('name') |
|
1084 | + (string)$testSuiteNode->getAttribute('name') |
|
1085 | 1085 | ); |
1086 | 1086 | } else { |
1087 | 1087 | $suite = new TestSuite; |
@@ -1090,7 +1090,7 @@ discard block |
||
1090 | 1090 | $exclude = []; |
1091 | 1091 | |
1092 | 1092 | foreach ($testSuiteNode->getElementsByTagName('exclude') as $excludeNode) { |
1093 | - $excludeFile = (string) $excludeNode->textContent; |
|
1093 | + $excludeFile = (string)$excludeNode->textContent; |
|
1094 | 1094 | |
1095 | 1095 | if ($excludeFile) { |
1096 | 1096 | $exclude[] = $this->toAbsolutePath($excludeFile); |
@@ -1106,7 +1106,7 @@ discard block |
||
1106 | 1106 | continue; |
1107 | 1107 | } |
1108 | 1108 | |
1109 | - $directory = (string) $directoryNode->textContent; |
|
1109 | + $directory = (string)$directoryNode->textContent; |
|
1110 | 1110 | |
1111 | 1111 | if (empty($directory)) { |
1112 | 1112 | continue; |
@@ -1120,11 +1120,11 @@ discard block |
||
1120 | 1120 | } |
1121 | 1121 | |
1122 | 1122 | if ($directoryNode->hasAttribute('prefix')) { |
1123 | - $prefix = (string) $directoryNode->getAttribute('prefix'); |
|
1123 | + $prefix = (string)$directoryNode->getAttribute('prefix'); |
|
1124 | 1124 | } |
1125 | 1125 | |
1126 | 1126 | if ($directoryNode->hasAttribute('suffix')) { |
1127 | - $suffix = (string) $directoryNode->getAttribute('suffix'); |
|
1127 | + $suffix = (string)$directoryNode->getAttribute('suffix'); |
|
1128 | 1128 | } |
1129 | 1129 | |
1130 | 1130 | $files = $fileIteratorFacade->getFilesAsArray( |
@@ -1143,7 +1143,7 @@ discard block |
||
1143 | 1143 | continue; |
1144 | 1144 | } |
1145 | 1145 | |
1146 | - $file = (string) $fileNode->textContent; |
|
1146 | + $file = (string)$fileNode->textContent; |
|
1147 | 1147 | |
1148 | 1148 | if (empty($file)) { |
1149 | 1149 | continue; |
@@ -1175,11 +1175,11 @@ discard block |
||
1175 | 1175 | $phpVersionOperator = '>='; |
1176 | 1176 | |
1177 | 1177 | if ($node->hasAttribute('phpVersion')) { |
1178 | - $phpVersion = (string) $node->getAttribute('phpVersion'); |
|
1178 | + $phpVersion = (string)$node->getAttribute('phpVersion'); |
|
1179 | 1179 | } |
1180 | 1180 | |
1181 | 1181 | if ($node->hasAttribute('phpVersionOperator')) { |
1182 | - $phpVersionOperator = (string) $node->getAttribute('phpVersionOperator'); |
|
1182 | + $phpVersionOperator = (string)$node->getAttribute('phpVersionOperator'); |
|
1183 | 1183 | } |
1184 | 1184 | |
1185 | 1185 | return \version_compare(\PHP_VERSION, $phpVersion, $phpVersionOperator); |
@@ -1210,7 +1210,7 @@ discard block |
||
1210 | 1210 | private function getInteger(string $value, int $default): int |
1211 | 1211 | { |
1212 | 1212 | if (\is_numeric($value)) { |
1213 | - return (int) $value; |
|
1213 | + return (int)$value; |
|
1214 | 1214 | } |
1215 | 1215 | |
1216 | 1216 | return $default; |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | |
1223 | 1223 | foreach ($this->xpath->query($query) as $directoryNode) { |
1224 | 1224 | /** @var DOMElement $directoryNode */ |
1225 | - $directoryPath = (string) $directoryNode->textContent; |
|
1225 | + $directoryPath = (string)$directoryNode->textContent; |
|
1226 | 1226 | |
1227 | 1227 | if (!$directoryPath) { |
1228 | 1228 | continue; |
@@ -1233,15 +1233,15 @@ discard block |
||
1233 | 1233 | $group = 'DEFAULT'; |
1234 | 1234 | |
1235 | 1235 | if ($directoryNode->hasAttribute('prefix')) { |
1236 | - $prefix = (string) $directoryNode->getAttribute('prefix'); |
|
1236 | + $prefix = (string)$directoryNode->getAttribute('prefix'); |
|
1237 | 1237 | } |
1238 | 1238 | |
1239 | 1239 | if ($directoryNode->hasAttribute('suffix')) { |
1240 | - $suffix = (string) $directoryNode->getAttribute('suffix'); |
|
1240 | + $suffix = (string)$directoryNode->getAttribute('suffix'); |
|
1241 | 1241 | } |
1242 | 1242 | |
1243 | 1243 | if ($directoryNode->hasAttribute('group')) { |
1244 | - $group = (string) $directoryNode->getAttribute('group'); |
|
1244 | + $group = (string)$directoryNode->getAttribute('group'); |
|
1245 | 1245 | } |
1246 | 1246 | |
1247 | 1247 | $directories[] = [ |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | $files = []; |
1264 | 1264 | |
1265 | 1265 | foreach ($this->xpath->query($query) as $file) { |
1266 | - $filePath = (string) $file->textContent; |
|
1266 | + $filePath = (string)$file->textContent; |
|
1267 | 1267 | |
1268 | 1268 | if ($filePath) { |
1269 | 1269 | $files[] = $this->toAbsolutePath($filePath); |
@@ -1319,11 +1319,11 @@ discard block |
||
1319 | 1319 | ]; |
1320 | 1320 | |
1321 | 1321 | foreach ($this->xpath->query($root . '/include/group') as $group) { |
1322 | - $groups['include'][] = (string) $group->textContent; |
|
1322 | + $groups['include'][] = (string)$group->textContent; |
|
1323 | 1323 | } |
1324 | 1324 | |
1325 | 1325 | foreach ($this->xpath->query($root . '/exclude/group') as $group) { |
1326 | - $groups['exclude'][] = (string) $group->textContent; |
|
1326 | + $groups['exclude'][] = (string)$group->textContent; |
|
1327 | 1327 | } |
1328 | 1328 | |
1329 | 1329 | return $groups; |
@@ -16,7 +16,7 @@ |
||
16 | 16 | $items = $this->getWhitelistItems($filterData); |
17 | 17 | |
18 | 18 | $files = \array_map( |
19 | - function ($item) { |
|
19 | + function($item) { |
|
20 | 20 | return \sprintf( |
21 | 21 | " '%s'", |
22 | 22 | $item |
@@ -402,7 +402,7 @@ |
||
402 | 402 | } |
403 | 403 | |
404 | 404 | $buffer .= TestFailure::exceptionToString($t) . "\n" . |
405 | - Filter::getFilteredStacktrace($t); |
|
405 | + Filter::getFilteredStacktrace($t); |
|
406 | 406 | |
407 | 407 | $fault = $this->document->createElement( |
408 | 408 | $type, |
@@ -386,6 +386,6 @@ |
||
386 | 386 | */ |
387 | 387 | private static function toMilliseconds(float $time): int |
388 | 388 | { |
389 | - return \round($time * 1000); |
|
389 | + return \round($time*1000); |
|
390 | 390 | } |
391 | 391 | } |
@@ -197,7 +197,7 @@ |
||
197 | 197 | $value = self::xmlToVariable($item); |
198 | 198 | |
199 | 199 | if ($entry->hasAttribute('key')) { |
200 | - $variable[(string) $entry->getAttribute('key')] = $value; |
|
200 | + $variable[(string)$entry->getAttribute('key')] = $value; |
|
201 | 201 | } else { |
202 | 202 | $variable[] = $value; |
203 | 203 | } |
@@ -385,9 +385,9 @@ discard block |
||
385 | 385 | } |
386 | 386 | |
387 | 387 | if (\is_numeric($code)) { |
388 | - $code = (int) $code; |
|
388 | + $code = (int)$code; |
|
389 | 389 | } elseif (\is_string($code) && \defined($code)) { |
390 | - $code = (int) \constant($code); |
|
390 | + $code = (int)\constant($code); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | return [ |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $numMatches = \count($matches[0]); |
548 | 548 | |
549 | 549 | for ($i = 0; $i < $numMatches; ++$i) { |
550 | - $annotations[$matches['name'][$i]][] = (string) $matches['value'][$i]; |
|
550 | + $annotations[$matches['name'][$i]][] = (string)$matches['value'][$i]; |
|
551 | 551 | } |
552 | 552 | } |
553 | 553 |
@@ -181,7 +181,7 @@ |
||
181 | 181 | |
182 | 182 | if (isset($data['times'])) { |
183 | 183 | foreach ($data['times'] as $testName => $testTime) { |
184 | - $this->times[$testName] = (float) $testTime; |
|
184 | + $this->times[$testName] = (float)$testTime; |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 |
@@ -615,7 +615,7 @@ |
||
615 | 615 | } |
616 | 616 | |
617 | 617 | foreach ($fileNames as $filename) { |
618 | - $this->addTestFile((string) $filename); |
|
618 | + $this->addTestFile((string)$filename); |
|
619 | 619 | } |
620 | 620 | } |
621 | 621 |