@@ -209,7 +209,7 @@ |
||
| 209 | 209 | |
| 210 | 210 | $prefixes = ["C:$s", "$s"]; |
| 211 | 211 | |
| 212 | - foreach($prefixes as $p){ |
|
| 212 | + foreach ($prefixes as $p) { |
|
| 213 | 213 | yield [ |
| 214 | 214 | [ |
| 215 | 215 | "Money.php" => [] |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | foreach ($this->traits as &$trait) { |
| 377 | 377 | foreach ($trait['methods'] as &$method) { |
| 378 | 378 | if ($method['executableLines'] > 0) { |
| 379 | - $method['coverage'] = ($method['executedLines'] / |
|
| 380 | - $method['executableLines']) * 100; |
|
| 379 | + $method['coverage'] = ($method['executedLines']/ |
|
| 380 | + $method['executableLines'])*100; |
|
| 381 | 381 | } else { |
| 382 | 382 | $method['coverage'] = 100; |
| 383 | 383 | } |
@@ -393,8 +393,8 @@ discard block |
||
| 393 | 393 | unset($method); |
| 394 | 394 | |
| 395 | 395 | if ($trait['executableLines'] > 0) { |
| 396 | - $trait['coverage'] = ($trait['executedLines'] / |
|
| 397 | - $trait['executableLines']) * 100; |
|
| 396 | + $trait['coverage'] = ($trait['executedLines']/ |
|
| 397 | + $trait['executableLines'])*100; |
|
| 398 | 398 | |
| 399 | 399 | if ($trait['coverage'] === 100) { |
| 400 | 400 | $this->numTestedClasses++; |
@@ -414,8 +414,8 @@ discard block |
||
| 414 | 414 | foreach ($this->classes as &$class) { |
| 415 | 415 | foreach ($class['methods'] as &$method) { |
| 416 | 416 | if ($method['executableLines'] > 0) { |
| 417 | - $method['coverage'] = ($method['executedLines'] / |
|
| 418 | - $method['executableLines']) * 100; |
|
| 417 | + $method['coverage'] = ($method['executedLines']/ |
|
| 418 | + $method['executableLines'])*100; |
|
| 419 | 419 | } else { |
| 420 | 420 | $method['coverage'] = 100; |
| 421 | 421 | } |
@@ -431,8 +431,8 @@ discard block |
||
| 431 | 431 | unset($method); |
| 432 | 432 | |
| 433 | 433 | if ($class['executableLines'] > 0) { |
| 434 | - $class['coverage'] = ($class['executedLines'] / |
|
| 435 | - $class['executableLines']) * 100; |
|
| 434 | + $class['coverage'] = ($class['executedLines']/ |
|
| 435 | + $class['executableLines'])*100; |
|
| 436 | 436 | |
| 437 | 437 | if ($class['coverage'] === 100) { |
| 438 | 438 | $this->numTestedClasses++; |
@@ -451,8 +451,8 @@ discard block |
||
| 451 | 451 | |
| 452 | 452 | foreach ($this->functions as &$function) { |
| 453 | 453 | if ($function['executableLines'] > 0) { |
| 454 | - $function['coverage'] = ($function['executedLines'] / |
|
| 455 | - $function['executableLines']) * 100; |
|
| 454 | + $function['coverage'] = ($function['executedLines']/ |
|
| 455 | + $function['executableLines'])*100; |
|
| 456 | 456 | } else { |
| 457 | 457 | $function['coverage'] = 100; |
| 458 | 458 | } |
@@ -579,16 +579,16 @@ discard block |
||
| 579 | 579 | private function crap(int $ccn, float $coverage): string |
| 580 | 580 | { |
| 581 | 581 | if ($coverage === 0) { |
| 582 | - return (string) ($ccn ** 2 + $ccn); |
|
| 582 | + return (string)($ccn ** 2 + $ccn); |
|
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | if ($coverage >= 95) { |
| 586 | - return (string) $ccn; |
|
| 586 | + return (string)$ccn; |
|
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | return \sprintf( |
| 590 | 590 | '%01.2F', |
| 591 | - $ccn ** 2 * (1 - $coverage / 100) ** 3 + $ccn |
|
| 591 | + $ccn ** 2*(1 - $coverage/100) ** 3 + $ccn |
|
| 592 | 592 | ); |
| 593 | 593 | } |
| 594 | 594 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $percent = 100; |
| 27 | 27 | |
| 28 | 28 | if ($b > 0) { |
| 29 | - $percent = ($a / $b) * 100; |
|
| 29 | + $percent = ($a/$b)*100; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | if ($asString) { |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | $report->getNumMethods() |
| 104 | 104 | ); |
| 105 | 105 | |
| 106 | - $colors['lines'] = $this->getCoverageColor( |
|
| 106 | + $colors['lines'] = $this->getCoverageColor( |
|
| 107 | 107 | $report->getNumExecutedLines(), |
| 108 | 108 | $report->getNumExecutableLines() |
| 109 | 109 | ); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } elseif ($method['coverage'] === 100) { |
| 139 | 139 | $result['method']['100%']++; |
| 140 | 140 | } else { |
| 141 | - $key = \floor($method['coverage'] / 10) * 10; |
|
| 141 | + $key = \floor($method['coverage']/10)*10; |
|
| 142 | 142 | $key = $key . '-' . ($key + 10) . '%'; |
| 143 | 143 | $result['method'][$key]++; |
| 144 | 144 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | } elseif ($class['coverage'] === 100) { |
| 150 | 150 | $result['class']['100%']++; |
| 151 | 151 | } else { |
| 152 | - $key = \floor($class['coverage'] / 10) * 10; |
|
| 152 | + $key = \floor($class['coverage']/10)*10; |
|
| 153 | 153 | $key = $key . '-' . ($key + 10) . '%'; |
| 154 | 154 | $result['class'][$key]++; |
| 155 | 155 | } |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | protected function renderItemTemplate(\Text_Template $template, array $data): string |
| 64 | 64 | { |
| 65 | - $numSeparator = ' / '; |
|
| 65 | + $numSeparator = ' / '; |
|
| 66 | 66 | |
| 67 | 67 | if (isset($data['numClasses']) && $data['numClasses'] > 0) { |
| 68 | 68 | $classesLevel = $this->getColorLevel($data['testedClassesPercent']); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | $project = $document->createElement('project', \is_string($name) ? $name : ''); |
| 40 | 40 | $root->appendChild($project); |
| 41 | - $root->appendChild($document->createElement('timestamp', \date('Y-m-d H:i:s', (int) $_SERVER['REQUEST_TIME']))); |
|
| 41 | + $root->appendChild($document->createElement('timestamp', \date('Y-m-d H:i:s', (int)$_SERVER['REQUEST_TIME']))); |
|
| 42 | 42 | |
| 43 | 43 | $stats = $document->createElement('stats'); |
| 44 | 44 | $methodsNode = $document->createElement('methods'); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $crapMethodPercent = 0; |
| 106 | 106 | |
| 107 | 107 | if ($fullMethodCount > 0) { |
| 108 | - $crapMethodPercent = $this->roundValue((100 * $fullCrapMethodCount) / $fullMethodCount); |
|
| 108 | + $crapMethodPercent = $this->roundValue((100*$fullCrapMethodCount)/$fullMethodCount); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $stats->appendChild($document->createElement('crapMethodPercent', $crapMethodPercent)); |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | $crapLoad = 0; |
| 144 | 144 | |
| 145 | 145 | if ($crapValue >= $this->threshold) { |
| 146 | - $crapLoad += $cyclomaticComplexity * (1.0 - $coveragePercent / 100); |
|
| 147 | - $crapLoad += $cyclomaticComplexity / $this->threshold; |
|
| 146 | + $crapLoad += $cyclomaticComplexity*(1.0 - $coveragePercent/100); |
|
| 147 | + $crapLoad += $cyclomaticComplexity/$this->threshold; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | return $crapLoad; |
@@ -27,11 +27,11 @@ |
||
| 27 | 27 | $xmlDocument->formatOutput = true; |
| 28 | 28 | |
| 29 | 29 | $xmlCoverage = $xmlDocument->createElement('coverage'); |
| 30 | - $xmlCoverage->setAttribute('generated', (int) $_SERVER['REQUEST_TIME']); |
|
| 30 | + $xmlCoverage->setAttribute('generated', (int)$_SERVER['REQUEST_TIME']); |
|
| 31 | 31 | $xmlDocument->appendChild($xmlCoverage); |
| 32 | 32 | |
| 33 | 33 | $xmlProject = $xmlDocument->createElement('project'); |
| 34 | - $xmlProject->setAttribute('timestamp', (int) $_SERVER['REQUEST_TIME']); |
|
| 34 | + $xmlProject->setAttribute('timestamp', (int)$_SERVER['REQUEST_TIME']); |
|
| 35 | 35 | |
| 36 | 36 | if (\is_string($name)) { |
| 37 | 37 | $xmlProject->setAttribute('name', $name); |
@@ -14,14 +14,14 @@ discard block |
||
| 14 | 14 | private $contextNode; |
| 15 | 15 | |
| 16 | 16 | private $codeMap = [ |
| 17 | - -1 => 'UNKNOWN', // PHPUnit_Runner_BaseTestRunner::STATUS_UNKNOWN |
|
| 18 | - 0 => 'PASSED', // PHPUnit_Runner_BaseTestRunner::STATUS_PASSED |
|
| 19 | - 1 => 'SKIPPED', // PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED |
|
| 17 | + -1 => 'UNKNOWN', // PHPUnit_Runner_BaseTestRunner::STATUS_UNKNOWN |
|
| 18 | + 0 => 'PASSED', // PHPUnit_Runner_BaseTestRunner::STATUS_PASSED |
|
| 19 | + 1 => 'SKIPPED', // PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED |
|
| 20 | 20 | 2 => 'INCOMPLETE', // PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE |
| 21 | - 3 => 'FAILURE', // PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE |
|
| 22 | - 4 => 'ERROR', // PHPUnit_Runner_BaseTestRunner::STATUS_ERROR |
|
| 23 | - 5 => 'RISKY', // PHPUnit_Runner_BaseTestRunner::STATUS_RISKY |
|
| 24 | - 6 => 'WARNING', // PHPUnit_Runner_BaseTestRunner::STATUS_WARNING |
|
| 21 | + 3 => 'FAILURE', // PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE |
|
| 22 | + 4 => 'ERROR', // PHPUnit_Runner_BaseTestRunner::STATUS_ERROR |
|
| 23 | + 5 => 'RISKY', // PHPUnit_Runner_BaseTestRunner::STATUS_RISKY |
|
| 24 | + 6 => 'WARNING', // PHPUnit_Runner_BaseTestRunner::STATUS_WARNING |
|
| 25 | 25 | ]; |
| 26 | 26 | |
| 27 | 27 | public function __construct(\DOMElement $context) |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $node->setAttribute('name', $test); |
| 42 | 42 | $node->setAttribute('size', $result['size']); |
| 43 | - $node->setAttribute('result', (int) $result['status']); |
|
| 44 | - $node->setAttribute('status', $this->codeMap[(int) $result['status']]); |
|
| 43 | + $node->setAttribute('result', (int)$result['status']); |
|
| 44 | + $node->setAttribute('status', $this->codeMap[(int)$result['status']]); |
|
| 45 | 45 | } |
| 46 | 46 | } |