chore: resolve toHaveSameSize parameter

This commit is contained in:
Owen Voke
2023-08-23 11:24:01 +01:00
parent be71d6918d
commit 8a44d3f136

View File

@ -6,6 +6,7 @@ namespace Pest\Mixins;
use BadMethodCallException;
use Closure;
use Countable;
use DateTimeInterface;
use Error;
use InvalidArgumentException;
@ -275,10 +276,10 @@ final class Expectation
/**
* Asserts that the size of the value and $expected are the same.
*
* @param array<int|string, mixed> $expected
* @param Countable|iterable<mixed> $expected
* @return self<TValue>
*/
public function toHaveSameSize(iterable $expected, string $message = ''): self
public function toHaveSameSize(Countable|iterable $expected, string $message = ''): self
{
if (! is_countable($this->value) && ! is_iterable($this->value)) {
InvalidExpectationValue::expected('countable|iterable');