mirror of
https://github.com/pestphp/pest.git
synced 2026-03-11 02:07:23 +01:00
move coversNothing to method annotations
This commit is contained in:
30
src/Factories/Annotations/CoversNothing.php
Normal file
30
src/Factories/Annotations/CoversNothing.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pest\Factories\Annotations;
|
||||
|
||||
use Pest\Factories\Covers\CoversNothing as CoversNothingFactory;
|
||||
use Pest\Factories\TestCaseMethodFactory;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class CoversNothing
|
||||
{
|
||||
/**
|
||||
* Adds annotations regarding the "depends" feature.
|
||||
*
|
||||
* @param array<int, string> $annotations
|
||||
*
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public function __invoke(TestCaseMethodFactory $method, array $annotations): array
|
||||
{
|
||||
if (($method->covers[0] ?? null) instanceof CoversNothingFactory) {
|
||||
$annotations[] = '@coversNothing';
|
||||
}
|
||||
|
||||
return $annotations;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user