@@ -63,10 +63,10 @@ |
||
63 | 63 | $seconds = floor(($timeInMilliseconds - $hoursInMilliseconds - $minutesInMilliseconds) / 1000); |
64 | 64 | $secondsInMilliseconds = $seconds * 1000; |
65 | 65 | $milliseconds = $timeInMilliseconds - $hoursInMilliseconds - $minutesInMilliseconds - $secondsInMilliseconds; |
66 | - $this->hours = (int) $hours; |
|
66 | + $this->hours = (int)$hours; |
|
67 | 67 | $this->minutes = $minutes; |
68 | - $this->seconds = (int) $seconds; |
|
69 | - $this->milliseconds = (int) $milliseconds; |
|
68 | + $this->seconds = (int)$seconds; |
|
69 | + $this->milliseconds = (int)$milliseconds; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | public function asNanoseconds(): float |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | public function start(): void |
23 | 23 | { |
24 | - $this->startTimes[] = (float) hrtime(true); |
|
24 | + $this->startTimes[] = (float)hrtime(true); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -35,6 +35,6 @@ discard block |
||
35 | 35 | ); |
36 | 36 | } |
37 | 37 | |
38 | - return Duration::fromNanoseconds((float) hrtime(true) - array_pop($this->startTimes)); |
|
38 | + return Duration::fromNanoseconds((float)hrtime(true) - array_pop($this->startTimes)); |
|
39 | 39 | } |
40 | 40 | } |
@@ -635,7 +635,7 @@ |
||
635 | 635 | } catch (\ReflectionException $e) { |
636 | 636 | throw new ReflectionException( |
637 | 637 | $e->getMessage(), |
638 | - (int) $e->getCode(), |
|
638 | + (int)$e->getCode(), |
|
639 | 639 | $e |
640 | 640 | ); |
641 | 641 | } |
@@ -60,7 +60,7 @@ |
||
60 | 60 | private function addItems(Directory $root, array $items, array $tests): void |
61 | 61 | { |
62 | 62 | foreach ($items as $key => $value) { |
63 | - $key = (string) $key; |
|
63 | + $key = (string)$key; |
|
64 | 64 | |
65 | 65 | if (substr($key, -2) === '/f') { |
66 | 66 | $key = substr($key, 0, -2); |
@@ -557,8 +557,8 @@ discard block |
||
557 | 557 | $this->functions[$functionName]['executedBranches'] = count( |
558 | 558 | array_filter( |
559 | 559 | $this->functionCoverageData[$functionName]['branches'], |
560 | - static function (array $branch) { |
|
561 | - return (bool) $branch['hit']; |
|
560 | + static function(array $branch) { |
|
561 | + return (bool)$branch['hit']; |
|
562 | 562 | } |
563 | 563 | ) |
564 | 564 | ); |
@@ -572,8 +572,8 @@ discard block |
||
572 | 572 | $this->functions[$functionName]['executedPaths'] = count( |
573 | 573 | array_filter( |
574 | 574 | $this->functionCoverageData[$functionName]['paths'], |
575 | - static function (array $path) { |
|
576 | - return (bool) $path['hit']; |
|
575 | + static function(array $path) { |
|
576 | + return (bool)$path['hit']; |
|
577 | 577 | } |
578 | 578 | ) |
579 | 579 | ); |
@@ -616,8 +616,8 @@ discard block |
||
616 | 616 | $methodData['executedBranches'] = count( |
617 | 617 | array_filter( |
618 | 618 | $this->functionCoverageData[$key]['branches'], |
619 | - static function (array $branch) { |
|
620 | - return (bool) $branch['hit']; |
|
619 | + static function(array $branch) { |
|
620 | + return (bool)$branch['hit']; |
|
621 | 621 | } |
622 | 622 | ) |
623 | 623 | ); |
@@ -631,8 +631,8 @@ discard block |
||
631 | 631 | $methodData['executedPaths'] = count( |
632 | 632 | array_filter( |
633 | 633 | $this->functionCoverageData[$key]['paths'], |
634 | - static function (array $path) { |
|
635 | - return (bool) $path['hit']; |
|
634 | + static function(array $path) { |
|
635 | + return (bool)$path['hit']; |
|
636 | 636 | } |
637 | 637 | ) |
638 | 638 | ); |
@@ -40,11 +40,11 @@ |
||
40 | 40 | public function asString(): string |
41 | 41 | { |
42 | 42 | if ($this->codeCoverage === 0.0) { |
43 | - return (string) ($this->cyclomaticComplexity ** 2 + $this->cyclomaticComplexity); |
|
43 | + return (string)($this->cyclomaticComplexity ** 2 + $this->cyclomaticComplexity); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | if ($this->codeCoverage >= 95) { |
47 | - return (string) $this->cyclomaticComplexity; |
|
47 | + return (string)$this->cyclomaticComplexity; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | return sprintf( |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | foreach ($classes as $className => $class) { |
75 | 75 | foreach ($class['methods'] as $methodName => $method) { |
76 | - $crapLoad = $this->crapLoad((float) $method['crap'], $method['ccn'], $method['coverage']); |
|
76 | + $crapLoad = $this->crapLoad((float)$method['crap'], $method['ccn'], $method['coverage']); |
|
77 | 77 | |
78 | 78 | $fullCrap += $method['crap']; |
79 | 79 | $fullCrapLoad += $crapLoad; |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | $methodNode->appendChild($document->createElement('methodName', $methodName)); |
95 | 95 | $methodNode->appendChild($document->createElement('methodSignature', htmlspecialchars($method['signature']))); |
96 | 96 | $methodNode->appendChild($document->createElement('fullMethod', htmlspecialchars($method['signature']))); |
97 | - $methodNode->appendChild($document->createElement('crap', (string) $this->roundValue((float) $method['crap']))); |
|
98 | - $methodNode->appendChild($document->createElement('complexity', (string) $method['ccn'])); |
|
99 | - $methodNode->appendChild($document->createElement('coverage', (string) $this->roundValue($method['coverage']))); |
|
100 | - $methodNode->appendChild($document->createElement('crapLoad', (string) round($crapLoad))); |
|
97 | + $methodNode->appendChild($document->createElement('crap', (string)$this->roundValue((float)$method['crap']))); |
|
98 | + $methodNode->appendChild($document->createElement('complexity', (string)$method['ccn'])); |
|
99 | + $methodNode->appendChild($document->createElement('coverage', (string)$this->roundValue($method['coverage']))); |
|
100 | + $methodNode->appendChild($document->createElement('crapLoad', (string)round($crapLoad))); |
|
101 | 101 | |
102 | 102 | $methodsNode->appendChild($methodNode); |
103 | 103 | } |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | $stats->appendChild($document->createElement('name', 'Method Crap Stats')); |
108 | - $stats->appendChild($document->createElement('methodCount', (string) $fullMethodCount)); |
|
109 | - $stats->appendChild($document->createElement('crapMethodCount', (string) $fullCrapMethodCount)); |
|
110 | - $stats->appendChild($document->createElement('crapLoad', (string) round($fullCrapLoad))); |
|
111 | - $stats->appendChild($document->createElement('totalCrap', (string) $fullCrap)); |
|
108 | + $stats->appendChild($document->createElement('methodCount', (string)$fullMethodCount)); |
|
109 | + $stats->appendChild($document->createElement('crapMethodCount', (string)$fullCrapMethodCount)); |
|
110 | + $stats->appendChild($document->createElement('crapLoad', (string)round($fullCrapLoad))); |
|
111 | + $stats->appendChild($document->createElement('totalCrap', (string)$fullCrap)); |
|
112 | 112 | |
113 | 113 | $crapMethodPercent = 0; |
114 | 114 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $crapMethodPercent = $this->roundValue((100 * $fullCrapMethodCount) / $fullMethodCount); |
117 | 117 | } |
118 | 118 | |
119 | - $stats->appendChild($document->createElement('crapMethodPercent', (string) $crapMethodPercent)); |
|
119 | + $stats->appendChild($document->createElement('crapMethodPercent', (string)$crapMethodPercent)); |
|
120 | 120 | |
121 | 121 | $root->appendChild($stats); |
122 | 122 | $root->appendChild($methodsNode); |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | private $contextNode; |
20 | 20 | |
21 | 21 | private $codeMap = [ |
22 | - -1 => 'UNKNOWN', // PHPUnit_Runner_BaseTestRunner::STATUS_UNKNOWN |
|
23 | - 0 => 'PASSED', // PHPUnit_Runner_BaseTestRunner::STATUS_PASSED |
|
24 | - 1 => 'SKIPPED', // PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED |
|
22 | + -1 => 'UNKNOWN', // PHPUnit_Runner_BaseTestRunner::STATUS_UNKNOWN |
|
23 | + 0 => 'PASSED', // PHPUnit_Runner_BaseTestRunner::STATUS_PASSED |
|
24 | + 1 => 'SKIPPED', // PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED |
|
25 | 25 | 2 => 'INCOMPLETE', // PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE |
26 | - 3 => 'FAILURE', // PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE |
|
27 | - 4 => 'ERROR', // PHPUnit_Runner_BaseTestRunner::STATUS_ERROR |
|
28 | - 5 => 'RISKY', // PHPUnit_Runner_BaseTestRunner::STATUS_RISKY |
|
29 | - 6 => 'WARNING', // PHPUnit_Runner_BaseTestRunner::STATUS_WARNING |
|
26 | + 3 => 'FAILURE', // PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE |
|
27 | + 4 => 'ERROR', // PHPUnit_Runner_BaseTestRunner::STATUS_ERROR |
|
28 | + 5 => 'RISKY', // PHPUnit_Runner_BaseTestRunner::STATUS_RISKY |
|
29 | + 6 => 'WARNING', // PHPUnit_Runner_BaseTestRunner::STATUS_WARNING |
|
30 | 30 | ]; |
31 | 31 | |
32 | 32 | public function __construct(DOMElement $context) |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $node->setAttribute('name', $test); |
47 | 47 | $node->setAttribute('size', $result['size']); |
48 | - $node->setAttribute('result', (string) $result['status']); |
|
49 | - $node->setAttribute('status', $this->codeMap[(int) $result['status']]); |
|
48 | + $node->setAttribute('result', (string)$result['status']); |
|
49 | + $node->setAttribute('status', $this->codeMap[(int)$result['status']]); |
|
50 | 50 | } |
51 | 51 | } |
@@ -30,14 +30,14 @@ |
||
30 | 30 | |
31 | 31 | public function setLines(int $start, int $executable, int $executed): void |
32 | 32 | { |
33 | - $this->contextNode->setAttribute('start', (string) $start); |
|
34 | - $this->contextNode->setAttribute('executable', (string) $executable); |
|
35 | - $this->contextNode->setAttribute('executed', (string) $executed); |
|
33 | + $this->contextNode->setAttribute('start', (string)$start); |
|
34 | + $this->contextNode->setAttribute('executable', (string)$executable); |
|
35 | + $this->contextNode->setAttribute('executed', (string)$executed); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function setCrap(float $crap): void |
39 | 39 | { |
40 | - $this->contextNode->setAttribute('crap', (string) $crap); |
|
40 | + $this->contextNode->setAttribute('crap', (string)$crap); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | public function setNamespace(string $namespace): void |