From c7e6df7c95320c4d70d5e935252e35fdbe181291 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sat, 15 Jul 2023 15:11:03 +0100 Subject: [PATCH] chore: coding style --- 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/PendingCalls/Concerns/Describable.php | 2 +- src/Repositories/DatasetsRepository.php | 2 +- src/Support/Closure.php | 2 +- src/TestCaseFilters/GitDirtyTestCaseFilter.php | 2 +- 10 files changed, 11 insertions(+), 11 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 a6fc2215..b90e601a 100644 --- a/src/Mixins/Expectation.php +++ b/src/Mixins/Expectation.php @@ -37,7 +37,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/PendingCalls/Concerns/Describable.php b/src/PendingCalls/Concerns/Describable.php index 4eac9d2d..bb013681 100644 --- a/src/PendingCalls/Concerns/Describable.php +++ b/src/PendingCalls/Concerns/Describable.php @@ -9,5 +9,5 @@ namespace Pest\PendingCalls\Concerns; */ trait Describable { - public string|null $describing = null; + public ?string $describing = null; } diff --git a/src/Repositories/DatasetsRepository.php b/src/Repositories/DatasetsRepository.php index 90ff9e3f..a43f1a84 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 dc4f20b3..a4620a91 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) {