From 3ffed844a62ab43ee47eca99fa307fa9b81d706c Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Tue, 8 Mar 2022 10:51:38 +0000 Subject: [PATCH] style: apply fixes from PHP-CS-Fixer --- src/Concerns/Pipeable.php | 2 +- src/Expectation.php | 2 +- src/Kernel.php | 2 +- src/Mixins/Expectation.php | 6 +++--- src/Repositories/DatasetsRepository.php | 6 +++--- src/Support/Container.php | 2 +- src/Support/HigherOrderMessageCollection.php | 2 +- tests/Features/Coverage.php | 2 +- tests/Features/Expect/pipes.php | 10 +++++----- tests/Features/Expect/toBe.php | 2 +- tests/Features/Expect/toHaveProperties.php | 10 +++++----- tests/Features/Expect/unless.php | 4 ++-- tests/Features/Expect/when.php | 4 ++-- tests/Unit/Support/Reflection.php | 2 +- tests/Unit/TestSuite.php | 6 +++--- tests/Visual/Help.php | 2 +- tests/Visual/Success.php | 2 +- 17 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/Concerns/Pipeable.php b/src/Concerns/Pipeable.php index 79f32055..d1df162e 100644 --- a/src/Concerns/Pipeable.php +++ b/src/Concerns/Pipeable.php @@ -43,7 +43,7 @@ trait Pipeable $this->pipe($name, function ($next, ...$arguments) use ($handler, $filter) { /* @phpstan-ignore-next-line */ if ($filter($this->value, ...$arguments)) { - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line $handler->bindTo($this, get_class($this))(...$arguments); return; diff --git a/src/Expectation.php b/src/Expectation.php index 1099daff..fd771e41 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -307,7 +307,7 @@ final class Expectation private function getExpectationClosure(string $name): Closure { if (method_exists(Mixins\Expectation::class, $name)) { - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line return Closure::fromCallable([new Mixins\Expectation($this->value), $name]); } diff --git a/src/Kernel.php b/src/Kernel.php index 67c4dcf9..98bf867c 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -37,7 +37,7 @@ final class Kernel public static function boot(): self { foreach (self::$bootstrappers as $bootstrapper) { - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line (new $bootstrapper())->__invoke(); } diff --git a/src/Mixins/Expectation.php b/src/Mixins/Expectation.php index 5823d61c..337cc9cc 100644 --- a/src/Mixins/Expectation.php +++ b/src/Mixins/Expectation.php @@ -283,7 +283,7 @@ final class Expectation { $this->toBeObject(); - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line Assert::assertTrue(property_exists($this->value, $name)); if (func_num_args() > 1) { @@ -534,7 +534,7 @@ final class Expectation { Assert::assertIsString($this->value); - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line Assert::assertJson($this->value); return $this; @@ -580,7 +580,7 @@ final class Expectation try { Assert::assertTrue(Arr::has($array, $key)); - /* @phpstan-ignore-next-line */ + /* @phpstan-ignore-next-line */ } catch (ExpectationFailedException $exception) { throw new ExpectationFailedException("Failed asserting that an array has the key '$key'", $exception->getComparisonFailure()); } diff --git a/src/Repositories/DatasetsRepository.php b/src/Repositories/DatasetsRepository.php index d8a57bfa..385d4d47 100644 --- a/src/Repositories/DatasetsRepository.php +++ b/src/Repositories/DatasetsRepository.php @@ -156,11 +156,11 @@ final class DatasetsRepository $datasets[$index] = iterator_to_array($datasets[$index]); } - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line foreach ($datasets[$index] as $key => $values) { $values = is_array($values) ? $values : [$values]; $processedDataset[] = [ - 'label' => self::getDatasetDescription($key, $values), //@phpstan-ignore-line + 'label' => self::getDatasetDescription($key, $values), // @phpstan-ignore-line 'values' => $values, ]; } @@ -189,7 +189,7 @@ final class DatasetsRepository $result = $tmp; } - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line return $result; } diff --git a/src/Support/Container.php b/src/Support/Container.php index 1f6b45cd..67cd4e39 100644 --- a/src/Support/Container.php +++ b/src/Support/Container.php @@ -85,7 +85,7 @@ final class Container } } - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line return $this->get($candidate); }, $constructor->getParameters() diff --git a/src/Support/HigherOrderMessageCollection.php b/src/Support/HigherOrderMessageCollection.php index 54bef82a..6d4bca2b 100644 --- a/src/Support/HigherOrderMessageCollection.php +++ b/src/Support/HigherOrderMessageCollection.php @@ -40,7 +40,7 @@ final class HigherOrderMessageCollection public function chain(object $target): void { foreach ($this->messages as $message) { - //@phpstan-ignore-next-line + // @phpstan-ignore-next-line $target = $message->call($target) ?? $target; } } diff --git a/tests/Features/Coverage.php b/tests/Features/Coverage.php index e43ae180..7af61548 100644 --- a/tests/Features/Coverage.php +++ b/tests/Features/Coverage.php @@ -8,7 +8,7 @@ use Symfony\Component\Console\Output\ConsoleOutput; it('has plugin')->assertTrue(class_exists(CoveragePlugin::class)); it('adds coverage if --coverage exist', function () { - $plugin = new CoveragePlugin(new ConsoleOutput()); + $plugin = new CoveragePlugin(new ConsoleOutput()); $testSuite = TestSuite::getInstance(); expect($plugin->coverage)->toBeFalse(); diff --git a/tests/Features/Expect/pipes.php b/tests/Features/Expect/pipes.php index 5e311e07..25723f68 100644 --- a/tests/Features/Expect/pipes.php +++ b/tests/Features/Expect/pipes.php @@ -12,7 +12,7 @@ class Number public function __construct( public int $value ) { - //.. + // .. } } @@ -21,7 +21,7 @@ class Char public function __construct( public string $value ) { - //.. + // .. } } @@ -30,7 +30,7 @@ class Symbol public function __construct( public string $value ) { - //.. + // .. } } @@ -69,11 +69,11 @@ expect()->pipe('toBe', function ($next, $expected) use ($state) { assertInstanceOf(Char::class, $expected); assertEquals($this->value->value, $expected->value); - //returning nothing stops pipeline execution + // returning nothing stops pipeline execution return; } - //calling $next(); let the pipeline to keep running + // calling $next(); let the pipeline to keep running $next(); }); diff --git a/tests/Features/Expect/toBe.php b/tests/Features/Expect/toBe.php index ef2bce5a..d73760b3 100644 --- a/tests/Features/Expect/toBe.php +++ b/tests/Features/Expect/toBe.php @@ -5,7 +5,7 @@ use PHPUnit\Framework\ExpectationFailedException; expect(true)->toBeTrue()->and(false)->toBeFalse(); test('strict comparisons', function () { - $nuno = new stdClass(); + $nuno = new stdClass(); $dries = new stdClass(); expect($nuno)->toBe($nuno)->not->toBe($dries); diff --git a/tests/Features/Expect/toHaveProperties.php b/tests/Features/Expect/toHaveProperties.php index ad3da1b0..aae1303c 100644 --- a/tests/Features/Expect/toHaveProperties.php +++ b/tests/Features/Expect/toHaveProperties.php @@ -3,24 +3,24 @@ use PHPUnit\Framework\ExpectationFailedException; test('pass', function () { - $object = new stdClass(); + $object = new stdClass(); $object->name = 'Jhon'; - $object->age = 21; + $object->age = 21; expect($object)->toHaveProperties(['name', 'age']); }); test('failures', function () { - $object = new stdClass(); + $object = new stdClass(); $object->name = 'Jhon'; expect($object)->toHaveProperties(['name', 'age']); })->throws(ExpectationFailedException::class); test('not failures', function () { - $object = new stdClass(); + $object = new stdClass(); $object->name = 'Jhon'; - $object->age = 21; + $object->age = 21; expect($object)->not->toHaveProperties(['name', 'age']); })->throws(ExpectationFailedException::class); diff --git a/tests/Features/Expect/unless.php b/tests/Features/Expect/unless.php index 9f11c7ef..0dabe2bb 100644 --- a/tests/Features/Expect/unless.php +++ b/tests/Features/Expect/unless.php @@ -3,9 +3,9 @@ use PHPUnit\Framework\ExpectationFailedException; beforeEach(function () { - $this->unlessObject = new stdClass(); + $this->unlessObject = new stdClass(); $this->unlessObject->trueValue = true; - $this->unlessObject->foo = 'foo'; + $this->unlessObject->foo = 'foo'; }); it('pass', function () { diff --git a/tests/Features/Expect/when.php b/tests/Features/Expect/when.php index db9fa4f1..3b62e2f8 100644 --- a/tests/Features/Expect/when.php +++ b/tests/Features/Expect/when.php @@ -3,9 +3,9 @@ use PHPUnit\Framework\ExpectationFailedException; beforeEach(function () { - $this->whenObject = new stdClass(); + $this->whenObject = new stdClass(); $this->whenObject->trueValue = true; - $this->whenObject->foo = 'foo'; + $this->whenObject->foo = 'foo'; }); it('pass', function () { diff --git a/tests/Unit/Support/Reflection.php b/tests/Unit/Support/Reflection.php index 7ad76b0d..7e98bd76 100644 --- a/tests/Unit/Support/Reflection.php +++ b/tests/Unit/Support/Reflection.php @@ -10,7 +10,7 @@ it('gets file name from closure', function () { }); it('gets property values', function () { - $class = new class() { + $class = new class() { private $foo = 'bar'; }; diff --git a/tests/Unit/TestSuite.php b/tests/Unit/TestSuite.php index a15ad631..807594be 100644 --- a/tests/Unit/TestSuite.php +++ b/tests/Unit/TestSuite.php @@ -8,7 +8,7 @@ use Pest\TestSuite; it('does not allow to add the same test description twice', function () { $testSuite = new TestSuite(getcwd(), 'tests'); - $method = new TestCaseMethodFactory('foo', 'bar', null); + $method = new TestCaseMethodFactory('foo', 'bar', null); $testSuite->tests->set($method); $testSuite->tests->set($method); @@ -43,7 +43,7 @@ it('can return an array of all test suite filenames', function () { it('can filter the test suite filenames to those with the only method', function () { $testSuite = new TestSuite(getcwd(), 'tests'); - $testWithOnly = new TestCaseMethodFactory('a', 'b', null); + $testWithOnly = new TestCaseMethodFactory('a', 'b', null); $testWithOnly->only = true; $testSuite->tests->set($testWithOnly); @@ -61,7 +61,7 @@ it('does not filter the test suite filenames to those with the only method when $test = function () {}; - $testWithOnly = new TestCaseMethodFactory('a', 'b', null); + $testWithOnly = new TestCaseMethodFactory('a', 'b', null); $testWithOnly->only = true; $testSuite->tests->set($testWithOnly); diff --git a/tests/Visual/Help.php b/tests/Visual/Help.php index e015108f..8088f9d3 100644 --- a/tests/Visual/Help.php +++ b/tests/Visual/Help.php @@ -8,7 +8,7 @@ test('visual snapshot of help command output', function () { if (getenv('REBUILD_SNAPSHOTS')) { $outputBuffer = new BufferedOutput(); - $plugin = new Help($outputBuffer); + $plugin = new Help($outputBuffer); $plugin(); diff --git a/tests/Visual/Success.php b/tests/Visual/Success.php index 4885255e..c64344f5 100644 --- a/tests/Visual/Success.php +++ b/tests/Visual/Success.php @@ -2,7 +2,7 @@ test('visual snapshot of test suite on success', function () { $testsPath = dirname(__DIR__); - $snapshot = implode(DIRECTORY_SEPARATOR, [ + $snapshot = implode(DIRECTORY_SEPARATOR, [ $testsPath, '.snapshots', 'success.txt',