Skip to content

Commit 5e41e54

Browse files
committed
chore: style changes
1 parent 6a8a4f3 commit 5e41e54

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+131
-131
lines changed

bin/worker.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
use Symfony\Component\Console\Output\OutputInterface;
1313

1414
$bootPest = (static function (): void {
15-
$workerArgv = new ArgvInput();
15+
$workerArgv = new ArgvInput;
1616

1717
$rootPath = dirname(PHPUNIT_COMPOSER_INSTALL, 2);
1818
$testSuite = TestSuite::getInstance($rootPath, $workerArgv->getParameterOption(
1919
'--test-directory',
2020
'tests'
2121
));
2222

23-
$input = new ArgvInput();
23+
$input = new ArgvInput;
2424

2525
$output = new ConsoleOutput(OutputInterface::VERBOSITY_NORMAL, true);
2626

src/Console/Thanks.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __invoke(): void
5050
$wantsToSupport = false;
5151

5252
if (getenv('PEST_NO_SUPPORT') !== 'true' && $this->input->isInteractive()) {
53-
$wantsToSupport = (new SymfonyQuestionHelper())->ask(
53+
$wantsToSupport = (new SymfonyQuestionHelper)->ask(
5454
new ArrayInput([]),
5555
$this->output,
5656
new ConfirmationQuestion(

src/Expectation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public static function hasMethod(string $name): bool
421421
*/
422422
public function any(): Any
423423
{
424-
return new Any();
424+
return new Any;
425425
}
426426

427427
/**

src/Factories/Concerns/HigherOrderable.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ trait HigherOrderable
2828
*/
2929
private function bootHigherOrderable(): void
3030
{
31-
$this->chains = new HigherOrderMessageCollection();
32-
$this->factoryProxies = new HigherOrderMessageCollection();
33-
$this->proxies = new HigherOrderMessageCollection();
31+
$this->chains = new HigherOrderMessageCollection;
32+
$this->factoryProxies = new HigherOrderMessageCollection;
33+
$this->proxies = new HigherOrderMessageCollection;
3434
}
3535
}

src/Factories/TestCaseFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function evaluate(string $filename, array $methods): void
154154
foreach ($classAvailableAttributes as $attribute) {
155155
$classAttributes = array_reduce(
156156
$methods,
157-
fn (array $carry, TestCaseMethodFactory $methodFactory): array => (new $attribute())->__invoke($methodFactory, $carry),
157+
fn (array $carry, TestCaseMethodFactory $methodFactory): array => (new $attribute)->__invoke($methodFactory, $carry),
158158
$classAttributes
159159
);
160160
}

src/Factories/TestCaseMethodFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ public function buildForEvaluation(array $annotationsToUse, array $attributesToU
138138
$attributes = [];
139139

140140
foreach ($annotationsToUse as $annotation) {
141-
$annotations = (new $annotation())->__invoke($this, $annotations);
141+
$annotations = (new $annotation)->__invoke($this, $annotations);
142142
}
143143

144144
foreach ($attributesToUse as $attribute) {
145-
$attributes = (new $attribute())->__invoke($this, $attributes);
145+
$attributes = (new $attribute)->__invoke($this, $attributes);
146146
}
147147

148148
if ($this->datasets !== [] || $this->repetitions > 1) {

src/Kernel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static function boot(TestSuite $testSuite, InputInterface $input, OutputI
6767
->add(Container::class, $container);
6868

6969
$kernel = new self(
70-
new Application(),
70+
new Application,
7171
$output,
7272
);
7373

src/Logging/Converter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class Converter
3636
public function __construct(
3737
private readonly string $rootPath,
3838
) {
39-
$this->stateGenerator = new StateGenerator();
39+
$this->stateGenerator = new StateGenerator;
4040
}
4141

4242
/**

src/Mixins/Expectation.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function toHaveSameSize(Countable|iterable $expected, string $message = '
314314
*
315315
* @return self<TValue>
316316
*/
317-
public function toHaveProperty(string $name, mixed $value = new Any(), string $message = ''): self
317+
public function toHaveProperty(string $name, mixed $value = new Any, string $message = ''): self
318318
{
319319
$this->toBeObject();
320320

@@ -654,7 +654,7 @@ public function toBeNull(string $message = ''): self
654654
*
655655
* @return self<TValue>
656656
*/
657-
public function toHaveKey(string|int $key, mixed $value = new Any(), string $message = ''): self
657+
public function toHaveKey(string|int $key, mixed $value = new Any, string $message = ''): self
658658
{
659659
if (is_object($this->value) && method_exists($this->value, 'toArray')) {
660660
$array = $this->value->toArray();

src/Panic.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private function handle(): void
4242
try {
4343
$output = Container::getInstance()->get(OutputInterface::class);
4444
} catch (Throwable) { // @phpstan-ignore-line
45-
$output = new ConsoleOutput();
45+
$output = new ConsoleOutput;
4646
}
4747

4848
assert($output instanceof OutputInterface);

src/PendingCalls/AfterEachCall.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(
3939
) {
4040
$this->closure = $closure instanceof Closure ? $closure : NullClosure::create();
4141

42-
$this->proxies = new HigherOrderMessageCollection();
42+
$this->proxies = new HigherOrderMessageCollection;
4343

4444
$this->describing = DescribeCall::describing();
4545
}

src/PendingCalls/BeforeEachCall.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public function __construct(
4444
) {
4545
$this->closure = $closure instanceof Closure ? $closure : NullClosure::create();
4646

47-
$this->testCallProxies = new HigherOrderMessageCollection();
48-
$this->testCaseProxies = new HigherOrderMessageCollection();
47+
$this->testCallProxies = new HigherOrderMessageCollection;
48+
$this->testCaseProxies = new HigherOrderMessageCollection;
4949

5050
$this->describing = DescribeCall::describing();
5151
}

src/PendingCalls/TestCall.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public function coversFunction(string ...$functions): self
369369
*/
370370
public function coversNothing(): self
371371
{
372-
$this->testCaseMethod->covers = [new CoversNothing()];
372+
$this->testCaseMethod->covers = [new CoversNothing];
373373

374374
return $this;
375375
}

src/Plugins/Help.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private function colorizeOptions(string $argument): string
9797
*/
9898
private function getContent(): array
9999
{
100-
$helpReflection = new PHPUnitHelp();
100+
$helpReflection = new PHPUnitHelp;
101101

102102
$content = (fn (): array => $this->elements())->call($helpReflection);
103103

src/Plugins/Parallel.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class Parallel implements HandlesArguments
4141
*/
4242
public static function isEnabled(): bool
4343
{
44-
$argv = new ArgvInput();
44+
$argv = new ArgvInput;
4545
if ($argv->hasParameterOption('--parallel')) {
4646
return true;
4747
}
@@ -126,7 +126,7 @@ private function runTestSuiteInParallel(array $arguments): int
126126
$arguments
127127
);
128128

129-
$exitCode = $this->paratestCommand()->run(new ArgvInput($filteredArguments), new CleanConsoleOutput());
129+
$exitCode = $this->paratestCommand()->run(new ArgvInput($filteredArguments), new CleanConsoleOutput);
130130

131131
return CallsAddsOutput::execute($exitCode);
132132
}
@@ -173,7 +173,7 @@ private function paratestCommand(): Application
173173
*/
174174
private function hasArgumentsThatWouldBeFasterWithoutParallel(): bool
175175
{
176-
$arguments = new ArgvInput();
176+
$arguments = new ArgvInput;
177177

178178
foreach (self::UNSUPPORTED_ARGUMENTS as $unsupportedArgument) {
179179
if ($arguments->hasParameterOption($unsupportedArgument)) {

src/Plugins/Parallel/Paratest/ResultPrinter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function printResults(TestResult $testResult, array $teamcityFiles, array
169169
return;
170170
}
171171

172-
$state = (new StateGenerator())->fromPhpUnitTestResult($this->passedTests, $testResult);
172+
$state = (new StateGenerator)->fromPhpUnitTestResult($this->passedTests, $testResult);
173173

174174
$this->compactPrinter->errors($state);
175175
$this->compactPrinter->recap($state, $testResult, $duration, $this->options);

src/Plugins/Parallel/Paratest/WrapperRunner.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ public function __construct(
9191
private readonly OutputInterface $output
9292
) {
9393
$this->printer = new ResultPrinter($output, $options);
94-
$this->timer = new Timer();
94+
$this->timer = new Timer;
9595

9696
$wrapper = realpath(
9797
dirname(__DIR__, 4).DIRECTORY_SEPARATOR.'bin'.DIRECTORY_SEPARATOR.'worker.php',
9898
);
9999
assert($wrapper !== false);
100-
$phpFinder = new PhpExecutableFinder();
100+
$phpFinder = new PhpExecutableFinder;
101101
$phpBin = $phpFinder->find(false);
102102
assert($phpBin !== false);
103103
$parameters = [$phpBin];
@@ -110,7 +110,7 @@ public function __construct(
110110
$parameters[] = $wrapper;
111111

112112
$this->parameters = $parameters;
113-
$this->codeCoverageFilterRegistry = new CodeCoverageFilterRegistry();
113+
$this->codeCoverageFilterRegistry = new CodeCoverageFilterRegistry;
114114
}
115115

116116
public function run(): int
@@ -357,7 +357,7 @@ private function generateCodeCoverageReports(): void
357357
return;
358358
}
359359

360-
$coverageManager = new CodeCoverage();
360+
$coverageManager = new CodeCoverage;
361361
$coverageManager->init(
362362
$this->options->configuration,
363363
$this->codeCoverageFilterRegistry,
@@ -389,8 +389,8 @@ private function generateLogs(): void
389389
return;
390390
}
391391

392-
$testSuite = (new LogMerger())->merge($this->junitFiles);
393-
(new Writer())->write(
392+
$testSuite = (new LogMerger)->merge($this->junitFiles);
393+
(new Writer)->write(
394394
$testSuite,
395395
$this->options->configuration->logfileJunit(),
396396
);

src/Support/Container.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class Container
2626
public static function getInstance(): self
2727
{
2828
if (! self::$instance instanceof \Pest\Support\Container) {
29-
self::$instance = new self();
29+
self::$instance = new self;
3030
}
3131

3232
return self::$instance;

src/Support/Coverage.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static function getPath(): string
3737
*/
3838
public static function isAvailable(): bool
3939
{
40-
$runtime = new Runtime();
40+
$runtime = new Runtime;
4141

4242
if (! $runtime->canCollectCodeCoverage()) {
4343
return false;
@@ -67,7 +67,7 @@ public static function isAvailable(): bool
6767
*/
6868
public static function usingXdebug(): bool
6969
{
70-
return (new Runtime())->hasXdebug();
70+
return (new Runtime)->hasXdebug();
7171
}
7272

7373
/**

src/Support/Exporter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(
3232
public static function default(): self
3333
{
3434
return new self(
35-
new BaseExporter()
35+
new BaseExporter
3636
);
3737
}
3838

@@ -47,7 +47,7 @@ public function shortenedRecursiveExport(array &$data, ?Context $context = null)
4747
$array = $data;
4848
$itemsCount = 0;
4949
$exporter = self::default();
50-
$context ??= new Context();
50+
$context ??= new Context;
5151

5252
$context->add($data);
5353

src/Support/StateGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class StateGenerator
2020
{
2121
public function fromPhpUnitTestResult(int $passedTests, PHPUnitTestResult $testResult): State
2222
{
23-
$state = new State();
23+
$state = new State;
2424

2525
foreach ($testResult->testErroredEvents() as $testResultEvent) {
2626
if ($testResultEvent instanceof Errored) {

src/TestCaseFilters/GitDirtyTestCaseFilter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private function loadChangedFiles(): void
7676
$dirtyFiles = array_values($dirtyFiles);
7777

7878
if ($dirtyFiles === []) {
79-
Panic::with(new NoDirtyTestsFound());
79+
Panic::with(new NoDirtyTestsFound);
8080
}
8181

8282
$this->changedFiles = $dirtyFiles;

src/TestSuite.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ public function __construct(
7171
string $rootPath,
7272
public string $testPath,
7373
) {
74-
$this->beforeAll = new BeforeAllRepository();
75-
$this->beforeEach = new BeforeEachRepository();
76-
$this->tests = new TestRepository();
77-
$this->afterEach = new AfterEachRepository();
78-
$this->afterAll = new AfterAllRepository();
74+
$this->beforeAll = new BeforeAllRepository;
75+
$this->beforeEach = new BeforeEachRepository;
76+
$this->tests = new TestRepository;
77+
$this->afterEach = new AfterEachRepository;
78+
$this->afterAll = new AfterAllRepository;
7979
$this->rootPath = (string) realpath($rootPath);
8080
$this->snapshots = new SnapshotRepository(
8181
implode(DIRECTORY_SEPARATOR, [$this->rootPath, $this->testPath]),
@@ -101,7 +101,7 @@ public static function getInstance(
101101
}
102102

103103
if (! self::$instance instanceof self) {
104-
Panic::with(new InvalidPestCommand());
104+
Panic::with(new InvalidPestCommand);
105105
}
106106

107107
return self::$instance;

tests/Features/AfterEach.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
$state = new stdClass();
3+
$state = new stdClass;
44

55
beforeEach(function () use ($state) {
66
$this->state = $state;

tests/Features/BeforeAll.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
$foo = new \stdClass();
3+
$foo = new \stdClass;
44
$foo->bar = 0;
55

66
beforeAll(function () use ($foo) {

tests/Features/Coverage.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
it('has plugin')->assertTrue(class_exists(CoveragePlugin::class));
88

99
it('adds coverage if --coverage exist', function () {
10-
$plugin = new CoveragePlugin(new ConsoleOutput());
10+
$plugin = new CoveragePlugin(new ConsoleOutput);
1111

1212
expect($plugin->coverage)->toBeFalse();
1313
$arguments = $plugin->handleArguments([]);
@@ -20,7 +20,7 @@
2020
})->skip(! \Pest\Support\Coverage::isAvailable() || ! function_exists('xdebug_info') || ! in_array('coverage', xdebug_info('mode'), true), 'Coverage is not available');
2121

2222
it('adds coverage if --min exist', function () {
23-
$plugin = new CoveragePlugin(new ConsoleOutput());
23+
$plugin = new CoveragePlugin(new ConsoleOutput);
2424
expect($plugin->coverageMin)->toEqual(0.0)
2525
->and($plugin->coverage)->toBeFalse();
2626

@@ -35,7 +35,7 @@
3535
});
3636

3737
it('generates coverage based on file input', function () {
38-
expect(Coverage::getMissingCoverage(new class()
38+
expect(Coverage::getMissingCoverage(new class
3939
{
4040
public function lineCoverageData(): array
4141
{

0 commit comments

Comments
 (0)