| @@ 4237-4250 (lines=14) @@ | ||
| 4234 | * |
|
| 4235 | * @return bool |
|
| 4236 | */ |
|
| 4237 | public function sizeIs(int $size): bool |
|
| 4238 | { |
|
| 4239 | // init |
|
| 4240 | $itemsTempCount = 0; |
|
| 4241 | ||
| 4242 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4243 | ++$itemsTempCount; |
|
| 4244 | if ($itemsTempCount > $size) { |
|
| 4245 | return false; |
|
| 4246 | } |
|
| 4247 | } |
|
| 4248 | ||
| 4249 | return $itemsTempCount === $size; |
|
| 4250 | } |
|
| 4251 | ||
| 4252 | /** |
|
| 4253 | * Checks whether array has between $fromSize to $toSize items. $toSize can be |
|
| @@ 4289-4302 (lines=14) @@ | ||
| 4286 | * |
|
| 4287 | * @return bool |
|
| 4288 | */ |
|
| 4289 | public function sizeIsGreaterThan(int $size): bool |
|
| 4290 | { |
|
| 4291 | // init |
|
| 4292 | $itemsTempCount = 0; |
|
| 4293 | ||
| 4294 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4295 | ++$itemsTempCount; |
|
| 4296 | if ($itemsTempCount > $size) { |
|
| 4297 | return true; |
|
| 4298 | } |
|
| 4299 | } |
|
| 4300 | ||
| 4301 | return $itemsTempCount > $size; |
|
| 4302 | } |
|
| 4303 | ||
| 4304 | /** |
|
| 4305 | * Checks whether array has less than $size items. |
|
| @@ 4311-4324 (lines=14) @@ | ||
| 4308 | * |
|
| 4309 | * @return bool |
|
| 4310 | */ |
|
| 4311 | public function sizeIsLessThan(int $size): bool |
|
| 4312 | { |
|
| 4313 | // init |
|
| 4314 | $itemsTempCount = 0; |
|
| 4315 | ||
| 4316 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4317 | ++$itemsTempCount; |
|
| 4318 | if ($itemsTempCount > $size) { |
|
| 4319 | return false; |
|
| 4320 | } |
|
| 4321 | } |
|
| 4322 | ||
| 4323 | return $itemsTempCount < $size; |
|
| 4324 | } |
|
| 4325 | ||
| 4326 | /** |
|
| 4327 | * Counts all elements in an array, or something in an object. |
|