From f68e6cefd4abc974ea78b8b59c12775de9e23a35 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 2 Mar 2023 22:58:11 +0000 Subject: [PATCH] chore: type checking --- .../Command/WarmCodeCoverageCacheCommand.php | 15 ++++++++------- src/Plugins/Cache.php | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/overrides/TextUI/Command/WarmCodeCoverageCacheCommand.php b/overrides/TextUI/Command/WarmCodeCoverageCacheCommand.php index 42348229..7137b5b8 100644 --- a/overrides/TextUI/Command/WarmCodeCoverageCacheCommand.php +++ b/overrides/TextUI/Command/WarmCodeCoverageCacheCommand.php @@ -42,9 +42,9 @@ declare(strict_types=1); * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace PHPUnit\TextUI\Command; -use function printf; use PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry; use PHPUnit\TextUI\Configuration\Configuration; use PHPUnit\TextUI\Configuration\NoCoverageCacheDirectoryException; @@ -58,11 +58,12 @@ use SebastianBergmann\Timer\Timer; final class WarmCodeCoverageCacheCommand implements Command { private readonly Configuration $configuration; + private readonly CodeCoverageFilterRegistry $codeCoverageFilterRegistry; public function __construct(Configuration $configuration, CodeCoverageFilterRegistry $codeCoverageFilterRegistry) { - $this->configuration = $configuration; + $this->configuration = $configuration; $this->codeCoverageFilterRegistry = $codeCoverageFilterRegistry; } @@ -72,18 +73,18 @@ final class WarmCodeCoverageCacheCommand implements Command */ public function execute(): Result { - if (!$this->configuration->hasCoverageCacheDirectory()) { + if (! $this->configuration->hasCoverageCacheDirectory()) { return Result::from( - 'Cache for static analysis has not been configured' . PHP_EOL, + 'Cache for static analysis has not been configured'.PHP_EOL, Result::FAILURE ); } $this->codeCoverageFilterRegistry->init($this->configuration); - if (!$this->codeCoverageFilterRegistry->configured()) { + if (! $this->codeCoverageFilterRegistry->configured()) { return Result::from( - 'Filter for code coverage has not been configured' . PHP_EOL, + 'Filter for code coverage has not been configured'.PHP_EOL, Result::FAILURE ); } @@ -93,7 +94,7 @@ final class WarmCodeCoverageCacheCommand implements Command (new CacheWarmer)->warmCache( $this->configuration->coverageCacheDirectory(), - !$this->configuration->disableCodeCoverageIgnore(), + ! $this->configuration->disableCodeCoverageIgnore(), $this->configuration->ignoreDeprecatedCodeUnitsFromCodeCoverage(), $this->codeCoverageFilterRegistry->get() ); diff --git a/src/Plugins/Cache.php b/src/Plugins/Cache.php index b9413c63..f731e883 100644 --- a/src/Plugins/Cache.php +++ b/src/Plugins/Cache.php @@ -36,7 +36,7 @@ final class Cache implements HandlesArguments ); if (! $this->hasArgument('--parallel', $arguments)) { - $arguments = $this->pushArgument('--cache-result', $arguments); + return $this->pushArgument('--cache-result', $arguments); } return $arguments;