Skip to content

Commit

Permalink
chore: reworks code
Browse files Browse the repository at this point in the history
  • Loading branch information
tomloprod authored May 31, 2024
1 parent 2bde7b0 commit 9008e47
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"license": "MIT",
"require": {
"php": "^8.1",
"phpstan/phpstan": "^1.11.0",
"phpstan/phpstan": "^1.11.3",
"tomasvotruba/type-coverage": "^0.2.8",
"pestphp/pest-plugin": "^2.1.1"
},
Expand Down
35 changes: 18 additions & 17 deletions tests/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,31 @@ public function exit(int $code): never
expect(fn () => $plugin->handleArguments(['--type-coverage', '--type-coverage-json=test.json']))->toThrow(Exception::class, 0);

expect(__DIR__.'/../test.json')->toBeReadableFile();

expect(file_get_contents(__DIR__.'/../test.json'))->json()->toMatchArray([
'format' => 'pest',
'coverage-min' => 0,
'result' => [
[
'file' => 'src/PHPStanAnalyser.php',
'file' => 'src/TestCaseForTypeCoverage.php',
'uncoveredLines' => [],
'uncoveredLinesIgnored' => [],
'percentage' => 100,
],
[
'file' => 'src/TestCaseForTypeCoverage.php',
'file' => 'src/Analyser.php',
'uncoveredLines' => [],
'uncoveredLinesIgnored' => [],
'percentage' => 100,
],
[
'file' => 'src/Contracts/Logger.php',
'file' => 'src/PHPStanAnalyser.php',
'uncoveredLines' => [],
'uncoveredLinesIgnored' => [],
'percentage' => 100,
],
[
'file' => 'src/Plugin.php',
'file' => 'src/Support/ConfigurationSourceDetector.php',
'uncoveredLines' => [],
'uncoveredLinesIgnored' => [],
'percentage' => 100,
Expand All @@ -71,46 +72,46 @@ public function exit(int $code): never
'percentage' => 100,
],
[
'file' => 'src/Error.php',
'file' => 'src/Logging/JsonLogger.php',
'uncoveredLines' => [],
'uncoveredLinesIgnored' => [],
'percentage' => 100,
],
[
'file' => 'src/Support/ConfigurationSourceDetector.php',
'file' => 'src/Logging/NullLogger.php',
'uncoveredLines' => [],
'uncoveredLinesIgnored' => [],
'percentage' => 100,
],
[
'file' => 'src/Analyser.php',
'file' => 'src/Contracts/Logger.php',
'uncoveredLines' => [],
'uncoveredLinesIgnored' => [],
'percentage' => 100,
],
[
'file' => 'src/Logging/NullLogger.php',
'file' => 'src/Error.php',
'uncoveredLines' => [],
'uncoveredLinesIgnored' => [],
'percentage' => 100,
],
[
'file' => 'src/Logging/JsonLogger.php',
'file' => 'src/Plugin.php',
'uncoveredLines' => [],
'uncoveredLinesIgnored' => [],
'percentage' => 100,
],
[
'file' => 'tests/Fixtures/Properties.php',
'uncoveredLines' => ['pr12'],
'file' => 'tests/Fixtures/Parameters.php',
'uncoveredLines' => ['pa12'],
'uncoveredLinesIgnored' => [],
'percentage' => 83,
],
[
'file' => 'tests/Fixtures/All.php',
'uncoveredLines' => ['pr12', 'pa14', 'pa14', 'rt14'],
'file' => 'tests/Fixtures/Properties.php',
'uncoveredLines' => ['pr12'],
'uncoveredLinesIgnored' => [],
'percentage' => 0,
'percentage' => 83,
],
[
'file' => 'tests/Fixtures/ReturnType.php',
Expand All @@ -119,10 +120,10 @@ public function exit(int $code): never
'percentage' => 67,
],
[
'file' => 'tests/Fixtures/Parameters.php',
'uncoveredLines' => ['pa12'],
'file' => 'tests/Fixtures/All.php',
'uncoveredLines' => ['pr12', 'pa14', 'pa14', 'rt14'],
'uncoveredLinesIgnored' => [],
'percentage' => 83,
'percentage' => 0,
],
],
'total' => 88.07,
Expand Down

0 comments on commit 9008e47

Please sign in to comment.