mirror of
https://github.com/pestphp/pest.git
synced 2026-03-11 02:07:23 +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.
|
* Adds attributes regarding the "covers" feature.
|
||||||
*
|
*
|
||||||
* @param \Pest\Factories\TestCaseMethodFactory $method
|
|
||||||
* @param array<int, string> $attributes
|
* @param array<int, string> $attributes
|
||||||
*
|
*
|
||||||
* @return array<int, string>
|
* @return array<int, string>
|
||||||
@ -38,7 +37,7 @@ final class Covers extends Attribute
|
|||||||
}
|
}
|
||||||
|
|
||||||
$attributes[] = "#[\PHPUnit\Framework\Attributes\CoversClass({$covering->class}::class)]";
|
$attributes[] = "#[\PHPUnit\Framework\Attributes\CoversClass({$covering->class}::class)]";
|
||||||
} else if ($covering instanceof CoversFunction) {
|
} elseif ($covering instanceof CoversFunction) {
|
||||||
$attributes[] = "#[\PHPUnit\Framework\Attributes\CoversFunction('{$covering->function}')]";
|
$attributes[] = "#[\PHPUnit\Framework\Attributes\CoversFunction('{$covering->function}')]";
|
||||||
} else {
|
} else {
|
||||||
$attributes[] = "#[\PHPUnit\Framework\Attributes\CoversNothing]";
|
$attributes[] = "#[\PHPUnit\Framework\Attributes\CoversNothing]";
|
||||||
|
|||||||
@ -11,6 +11,5 @@ final class CoversClass
|
|||||||
{
|
{
|
||||||
public function __construct(public string $class)
|
public function __construct(public string $class)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,5 @@ final class CoversFunction
|
|||||||
{
|
{
|
||||||
public function __construct(public string $function)
|
public function __construct(public string $function)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,5 +9,4 @@ namespace Pest\Factories\Covers;
|
|||||||
*/
|
*/
|
||||||
final class CoversNothing
|
final class CoversNothing
|
||||||
{
|
{
|
||||||
//
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,8 +4,14 @@ use Pest\Factories\Attributes\Covers;
|
|||||||
|
|
||||||
$runCounter = 0;
|
$runCounter = 0;
|
||||||
|
|
||||||
class TestCoversClass1 {}
|
class TestCoversClass1
|
||||||
class TestCoversClass2 {}
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
class TestCoversClass2
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
it('uses the correct PHPUnit attribute for class', function () {
|
it('uses the correct PHPUnit attribute for class', function () {
|
||||||
$attributes = (new ReflectionClass($this))->getAttributes();
|
$attributes = (new ReflectionClass($this))->getAttributes();
|
||||||
|
|||||||
Reference in New Issue
Block a user