| @@ 3976-3989 (lines=14) @@ | ||
| 3973 | * |
|
| 3974 | * @return bool |
|
| 3975 | */ |
|
| 3976 | public function sizeIs(int $size): bool |
|
| 3977 | { |
|
| 3978 | // init |
|
| 3979 | $itemsTempCount = 0; |
|
| 3980 | ||
| 3981 | foreach ($this->getGenerator() as $key => $value) { |
|
| 3982 | ++$itemsTempCount; |
|
| 3983 | if ($itemsTempCount > $size) { |
|
| 3984 | return false; |
|
| 3985 | } |
|
| 3986 | } |
|
| 3987 | ||
| 3988 | return $itemsTempCount === $size; |
|
| 3989 | } |
|
| 3990 | ||
| 3991 | /** |
|
| 3992 | * Checks whether array has between $fromSize to $toSize items. $toSize can be |
|
| @@ 4028-4041 (lines=14) @@ | ||
| 4025 | * |
|
| 4026 | * @return bool |
|
| 4027 | */ |
|
| 4028 | public function sizeIsGreaterThan(int $size): bool |
|
| 4029 | { |
|
| 4030 | // init |
|
| 4031 | $itemsTempCount = 0; |
|
| 4032 | ||
| 4033 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4034 | ++$itemsTempCount; |
|
| 4035 | if ($itemsTempCount > $size) { |
|
| 4036 | return true; |
|
| 4037 | } |
|
| 4038 | } |
|
| 4039 | ||
| 4040 | return $itemsTempCount > $size; |
|
| 4041 | } |
|
| 4042 | ||
| 4043 | /** |
|
| 4044 | * Checks whether array has less than $size items. |
|
| @@ 4050-4063 (lines=14) @@ | ||
| 4047 | * |
|
| 4048 | * @return bool |
|
| 4049 | */ |
|
| 4050 | public function sizeIsLessThan(int $size): bool |
|
| 4051 | { |
|
| 4052 | // init |
|
| 4053 | $itemsTempCount = 0; |
|
| 4054 | ||
| 4055 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4056 | ++$itemsTempCount; |
|
| 4057 | if ($itemsTempCount > $size) { |
|
| 4058 | return false; |
|
| 4059 | } |
|
| 4060 | } |
|
| 4061 | ||
| 4062 | return $itemsTempCount < $size; |
|
| 4063 | } |
|
| 4064 | ||
| 4065 | /** |
|
| 4066 | * Counts all elements in an array, or something in an object. |
|