mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
fix phpstan issues
This commit is contained in:
@ -23,7 +23,6 @@ final class Covers extends Attribute
|
||||
/**
|
||||
* Adds attributes regarding the "covers" feature.
|
||||
*
|
||||
* @param \Pest\Factories\TestCaseMethodFactory $method
|
||||
* @param array<int, string> $attributes
|
||||
*
|
||||
* @return array<int, string>
|
||||
@ -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]";
|
||||
|
||||
@ -11,6 +11,5 @@ final class CoversClass
|
||||
{
|
||||
public function __construct(public string $class)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,5 @@ final class CoversFunction
|
||||
{
|
||||
public function __construct(public string $function)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,5 +9,4 @@ namespace Pest\Factories\Covers;
|
||||
*/
|
||||
final class CoversNothing
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user