Skip to content

Commit

Permalink
Fix CS/WS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Sep 4, 2023
1 parent 5d4cc22 commit 6c8f26d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/cli/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private function printVersion(): void
{
printf(
'phpcov %s by Sebastian Bergmann.' . PHP_EOL,
(new Version(self::VERSION, dirname(__DIR__)))->asString()
(new Version(self::VERSION, dirname(__DIR__)))->asString(),
);
}
}
4 changes: 2 additions & 2 deletions src/cli/ArgumentsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ public function build(array $argv): Arguments
$options = (new CliParser)->parse(
$argv,
'hv',
$longOptions
$longOptions,
);
} catch (CliParserException $e) {
throw new ArgumentsBuilderException(
$e->getMessage(),
$e->getCode(),
$e
$e,
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/cli/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function handleConfiguration(CodeCoverage $coverage, Arguments $argume
$coverage->filter()->includeDirectory(
$directory->path(),
$directory->suffix(),
$directory->prefix()
$directory->prefix(),
);
}

Expand All @@ -63,7 +63,7 @@ protected function handleConfiguration(CodeCoverage $coverage, Arguments $argume
$coverage->filter()->excludeDirectory(
$directory->path(),
$directory->suffix(),
$directory->prefix()
$directory->prefix(),
);
}

Expand Down Expand Up @@ -136,7 +136,7 @@ protected function handleReports(CodeCoverage $coverage, Arguments $arguments):

file_put_contents(
$arguments->text(),
$writer->process($coverage)
$writer->process($coverage),
);

print 'done' . PHP_EOL;
Expand Down
2 changes: 1 addition & 1 deletion src/cli/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function run(Arguments $arguments): int
if (!is_file($arguments->script())) {
printf(
'File "%s" does not exist' . PHP_EOL,
$arguments->script()
$arguments->script(),
);

return 1;
Expand Down
6 changes: 3 additions & 3 deletions src/cli/MergeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function run(Arguments $arguments): int
if (!is_dir($arguments->directory())) {
printf(
'"%s" is not a directory' . PHP_EOL,
$arguments->directory()
$arguments->directory(),
);

return 1;
Expand All @@ -37,13 +37,13 @@ public function run(Arguments $arguments): int

$files = (new Facade)->getFilesAsArray(
$arguments->directory(),

Check failure on line 39 in src/cli/MergeCommand.php

View workflow job for this annotation

GitHub Actions / Type Checker

ArgumentTypeCoercion

src/cli/MergeCommand.php:39:13: ArgumentTypeCoercion: Argument 1 of SebastianBergmann\FileIterator\Facade::getFilesAsArray expects list<non-empty-string>|non-empty-string, but parent type null|string provided (see https://psalm.dev/193)
['.cov']
['.cov'],
);

if (empty($files)) {
printf(
'No "%s/*.cov" files found' . PHP_EOL,
realpath($arguments->directory())
realpath($arguments->directory()),
);

return 1;
Expand Down
12 changes: 6 additions & 6 deletions src/cli/PatchCoverageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function run(Arguments $arguments): int
if (!is_file($arguments->coverage())) {
printf(
'Code Coverage file "%s" does not exist' . PHP_EOL,
$arguments->coverage()
$arguments->coverage(),
);

return 255;
Expand All @@ -30,7 +30,7 @@ public function run(Arguments $arguments): int
if (!is_file($arguments->patch())) {
printf(
'Patch file "%s" does not exist' . PHP_EOL,
$arguments->patch()
$arguments->patch(),
);

return 255;
Expand All @@ -41,7 +41,7 @@ public function run(Arguments $arguments): int
$patchCoverage = (new PatchCoverage)->execute(
$arguments->coverage(),
$arguments->patch(),
$pathPrefix
$pathPrefix,
);

if ($patchCoverage['numChangedLinesThatWereExecuted'] === 0 &&
Expand All @@ -63,8 +63,8 @@ public function run(Arguments $arguments): int
$patchCoverage['numChangedLinesThatAreExecutable'],
$this->percentage(
$patchCoverage['numChangedLinesThatWereExecuted'],
$patchCoverage['numChangedLinesThatAreExecutable']
)
$patchCoverage['numChangedLinesThatAreExecutable'],
),
);

if (!empty($patchCoverage['changedLinesThatWereNotExecuted'])) {
Expand All @@ -75,7 +75,7 @@ public function run(Arguments $arguments): int
printf(
' %s:%d' . PHP_EOL,
$file,
$line
$line,
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/exceptions/RequiredArgumentMissingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public function __construct(string $argument)
parent::__construct(
sprintf(
'Required argument "%s" is missing',
$argument
)
$argument,
),
);
}
}
1 change: 1 addition & 0 deletions tests/fixture/example/src/autoload.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types=1);

/*
* This file is part of phpcov.
*
Expand Down

0 comments on commit 6c8f26d

Please sign in to comment.