@@ -13,6 +13,6 @@ |
||
| 13 | 13 | |
| 14 | 14 | public function isValid($line) |
| 15 | 15 | { |
| 16 | - return true; |
|
| 16 | + return true; |
|
| 17 | 17 | } |
| 18 | 18 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $extra = PHP_EOL; |
| 83 | 83 | |
| 84 | 84 | if ($lines['uncoveredLines']) { |
| 85 | - $extra = ', Missed lines '. |
|
| 85 | + $extra = ', Missed lines ' . |
|
| 86 | 86 | $extra . |
| 87 | 87 | print_r($lines['uncoveredLines'], true) |
| 88 | 88 | ; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | function addExceptionHandler() |
| 109 | 109 | { |
| 110 | 110 | set_exception_handler( |
| 111 | - function (Exception $exception) { |
|
| 111 | + function(Exception $exception) { |
|
| 112 | 112 | // @codeCoverageIgnoreStart |
| 113 | 113 | error_log(get_class($exception)); |
| 114 | 114 | error_log($exception->getMessage()); |
@@ -141,8 +141,7 @@ |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $message = isset($this->cache->coveredLines[$matchedFile][$line]) |
| 144 | - ? $this->cache->coveredLines[$matchedFile][$line] : |
|
| 145 | - "No cover" |
|
| 144 | + ? $this->cache->coveredLines[$matchedFile][$line] : "No cover" |
|
| 146 | 145 | ; |
| 147 | 146 | |
| 148 | 147 | $this->addUnCoveredLine( |
@@ -33,8 +33,7 @@ |
||
| 33 | 33 | protected function letterArg($name) |
| 34 | 34 | { |
| 35 | 35 | $name = strlen($name) == 1 ? |
| 36 | - "-" . $name : |
|
| 37 | - "--" . $name; |
|
| 36 | + "-" . $name : "--" . $name; |
|
| 38 | 37 | foreach ($this->args as $arg) { |
| 39 | 38 | if ($arg{0} == '-' && $name == $arg) { |
| 40 | 39 | return true; |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -spl_autoload_register(function ($className) { |
|
| 3 | +spl_autoload_register(function($className) { |
|
| 4 | 4 | $classPrefix = 'exussum12\CoverageChecker'; |
| 5 | 5 | if (strpos($className, $classPrefix) === 0) { |
| 6 | 6 | $classPrefix = str_replace("\\", "\\\\", $classPrefix); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | 'newFile' => [ |
| 32 | 32 | __DIR__ . '/fixtures/newFile.txt', |
| 33 | 33 | [ |
| 34 | - 'changedFile.php' => [1,2,3] |
|
| 34 | + 'changedFile.php' => [1, 2, 3] |
|
| 35 | 35 | ] |
| 36 | 36 | ], |
| 37 | 37 | 'lineChange' => [ |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | __DIR__ . '/fixtures/multiple.txt', |
| 45 | 45 | [ |
| 46 | 46 | 'changedFile.php' => [3], |
| 47 | - 'newFile.php' => [1,2,3] |
|
| 47 | + 'newFile.php' => [1, 2, 3] |
|
| 48 | 48 | ] |
| 49 | 49 | ], |
| 50 | 50 | 'removeFile' => [ |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | $lines = $phpmd->getLines(); |
| 13 | 13 | $file = '/full/path/to/file/src/CoverageCheck.php'; |
| 14 | 14 | $expected = [ |
| 15 | - $file => [ |
|
| 15 | + $file => [ |
|
| 16 | 16 | 56 => [ |
| 17 | 17 | 'The method addUnCoveredLine has a boolean flag argument ' . |
| 18 | 18 | '$message, which is a certain sign of a ' . |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | $lines = $phpmd->getLines(); |
| 13 | 13 | $file = '/full/path/to/file/src/CoverageCheck.php'; |
| 14 | 14 | $expected = [ |
| 15 | - $file => [ |
|
| 15 | + $file => [ |
|
| 16 | 16 | 56 => [ |
| 17 | 17 | 'The method addUnCoveredLine has a boolean flag argument ' . |
| 18 | 18 | '$message, which is a certain sign of a ' . |
@@ -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(XMLReport::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(XMLReport::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(XMLReport::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(XMLReport::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(XMLReport::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 = [ |