| @@ 5117-5130 (lines=14) @@ | ||
| 5114 | * |
|
| 5115 | * @return bool |
|
| 5116 | */ |
|
| 5117 | public function sizeIs(int $size): bool |
|
| 5118 | { |
|
| 5119 | // init |
|
| 5120 | $itemsTempCount = 0; |
|
| 5121 | ||
| 5122 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5123 | ++$itemsTempCount; |
|
| 5124 | if ($itemsTempCount > $size) { |
|
| 5125 | return false; |
|
| 5126 | } |
|
| 5127 | } |
|
| 5128 | ||
| 5129 | return $itemsTempCount === $size; |
|
| 5130 | } |
|
| 5131 | ||
| 5132 | /** |
|
| 5133 | * Checks whether array has between $fromSize to $toSize items. $toSize can be |
|
| @@ 5169-5182 (lines=14) @@ | ||
| 5166 | * |
|
| 5167 | * @return bool |
|
| 5168 | */ |
|
| 5169 | public function sizeIsGreaterThan(int $size): bool |
|
| 5170 | { |
|
| 5171 | // init |
|
| 5172 | $itemsTempCount = 0; |
|
| 5173 | ||
| 5174 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5175 | ++$itemsTempCount; |
|
| 5176 | if ($itemsTempCount > $size) { |
|
| 5177 | return true; |
|
| 5178 | } |
|
| 5179 | } |
|
| 5180 | ||
| 5181 | return $itemsTempCount > $size; |
|
| 5182 | } |
|
| 5183 | ||
| 5184 | /** |
|
| 5185 | * Checks whether array has less than $size items. |
|
| @@ 5191-5204 (lines=14) @@ | ||
| 5188 | * |
|
| 5189 | * @return bool |
|
| 5190 | */ |
|
| 5191 | public function sizeIsLessThan(int $size): bool |
|
| 5192 | { |
|
| 5193 | // init |
|
| 5194 | $itemsTempCount = 0; |
|
| 5195 | ||
| 5196 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5197 | ++$itemsTempCount; |
|
| 5198 | if ($itemsTempCount > $size) { |
|
| 5199 | return false; |
|
| 5200 | } |
|
| 5201 | } |
|
| 5202 | ||
| 5203 | return $itemsTempCount < $size; |
|
| 5204 | } |
|
| 5205 | ||
| 5206 | /** |
|
| 5207 | * Counts all elements in an array, or something in an object. |
|