@@ -72,6 +72,6 @@ |
||
72 | 72 | $argumentValue->visitElement($object); |
73 | 73 | return $object; |
74 | 74 | } |
75 | - throw new InvalidArgumentException('Unsupported type: '. gettype($argumentValue)); |
|
75 | + throw new InvalidArgumentException('Unsupported type: ' . gettype($argumentValue)); |
|
76 | 76 | } |
77 | 77 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | return realpath($name); |
36 | 36 | } |
37 | 37 | |
38 | - $relativePath = $this->workingDir.DIRECTORY_SEPARATOR.$name; |
|
38 | + $relativePath = $this->workingDir . DIRECTORY_SEPARATOR . $name; |
|
39 | 39 | $glob = glob($relativePath); |
40 | 40 | if (file_exists($relativePath) || !empty($glob)) { |
41 | 41 | return realpath($relativePath); |
@@ -124,12 +124,12 @@ |
||
124 | 124 | $tokenCount = count($tokens); |
125 | 125 | foreach ($tokens as $index => $token) { |
126 | 126 | if (is_array($token) && $token[0] == Tokenizer::T_NEWLINE) { |
127 | - $lineNumber = $token[2] + 1; |
|
127 | + $lineNumber = $token[2]+1; |
|
128 | 128 | continue; |
129 | 129 | } |
130 | 130 | |
131 | 131 | if (is_array($token) && $token[0] == T_NAMESPACE) { |
132 | - for ($j=$index+1; $j<$tokenCount; $j++) { |
|
132 | + for ($j = $index+1; $j < $tokenCount; $j++) { |
|
133 | 133 | if ($tokens[$j][0] == T_STRING) { |
134 | 134 | $namespace .= '\\' . $tokens[$j][1]; |
135 | 135 | } elseif ($tokens[$j] == '{' || $tokens[$j] == ';') { |
@@ -39,16 +39,16 @@ |
||
39 | 39 | */ |
40 | 40 | private function guardFileExists($path) |
41 | 41 | { |
42 | - if (file_exists($path.self::FILE)) { |
|
43 | - return $path.self::FILE; |
|
42 | + if (file_exists($path . self::FILE)) { |
|
43 | + return $path . self::FILE; |
|
44 | 44 | } |
45 | - if (!file_exists($path.self::DIST)) { |
|
45 | + if (!file_exists($path . self::DIST)) { |
|
46 | 46 | throw new JsonConfigException(sprintf( |
47 | 47 | 'Configuration file does not exist: %s. Please create a humbug.json(.dist) file.', |
48 | - $path.self::DIST |
|
48 | + $path . self::DIST |
|
49 | 49 | )); |
50 | 50 | } |
51 | - return $path.self::DIST; |
|
51 | + return $path . self::DIST; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | PHP_EOL; |
35 | 35 | |
36 | 36 | foreach ($results as $index => $result) { |
37 | - $out[] = $index + 1 . ') ' . $this->prepareReportForMutant($result); |
|
37 | + $out[] = $index+1 . ') ' . $this->prepareReportForMutant($result); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | return implode(PHP_EOL, $out); |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | $processed = []; |
86 | 86 | foreach ($mutants as $index => $mutant) { |
87 | 87 | $mutation = $mutant->getMutation(); |
88 | - $uncovered = 'Mutator ' . $mutation->getMutator() . ' on ' . $mutation->getClass() . '::' . $mutation->getMethod() . '() in ' . $mutation->getFile(). ' on line ' . $mutation->getLine(); |
|
88 | + $uncovered = 'Mutator ' . $mutation->getMutator() . ' on ' . $mutation->getClass() . '::' . $mutation->getMethod() . '() in ' . $mutation->getFile() . ' on line ' . $mutation->getLine(); |
|
89 | 89 | if (in_array($uncovered, $processed)) { |
90 | 90 | continue; |
91 | 91 | } |
92 | 92 | $processed[] = $uncovered; |
93 | - $out[] = $index + 1 . ') ' . $uncovered; |
|
93 | + $out[] = $index+1 . ') ' . $uncovered; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | return implode(PHP_EOL, $out) . PHP_EOL . PHP_EOL; |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | $stats['total'] = $total; |
111 | 111 | $percent = []; |
112 | 112 | foreach ($stats as $section => $amount) { |
113 | - $percents[$section] = round((float)$amount / (float)$stats['total'] * 100); |
|
113 | + $percents[$section] = round((float) $amount / (float) $stats['total'] * 100); |
|
114 | 114 | } |
115 | - $percents['killed'] = 100 - $percents['escaped'] - $percents['errored'] - $percents['timeouts']; |
|
115 | + $percents['killed'] = 100-$percents['escaped']-$percents['errored']-$percents['timeouts']; |
|
116 | 116 | |
117 | 117 | return [ |
118 | 118 | 'amounts' => $stats, |
@@ -160,13 +160,13 @@ discard block |
||
160 | 160 | $fromStart = strspn($old ^ $new, "\0"); |
161 | 161 | $fromEnd = strspn(strrev($old) ^ strrev($new), "\0"); |
162 | 162 | |
163 | - $oldEnd = strlen($old) - $fromEnd; |
|
164 | - $newEnd = strlen($new) - $fromEnd; |
|
163 | + $oldEnd = strlen($old)-$fromEnd; |
|
164 | + $newEnd = strlen($new)-$fromEnd; |
|
165 | 165 | |
166 | 166 | $start = substr($new, 0, $fromStart); |
167 | 167 | $end = substr($new, $newEnd); |
168 | - $newDiff = substr($new, $fromStart, $newEnd - $fromStart); |
|
169 | - $oldDiff = substr($old, $fromStart, $oldEnd - $fromStart); |
|
168 | + $newDiff = substr($new, $fromStart, $newEnd-$fromStart); |
|
169 | + $oldDiff = substr($old, $fromStart, $oldEnd-$fromStart); |
|
170 | 170 | |
171 | 171 | if ($isOld) { |
172 | 172 | return '-' . $start . '%start%' . $oldDiff . '%end%' . $end; |
@@ -55,8 +55,8 @@ |
||
55 | 55 | */ |
56 | 56 | public function __construct(Process $process, $hasFailure, CoverageData $coverage = null, $lineCoverage) |
57 | 57 | { |
58 | - $this->hasFailure = (bool)$hasFailure; |
|
59 | - $this->exitCode = (int)$process->getExitCode(); |
|
58 | + $this->hasFailure = (bool) $hasFailure; |
|
59 | + $this->exitCode = (int) $process->getExitCode(); |
|
60 | 60 | $this->stdOut = $process->getOutput(); |
61 | 61 | $this->stdErr = $process->getErrorOutput(); |
62 | 62 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | $this->output->write(PHP_EOL . PHP_EOL); |
55 | 55 | } |
56 | 56 | |
57 | - if (! $result->isSuccess()) { |
|
57 | + if (!$result->isSuccess()) { |
|
58 | 58 | $this->renderer->renderInitialRunFail($result); |
59 | 59 | return; |
60 | 60 | } |
@@ -95,7 +95,7 @@ |
||
95 | 95 | AdapterAbstract $testFrameworkAdapter |
96 | 96 | ) { |
97 | 97 | $observers = $this->observers; |
98 | - $onProgressCallback = function ($count) use ($observers) { |
|
98 | + $onProgressCallback = function($count) use ($observers) { |
|
99 | 99 | foreach ($observers as $observer) { |
100 | 100 | $observer->onProgress($count); |
101 | 101 | } |