| @@ 4360-4373 (lines=14) @@ | ||
| 4357 | * |
|
| 4358 | * @return bool |
|
| 4359 | */ |
|
| 4360 | public function sizeIs(int $size): bool |
|
| 4361 | { |
|
| 4362 | // init |
|
| 4363 | $itemsTempCount = 0; |
|
| 4364 | ||
| 4365 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4366 | ++$itemsTempCount; |
|
| 4367 | if ($itemsTempCount > $size) { |
|
| 4368 | return false; |
|
| 4369 | } |
|
| 4370 | } |
|
| 4371 | ||
| 4372 | return $itemsTempCount === $size; |
|
| 4373 | } |
|
| 4374 | ||
| 4375 | /** |
|
| 4376 | * Checks whether array has between $fromSize to $toSize items. $toSize can be |
|
| @@ 4412-4425 (lines=14) @@ | ||
| 4409 | * |
|
| 4410 | * @return bool |
|
| 4411 | */ |
|
| 4412 | public function sizeIsGreaterThan(int $size): bool |
|
| 4413 | { |
|
| 4414 | // init |
|
| 4415 | $itemsTempCount = 0; |
|
| 4416 | ||
| 4417 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4418 | ++$itemsTempCount; |
|
| 4419 | if ($itemsTempCount > $size) { |
|
| 4420 | return true; |
|
| 4421 | } |
|
| 4422 | } |
|
| 4423 | ||
| 4424 | return $itemsTempCount > $size; |
|
| 4425 | } |
|
| 4426 | ||
| 4427 | /** |
|
| 4428 | * Checks whether array has less than $size items. |
|
| @@ 4434-4447 (lines=14) @@ | ||
| 4431 | * |
|
| 4432 | * @return bool |
|
| 4433 | */ |
|
| 4434 | public function sizeIsLessThan(int $size): bool |
|
| 4435 | { |
|
| 4436 | // init |
|
| 4437 | $itemsTempCount = 0; |
|
| 4438 | ||
| 4439 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4440 | ++$itemsTempCount; |
|
| 4441 | if ($itemsTempCount > $size) { |
|
| 4442 | return false; |
|
| 4443 | } |
|
| 4444 | } |
|
| 4445 | ||
| 4446 | return $itemsTempCount < $size; |
|
| 4447 | } |
|
| 4448 | ||
| 4449 | /** |
|
| 4450 | * Counts all elements in an array, or something in an object. |
|