@@ -25,7 +25,7 @@ |
||
25 | 25 | ], |
26 | 26 | 'src/PhpCsLoader.php' => [ |
27 | 27 | 71 => 'Parameter $message of method ' . |
28 | - 'exussum12\CoverageChecker\PhpCsLoader::addInvalidLine() has '. |
|
28 | + 'exussum12\CoverageChecker\PhpCsLoader::addInvalidLine() has ' . |
|
29 | 29 | 'invalid typehint type exussum12\CoverageChecker\stdClass.', |
30 | 30 | ], |
31 | 31 | ]; |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $matches = []; |
85 | 85 | if (!preg_match($this->lineRegex, $line, $matches)) { |
86 | 86 | if (preg_match('#^\s{3,}#', $line)) { |
87 | - return $currentLineNumber; |
|
87 | + return $currentLineNumber; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return false; |
@@ -100,7 +100,7 @@ |
||
100 | 100 | |
101 | 101 | protected function trimLines() |
102 | 102 | { |
103 | - array_walk_recursive($this->invalidLines, function (&$item) { |
|
103 | + array_walk_recursive($this->invalidLines, function(&$item) { |
|
104 | 104 | if (is_string($item)) { |
105 | 105 | $item = trim($item); |
106 | 106 | } |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | $extra = PHP_EOL; |
84 | 84 | |
85 | 85 | if ($lines['uncoveredLines']) { |
86 | - $extra = ', Missed lines '. |
|
86 | + $extra = ', Missed lines ' . |
|
87 | 87 | $extra . |
88 | - generateOutput($lines['uncoveredLines']) . "\n" |
|
88 | + generateOutput($lines['uncoveredLines']) . "\n" |
|
89 | 89 | ; |
90 | 90 | } |
91 | 91 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | function addExceptionHandler() |
110 | 110 | { |
111 | 111 | set_exception_handler( |
112 | - function (Exception $exception) { |
|
112 | + function(Exception $exception) { |
|
113 | 113 | // @codeCoverageIgnoreStart |
114 | 114 | error_log($exception->getMessage()); |
115 | 115 | exit($exception->getCode()); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | { |
175 | 175 | $output = "Line $line:\n"; |
176 | 176 | if (!empty($message)) { |
177 | - foreach ((array)$message as $part) { |
|
177 | + foreach ((array) $message as $part) { |
|
178 | 178 | $output .= "\t$part\n"; |
179 | 179 | } |
180 | 180 | } |
@@ -76,7 +76,7 @@ |
||
76 | 76 | $end = $line->location->lines->end; |
77 | 77 | $message = $line->description; |
78 | 78 | |
79 | - for($lineNumber = $start; $lineNumber <= $end; $lineNumber++) { |
|
79 | + for ($lineNumber = $start; $lineNumber <= $end; $lineNumber++) { |
|
80 | 80 | $this->errors[$fileName][$lineNumber] = $message; |
81 | 81 | } |
82 | 82 | } |
@@ -76,6 +76,9 @@ |
||
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | + /** |
|
80 | + * @param string $codeClimateFormat |
|
81 | + */ |
|
79 | 82 | private function convertToJson($codeClimateFormat) |
80 | 83 | { |
81 | 84 | $codeClimateFormat = str_replace("\0", ',', $codeClimateFormat); |
@@ -14,23 +14,23 @@ discard block |
||
14 | 14 | $diffFileState = $this->createMock(DiffFileLoader::class); |
15 | 15 | $diffFileState->method('getChangedLines') |
16 | 16 | ->willReturn([ |
17 | - 'testFile1.php' => [1,2,3,4], |
|
18 | - 'testFile2.php' => [3,4] |
|
17 | + 'testFile1.php' => [1, 2, 3, 4], |
|
18 | + 'testFile2.php' => [3, 4] |
|
19 | 19 | |
20 | 20 | ]); |
21 | 21 | |
22 | 22 | $xmlReport = $this->createMock(CloverLoader::class); |
23 | 23 | $xmlReport->method('getLines') |
24 | 24 | ->willReturn([ |
25 | - '/full/path/to/testFile1.php' => [1 => 1,2 => 0,3 => 1,4 => 1], |
|
26 | - '/full/path/to/testFile2.php' => [3 => 1,4 => 0] |
|
25 | + '/full/path/to/testFile1.php' => [1 => 1, 2 => 0, 3 => 1, 4 => 1], |
|
26 | + '/full/path/to/testFile2.php' => [3 => 1, 4 => 0] |
|
27 | 27 | |
28 | 28 | ]); |
29 | 29 | |
30 | 30 | $xmlReport->method('isValidLine') |
31 | 31 | ->will( |
32 | 32 | $this->returnCallback( |
33 | - function () { |
|
33 | + function() { |
|
34 | 34 | $file = func_get_arg(0); |
35 | 35 | $line = func_get_arg(1); |
36 | 36 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'testFile2.php' => [4 => 0], |
55 | 55 | ]; |
56 | 56 | $coveredLines = [ |
57 | - 'testFile1.php' => [1,3,4], |
|
57 | + 'testFile1.php' => [1, 3, 4], |
|
58 | 58 | 'testFile2.php' => [3], |
59 | 59 | ]; |
60 | 60 | |
@@ -71,15 +71,15 @@ discard block |
||
71 | 71 | $diffFileState = $this->createMock(DiffFileLoader::class); |
72 | 72 | $diffFileState->method('getChangedLines') |
73 | 73 | ->willReturn([ |
74 | - 'testFile1.php' => [1,2,3,4], |
|
75 | - 'testFile2.php' => [3,4], |
|
74 | + 'testFile1.php' => [1, 2, 3, 4], |
|
75 | + 'testFile2.php' => [3, 4], |
|
76 | 76 | |
77 | 77 | ]); |
78 | 78 | |
79 | 79 | $xmlReport = $this->createMock(CloverLoader::class); |
80 | 80 | $xmlReport->method('getLines') |
81 | 81 | ->willReturn([ |
82 | - '/full/path/to/testFile1.php' => [1 => 1,2 => 0,3 => 1,4 => 1], |
|
82 | + '/full/path/to/testFile1.php' => [1 => 1, 2 => 0, 3 => 1, 4 => 1], |
|
83 | 83 | |
84 | 84 | ]); |
85 | 85 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $xmlReport->method('isValidLine') |
90 | 90 | ->will( |
91 | 91 | $this->returnCallback( |
92 | - function () { |
|
92 | + function() { |
|
93 | 93 | $file = func_get_arg(0); |
94 | 94 | $line = func_get_arg(1); |
95 | 95 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'testFile1.php' => [2 => 0], |
111 | 111 | ]; |
112 | 112 | $coveredLines = [ |
113 | - 'testFile1.php' => [1,3,4], |
|
113 | + 'testFile1.php' => [1, 3, 4], |
|
114 | 114 | ]; |
115 | 115 | |
116 | 116 | $expected = [ |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | $diffFileState = $this->createMock(DiffFileLoader::class); |
127 | 127 | $diffFileState->method('getChangedLines') |
128 | 128 | ->willReturn([ |
129 | - 'testFile1.php' => [1,2,3,4], |
|
130 | - 'testFile2.php' => [3,4], |
|
129 | + 'testFile1.php' => [1, 2, 3, 4], |
|
130 | + 'testFile2.php' => [3, 4], |
|
131 | 131 | |
132 | 132 | ]); |
133 | 133 | |
134 | 134 | $xmlReport = $this->createMock(CloverLoader::class); |
135 | 135 | $xmlReport->method('getLines') |
136 | 136 | ->willReturn([ |
137 | - '/full/path/to/testFile1.php' => [1 => 1,2 => 0,3 => 1,4 => 1], |
|
137 | + '/full/path/to/testFile1.php' => [1 => 1, 2 => 0, 3 => 1, 4 => 1], |
|
138 | 138 | |
139 | 139 | ]); |
140 | 140 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $xmlReport->method('isValidLine') |
145 | 145 | ->will( |
146 | 146 | $this->returnCallback( |
147 | - function () { |
|
147 | + function() { |
|
148 | 148 | $file = func_get_arg(0); |
149 | 149 | $line = func_get_arg(1); |
150 | 150 | |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | 'testFile1.php' => [2 => 0], |
166 | 166 | ]; |
167 | 167 | $coveredLines = [ |
168 | - 'testFile1.php' => [1,3,4], |
|
169 | - 'testFile2.php' => [3,4], |
|
168 | + 'testFile1.php' => [1, 3, 4], |
|
169 | + 'testFile2.php' => [3, 4], |
|
170 | 170 | ]; |
171 | 171 | |
172 | 172 | $expected = [ |
@@ -182,15 +182,15 @@ discard block |
||
182 | 182 | $diffFileState = $this->createMock(DiffFileLoader::class); |
183 | 183 | $diffFileState->method('getChangedLines') |
184 | 184 | ->willReturn([ |
185 | - 'testFile1.php' => [1,2,3,4], |
|
186 | - 'testFile2.php' => [3,4], |
|
185 | + 'testFile1.php' => [1, 2, 3, 4], |
|
186 | + 'testFile2.php' => [3, 4], |
|
187 | 187 | |
188 | 188 | ]); |
189 | 189 | |
190 | 190 | $xmlReport = $this->createMock(CloverLoader::class); |
191 | 191 | $xmlReport->method('getLines') |
192 | 192 | ->willReturn([ |
193 | - '/full/path/to/testFile1.php' => [1 => 1,2 => 0,3 => 1,4 => 1], |
|
193 | + '/full/path/to/testFile1.php' => [1 => 1, 2 => 0, 3 => 1, 4 => 1], |
|
194 | 194 | |
195 | 195 | ]); |
196 | 196 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $xmlReport->method('isValidLine') |
201 | 201 | ->will( |
202 | 202 | $this->returnCallback( |
203 | - function () { |
|
203 | + function() { |
|
204 | 204 | $file = func_get_arg(0); |
205 | 205 | $line = func_get_arg(1); |
206 | 206 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | 'testFile2.php' => [3 => 0, 4 => 0], |
223 | 223 | ]; |
224 | 224 | $coveredLines = [ |
225 | - 'testFile1.php' => [1,3,4], |
|
225 | + 'testFile1.php' => [1, 3, 4], |
|
226 | 226 | ]; |
227 | 227 | |
228 | 228 | $expected = [ |
@@ -238,14 +238,14 @@ discard block |
||
238 | 238 | $diffFileState = $this->createMock(DiffFileLoader::class); |
239 | 239 | $diffFileState->method('getChangedLines') |
240 | 240 | ->willReturn([ |
241 | - 'testFile1.php' => [1,2,4], |
|
241 | + 'testFile1.php' => [1, 2, 4], |
|
242 | 242 | |
243 | 243 | ]); |
244 | 244 | |
245 | 245 | $xmlReport = $this->createMock(CloverLoader::class); |
246 | 246 | $xmlReport->method('getLines') |
247 | 247 | ->willReturn([ |
248 | - '/full/path/to/testFile1.php' => [1 => 1,4 => 1], |
|
248 | + '/full/path/to/testFile1.php' => [1 => 1, 4 => 1], |
|
249 | 249 | |
250 | 250 | ]); |
251 | 251 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $xmlReport->method('isValidLine') |
256 | 256 | ->will( |
257 | 257 | $this->returnCallback( |
258 | - function () { |
|
258 | + function() { |
|
259 | 259 | $file = func_get_arg(0); |
260 | 260 | $line = func_get_arg(1); |
261 | 261 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $lines = $coverageCheck->getCoveredLines(); |
274 | 274 | |
275 | 275 | $coveredLines = [ |
276 | - 'testFile1.php' => [1,4], |
|
276 | + 'testFile1.php' => [1, 4], |
|
277 | 277 | ]; |
278 | 278 | |
279 | 279 | $expected = [ |