chore: style changes

This commit is contained in:
Nuno Maduro
2023-07-12 21:09:40 +01:00
parent 3f352605ca
commit c42541a3d9
9 changed files with 10 additions and 10 deletions

View File

@ -89,7 +89,7 @@ final class DefaultResultCache implements ResultCache
*/ */
private array $times = []; private array $times = [];
public function __construct(?string $filepath = null) public function __construct(string $filepath = null)
{ {
if ($filepath !== null && is_dir($filepath)) { if ($filepath !== null && is_dir($filepath)) {
$filepath .= DIRECTORY_SEPARATOR.self::DEFAULT_RESULT_CACHE_FILENAME; $filepath .= DIRECTORY_SEPARATOR.self::DEFAULT_RESULT_CACHE_FILENAME;

View File

@ -36,7 +36,7 @@ trait Pipeable
/** /**
* Register an interceptor that should replace an existing expectation. * 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 public function intercept(string $name, string|Closure $filter, Closure $handler): void
{ {

View File

@ -153,7 +153,7 @@ final class Converter
/** /**
* Gets the test suite location. * Gets the test suite location.
*/ */
public function getTestSuiteLocation(TestSuite $testSuite): string|null public function getTestSuiteLocation(TestSuite $testSuite): ?string
{ {
$tests = $testSuite->tests()->asArray(); $tests = $testSuite->tests()->asArray();

View File

@ -9,7 +9,7 @@ namespace Pest\Logging\TeamCity;
*/ */
final class ServiceMessage final class ServiceMessage
{ {
private static int|null $flowId = null; private static ?int $flowId = null;
/** /**
* @param array<string, string|int|null> $parameters * @param array<string, string|int|null> $parameters
@ -32,7 +32,7 @@ final class ServiceMessage
return "##teamcity[$this->type$paramsToString]"; 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', [ return new self('testSuiteStarted', [
'name' => $name, 'name' => $name,

View File

@ -60,7 +60,7 @@ final class TeamCityLogger
public function __construct( public function __construct(
private readonly OutputInterface $output, private readonly OutputInterface $output,
private readonly Converter $converter, private readonly Converter $converter,
private readonly int|null $flowId, private readonly ?int $flowId,
private readonly bool $withoutDuration, private readonly bool $withoutDuration,
) { ) {
$this->registerSubscribers(); $this->registerSubscribers();

View File

@ -33,7 +33,7 @@ final class Expectation
/** /**
* The exporter instance, if any. * The exporter instance, if any.
*/ */
private Exporter|null $exporter = null; private ?Exporter $exporter = null;
/** /**
* Creates a new expectation. * Creates a new expectation.

View File

@ -89,7 +89,7 @@ final class DatasetsRepository
* @param array<Closure|iterable<int|string, mixed>|string> $dataset * @param array<Closure|iterable<int|string, mixed>|string> $dataset
* @return array<string, mixed>|null * @return array<string, mixed>|null
*/ */
public static function resolve(array $dataset, string $currentTestFile): array|null public static function resolve(array $dataset, string $currentTestFile): ?array
{ {
if ($dataset === []) { if ($dataset === []) {
return null; return null;

View File

@ -18,7 +18,7 @@ final class Closure
* *
* @throws ShouldNotHappen * @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) { if ($closure == null) {
throw ShouldNotHappen::fromMessage('Could not bind null closure.'); throw ShouldNotHappen::fromMessage('Could not bind null closure.');

View File

@ -16,7 +16,7 @@ final class GitDirtyTestCaseFilter implements TestCaseFilter
/** /**
* @var string[]|null * @var string[]|null
*/ */
private array|null $changedFiles = null; private ?array $changedFiles = null;
public function __construct(private readonly string $projectRoot) public function __construct(private readonly string $projectRoot)
{ {