From a5cbdea868f7e311aef06bf9465613b2000da96d Mon Sep 17 00:00:00 2001 From: danilopolani Date: Mon, 7 Mar 2022 17:51:47 +0100 Subject: [PATCH] fix phpstan issues --- src/Factories/Attributes/Covers.php | 3 +-- src/Factories/Covers/CoversClass.php | 1 - src/Factories/Covers/CoversFunction.php | 1 - src/Factories/Covers/CoversNothing.php | 1 - tests/Features/Covers.php | 10 ++++++++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Factories/Attributes/Covers.php b/src/Factories/Attributes/Covers.php index 1d0e6991..1c41608b 100644 --- a/src/Factories/Attributes/Covers.php +++ b/src/Factories/Attributes/Covers.php @@ -23,7 +23,6 @@ final class Covers extends Attribute /** * Adds attributes regarding the "covers" feature. * - * @param \Pest\Factories\TestCaseMethodFactory $method * @param array $attributes * * @return array @@ -38,7 +37,7 @@ final class Covers extends Attribute } $attributes[] = "#[\PHPUnit\Framework\Attributes\CoversClass({$covering->class}::class)]"; - } else if ($covering instanceof CoversFunction) { + } elseif ($covering instanceof CoversFunction) { $attributes[] = "#[\PHPUnit\Framework\Attributes\CoversFunction('{$covering->function}')]"; } else { $attributes[] = "#[\PHPUnit\Framework\Attributes\CoversNothing]"; diff --git a/src/Factories/Covers/CoversClass.php b/src/Factories/Covers/CoversClass.php index dbc3fb86..44f58487 100644 --- a/src/Factories/Covers/CoversClass.php +++ b/src/Factories/Covers/CoversClass.php @@ -11,6 +11,5 @@ final class CoversClass { public function __construct(public string $class) { - // } } diff --git a/src/Factories/Covers/CoversFunction.php b/src/Factories/Covers/CoversFunction.php index 5fddce9c..5759bbc7 100644 --- a/src/Factories/Covers/CoversFunction.php +++ b/src/Factories/Covers/CoversFunction.php @@ -11,6 +11,5 @@ final class CoversFunction { public function __construct(public string $function) { - // } } diff --git a/src/Factories/Covers/CoversNothing.php b/src/Factories/Covers/CoversNothing.php index 183f5b74..31b3d310 100644 --- a/src/Factories/Covers/CoversNothing.php +++ b/src/Factories/Covers/CoversNothing.php @@ -9,5 +9,4 @@ namespace Pest\Factories\Covers; */ final class CoversNothing { - // } diff --git a/tests/Features/Covers.php b/tests/Features/Covers.php index 704168c3..f52d0740 100644 --- a/tests/Features/Covers.php +++ b/tests/Features/Covers.php @@ -4,8 +4,14 @@ use Pest\Factories\Attributes\Covers; $runCounter = 0; -class TestCoversClass1 {} -class TestCoversClass2 {} +class TestCoversClass1 +{ + +} +class TestCoversClass2 +{ + +} it('uses the correct PHPUnit attribute for class', function () { $attributes = (new ReflectionClass($this))->getAttributes();