@@ 4562-4575 (lines=14) @@ | ||
4559 | * |
|
4560 | * @return bool |
|
4561 | */ |
|
4562 | public function sizeIs(int $size): bool |
|
4563 | { |
|
4564 | // init |
|
4565 | $itemsTempCount = 0; |
|
4566 | ||
4567 | foreach ($this->getGenerator() as $key => $value) { |
|
4568 | ++$itemsTempCount; |
|
4569 | if ($itemsTempCount > $size) { |
|
4570 | return false; |
|
4571 | } |
|
4572 | } |
|
4573 | ||
4574 | return $itemsTempCount === $size; |
|
4575 | } |
|
4576 | ||
4577 | /** |
|
4578 | * Checks whether array has between $fromSize to $toSize items. $toSize can be |
|
@@ 4614-4627 (lines=14) @@ | ||
4611 | * |
|
4612 | * @return bool |
|
4613 | */ |
|
4614 | public function sizeIsGreaterThan(int $size): bool |
|
4615 | { |
|
4616 | // init |
|
4617 | $itemsTempCount = 0; |
|
4618 | ||
4619 | foreach ($this->getGenerator() as $key => $value) { |
|
4620 | ++$itemsTempCount; |
|
4621 | if ($itemsTempCount > $size) { |
|
4622 | return true; |
|
4623 | } |
|
4624 | } |
|
4625 | ||
4626 | return $itemsTempCount > $size; |
|
4627 | } |
|
4628 | ||
4629 | /** |
|
4630 | * Checks whether array has less than $size items. |
|
@@ 4636-4649 (lines=14) @@ | ||
4633 | * |
|
4634 | * @return bool |
|
4635 | */ |
|
4636 | public function sizeIsLessThan(int $size): bool |
|
4637 | { |
|
4638 | // init |
|
4639 | $itemsTempCount = 0; |
|
4640 | ||
4641 | foreach ($this->getGenerator() as $key => $value) { |
|
4642 | ++$itemsTempCount; |
|
4643 | if ($itemsTempCount > $size) { |
|
4644 | return false; |
|
4645 | } |
|
4646 | } |
|
4647 | ||
4648 | return $itemsTempCount < $size; |
|
4649 | } |
|
4650 | ||
4651 | /** |
|
4652 | * Counts all elements in an array, or something in an object. |