mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
29 lines
534 B
PHP
29 lines
534 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pest\Factories\Annotations;
|
|
|
|
use Pest\Factories\TestCaseMethodFactory;
|
|
use Pest\Support\Str;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
final class Depends
|
|
{
|
|
/**
|
|
* Adds annotations regarding the "depends" feature.
|
|
*/
|
|
public function add(TestCaseMethodFactory $method, array $annotations): array
|
|
{
|
|
foreach ($method->depends as $depend) {
|
|
$depend = Str::evaluable($depend);
|
|
|
|
$annotations[] = "@depends $depend";
|
|
}
|
|
|
|
return $annotations;
|
|
}
|
|
}
|