mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
chore: coding style
This commit is contained in:
@ -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;
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ namespace Pest\Logging\TeamCity;
|
||||
*/
|
||||
final class ServiceMessage
|
||||
{
|
||||
private static int|null $flowId = null;
|
||||
private static ?int $flowId = null;
|
||||
|
||||
/**
|
||||
* @param array<string, string|int|null> $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,
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -9,5 +9,5 @@ namespace Pest\PendingCalls\Concerns;
|
||||
*/
|
||||
trait Describable
|
||||
{
|
||||
public string|null $describing = null;
|
||||
public ?string $describing = null;
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ final class DatasetsRepository
|
||||
* @param array<Closure|iterable<int|string, mixed>|string> $dataset
|
||||
* @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 === []) {
|
||||
return null;
|
||||
|
||||
@ -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.');
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user