| @@ 4025-4038 (lines=14) @@ | ||
| 4022 | * |
|
| 4023 | * @return bool |
|
| 4024 | */ |
|
| 4025 | public function sizeIs(int $size): bool |
|
| 4026 | { |
|
| 4027 | // init |
|
| 4028 | $itemsTempCount = 0; |
|
| 4029 | ||
| 4030 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4031 | ++$itemsTempCount; |
|
| 4032 | if ($itemsTempCount > $size) { |
|
| 4033 | return false; |
|
| 4034 | } |
|
| 4035 | } |
|
| 4036 | ||
| 4037 | return $itemsTempCount === $size; |
|
| 4038 | } |
|
| 4039 | ||
| 4040 | /** |
|
| 4041 | * Checks whether array has between $fromSize to $toSize items. $toSize can be |
|
| @@ 4077-4090 (lines=14) @@ | ||
| 4074 | * |
|
| 4075 | * @return bool |
|
| 4076 | */ |
|
| 4077 | public function sizeIsGreaterThan(int $size): bool |
|
| 4078 | { |
|
| 4079 | // init |
|
| 4080 | $itemsTempCount = 0; |
|
| 4081 | ||
| 4082 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4083 | ++$itemsTempCount; |
|
| 4084 | if ($itemsTempCount > $size) { |
|
| 4085 | return true; |
|
| 4086 | } |
|
| 4087 | } |
|
| 4088 | ||
| 4089 | return $itemsTempCount > $size; |
|
| 4090 | } |
|
| 4091 | ||
| 4092 | /** |
|
| 4093 | * Checks whether array has less than $size items. |
|
| @@ 4099-4112 (lines=14) @@ | ||
| 4096 | * |
|
| 4097 | * @return bool |
|
| 4098 | */ |
|
| 4099 | public function sizeIsLessThan(int $size): bool |
|
| 4100 | { |
|
| 4101 | // init |
|
| 4102 | $itemsTempCount = 0; |
|
| 4103 | ||
| 4104 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4105 | ++$itemsTempCount; |
|
| 4106 | if ($itemsTempCount > $size) { |
|
| 4107 | return false; |
|
| 4108 | } |
|
| 4109 | } |
|
| 4110 | ||
| 4111 | return $itemsTempCount < $size; |
|
| 4112 | } |
|
| 4113 | ||
| 4114 | /** |
|
| 4115 | * Counts all elements in an array, or something in an object. |
|