refactor: generic attribute

This commit is contained in:
Thai Nguyen Hung
2023-08-24 15:23:13 +07:00
parent e6fe968d44
commit e69899559d
2 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Pest; namespace Pest;
use Attribute;
use BadMethodCallException; use BadMethodCallException;
use Closure; use Closure;
use InvalidArgumentException; use InvalidArgumentException;
@ -837,7 +838,7 @@ final class Expectation
/** /**
* Asserts that the given expectation target to have the given attribute. * Asserts that the given expectation target to have the given attribute.
* *
* @param class-string $attribute * @param class-string<Attribute> $attribute
*/ */
public function toHaveAttribute(string $attribute): ArchExpectation public function toHaveAttribute(string $attribute): ArchExpectation
{ {

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Pest\Expectations; namespace Pest\Expectations;
use Attribute;
use Pest\Arch\Contracts\ArchExpectation; use Pest\Arch\Contracts\ArchExpectation;
use Pest\Arch\Expectations\Targeted; use Pest\Arch\Expectations\Targeted;
use Pest\Arch\Expectations\ToBeUsedIn; use Pest\Arch\Expectations\ToBeUsedIn;
@ -381,7 +382,7 @@ final class OppositeExpectation
/** /**
* Asserts that the given expectation target not to have the given attribute. * Asserts that the given expectation target not to have the given attribute.
* *
* @param class-string $attribute * @param class-string<Attribute> $attribute
*/ */
public function toHaveAttribute(string $attribute): ArchExpectation public function toHaveAttribute(string $attribute): ArchExpectation
{ {