From c42541a3d9fc0db345b70fcf75c7dedb5681fed4 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 12 Jul 2023 21:09:40 +0100 Subject: [PATCH] chore: style changes --- overrides/Runner/ResultCache/DefaultResultCache.php | 2 +- src/Concerns/Pipeable.php | 2 +- src/Logging/TeamCity/Converter.php | 2 +- src/Logging/TeamCity/ServiceMessage.php | 4 ++-- src/Logging/TeamCity/TeamCityLogger.php | 2 +- src/Mixins/Expectation.php | 2 +- src/Repositories/DatasetsRepository.php | 2 +- src/Support/Closure.php | 2 +- src/TestCaseFilters/GitDirtyTestCaseFilter.php | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/overrides/Runner/ResultCache/DefaultResultCache.php b/overrides/Runner/ResultCache/DefaultResultCache.php index 640c3971..40134011 100644 --- a/overrides/Runner/ResultCache/DefaultResultCache.php +++ b/overrides/Runner/ResultCache/DefaultResultCache.php @@ -89,7 +89,7 @@ final class DefaultResultCache implements ResultCache */ private array $times = []; - public function __construct(?string $filepath = null) + public function __construct(string $filepath = null) { if ($filepath !== null && is_dir($filepath)) { $filepath .= DIRECTORY_SEPARATOR.self::DEFAULT_RESULT_CACHE_FILENAME; diff --git a/src/Concerns/Pipeable.php b/src/Concerns/Pipeable.php index 15102870..6d889f16 100644 --- a/src/Concerns/Pipeable.php +++ b/src/Concerns/Pipeable.php @@ -36,7 +36,7 @@ trait Pipeable /** * Register an interceptor that should replace an existing expectation. * - * @param string|Closure(mixed $value, mixed ...$arguments):bool $filter + * @param string|Closure(mixed $value, mixed ...$arguments):bool $filter */ public function intercept(string $name, string|Closure $filter, Closure $handler): void { diff --git a/src/Logging/TeamCity/Converter.php b/src/Logging/TeamCity/Converter.php index 336dc76b..2a2cce4f 100644 --- a/src/Logging/TeamCity/Converter.php +++ b/src/Logging/TeamCity/Converter.php @@ -153,7 +153,7 @@ final class Converter /** * Gets the test suite location. */ - public function getTestSuiteLocation(TestSuite $testSuite): string|null + public function getTestSuiteLocation(TestSuite $testSuite): ?string { $tests = $testSuite->tests()->asArray(); diff --git a/src/Logging/TeamCity/ServiceMessage.php b/src/Logging/TeamCity/ServiceMessage.php index e27f8013..1f3f2edf 100644 --- a/src/Logging/TeamCity/ServiceMessage.php +++ b/src/Logging/TeamCity/ServiceMessage.php @@ -9,7 +9,7 @@ namespace Pest\Logging\TeamCity; */ final class ServiceMessage { - private static int|null $flowId = null; + private static ?int $flowId = null; /** * @param array $parameters @@ -32,7 +32,7 @@ final class ServiceMessage return "##teamcity[$this->type$paramsToString]"; } - public static function testSuiteStarted(string $name, string|null $location): self + public static function testSuiteStarted(string $name, ?string $location): self { return new self('testSuiteStarted', [ 'name' => $name, diff --git a/src/Logging/TeamCity/TeamCityLogger.php b/src/Logging/TeamCity/TeamCityLogger.php index 5bbde518..92d35daf 100644 --- a/src/Logging/TeamCity/TeamCityLogger.php +++ b/src/Logging/TeamCity/TeamCityLogger.php @@ -60,7 +60,7 @@ final class TeamCityLogger public function __construct( private readonly OutputInterface $output, private readonly Converter $converter, - private readonly int|null $flowId, + private readonly ?int $flowId, private readonly bool $withoutDuration, ) { $this->registerSubscribers(); diff --git a/src/Mixins/Expectation.php b/src/Mixins/Expectation.php index 385b0e95..8ab46105 100644 --- a/src/Mixins/Expectation.php +++ b/src/Mixins/Expectation.php @@ -33,7 +33,7 @@ final class Expectation /** * The exporter instance, if any. */ - private Exporter|null $exporter = null; + private ?Exporter $exporter = null; /** * Creates a new expectation. diff --git a/src/Repositories/DatasetsRepository.php b/src/Repositories/DatasetsRepository.php index 07c4a42c..ead6b2b9 100644 --- a/src/Repositories/DatasetsRepository.php +++ b/src/Repositories/DatasetsRepository.php @@ -89,7 +89,7 @@ final class DatasetsRepository * @param array|string> $dataset * @return array|null */ - public static function resolve(array $dataset, string $currentTestFile): array|null + public static function resolve(array $dataset, string $currentTestFile): ?array { if ($dataset === []) { return null; diff --git a/src/Support/Closure.php b/src/Support/Closure.php index ebc8c769..a7b75f31 100644 --- a/src/Support/Closure.php +++ b/src/Support/Closure.php @@ -18,7 +18,7 @@ final class Closure * * @throws ShouldNotHappen */ - public static function bind(BaseClosure|null $closure, ?object $newThis, object|string|null $newScope = 'static'): BaseClosure + public static function bind(?BaseClosure $closure, ?object $newThis, object|string|null $newScope = 'static'): BaseClosure { if ($closure == null) { throw ShouldNotHappen::fromMessage('Could not bind null closure.'); diff --git a/src/TestCaseFilters/GitDirtyTestCaseFilter.php b/src/TestCaseFilters/GitDirtyTestCaseFilter.php index f881d9a3..88ef4985 100644 --- a/src/TestCaseFilters/GitDirtyTestCaseFilter.php +++ b/src/TestCaseFilters/GitDirtyTestCaseFilter.php @@ -16,7 +16,7 @@ final class GitDirtyTestCaseFilter implements TestCaseFilter /** * @var string[]|null */ - private array|null $changedFiles = null; + private ?array $changedFiles = null; public function __construct(private readonly string $projectRoot) {