feat: toUseStrictTypes

This commit is contained in:
Nuno Maduro
2023-05-27 20:22:36 +01:00
parent 26a6e7d712
commit be9056f978
2 changed files with 24 additions and 1 deletions

View File

@ -13,6 +13,7 @@ use Pest\Arch\Expectations\ToOnlyBeUsedIn;
use Pest\Arch\Expectations\ToOnlyUse;
use Pest\Arch\Expectations\ToUse;
use Pest\Arch\Expectations\ToUseNothing;
use Pest\Arch\Expectations\ToUseStrictTypes;
use Pest\Concerns\Extendable;
use Pest\Concerns\Pipeable;
use Pest\Concerns\Retrievable;
@ -369,6 +370,16 @@ final class Expectation
return ToUse::make($this, $targets);
}
/**
* Asserts that the given expectation target use the "declare(strict_types=1)" declaration.
*
* @param array<int, string>|string $targets
*/
public function toUseStrictTypes(): ArchExpectation
{
return ToUseStrictTypes::make($this);
}
/**
* Asserts that the given expectation target "only" use on the given dependencies.
*