| @@ 4279-4292 (lines=14) @@ | ||
| 4276 | * | |
| 4277 | * @return bool | |
| 4278 | */ | |
| 4279 | public function sizeIs(int $size): bool | |
| 4280 |     { | |
| 4281 | // init | |
| 4282 | $itemsTempCount = 0; | |
| 4283 | ||
| 4284 |         foreach ($this->getGenerator() as $key => $value) { | |
| 4285 | ++$itemsTempCount; | |
| 4286 |             if ($itemsTempCount > $size) { | |
| 4287 | return false; | |
| 4288 | } | |
| 4289 | } | |
| 4290 | ||
| 4291 | return $itemsTempCount === $size; | |
| 4292 | } | |
| 4293 | ||
| 4294 | /** | |
| 4295 | * Checks whether array has between $fromSize to $toSize items. $toSize can be | |
| @@ 4331-4344 (lines=14) @@ | ||
| 4328 | * | |
| 4329 | * @return bool | |
| 4330 | */ | |
| 4331 | public function sizeIsGreaterThan(int $size): bool | |
| 4332 |     { | |
| 4333 | // init | |
| 4334 | $itemsTempCount = 0; | |
| 4335 | ||
| 4336 |         foreach ($this->getGenerator() as $key => $value) { | |
| 4337 | ++$itemsTempCount; | |
| 4338 |             if ($itemsTempCount > $size) { | |
| 4339 | return true; | |
| 4340 | } | |
| 4341 | } | |
| 4342 | ||
| 4343 | return $itemsTempCount > $size; | |
| 4344 | } | |
| 4345 | ||
| 4346 | /** | |
| 4347 | * Checks whether array has less than $size items. | |
| @@ 4353-4366 (lines=14) @@ | ||
| 4350 | * | |
| 4351 | * @return bool | |
| 4352 | */ | |
| 4353 | public function sizeIsLessThan(int $size): bool | |
| 4354 |     { | |
| 4355 | // init | |
| 4356 | $itemsTempCount = 0; | |
| 4357 | ||
| 4358 |         foreach ($this->getGenerator() as $key => $value) { | |
| 4359 | ++$itemsTempCount; | |
| 4360 |             if ($itemsTempCount > $size) { | |
| 4361 | return false; | |
| 4362 | } | |
| 4363 | } | |
| 4364 | ||
| 4365 | return $itemsTempCount < $size; | |
| 4366 | } | |
| 4367 | ||
| 4368 | /** | |
| 4369 | * Counts all elements in an array, or something in an object. | |