| @@ 4251-4264 (lines=14) @@ | ||
| 4248 | * |
|
| 4249 | * @return bool |
|
| 4250 | */ |
|
| 4251 | public function sizeIs(int $size): bool |
|
| 4252 | { |
|
| 4253 | // init |
|
| 4254 | $itemsTempCount = 0; |
|
| 4255 | ||
| 4256 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4257 | ++$itemsTempCount; |
|
| 4258 | if ($itemsTempCount > $size) { |
|
| 4259 | return false; |
|
| 4260 | } |
|
| 4261 | } |
|
| 4262 | ||
| 4263 | return $itemsTempCount === $size; |
|
| 4264 | } |
|
| 4265 | ||
| 4266 | /** |
|
| 4267 | * Checks whether array has between $fromSize to $toSize items. $toSize can be |
|
| @@ 4303-4316 (lines=14) @@ | ||
| 4300 | * |
|
| 4301 | * @return bool |
|
| 4302 | */ |
|
| 4303 | public function sizeIsGreaterThan(int $size): bool |
|
| 4304 | { |
|
| 4305 | // init |
|
| 4306 | $itemsTempCount = 0; |
|
| 4307 | ||
| 4308 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4309 | ++$itemsTempCount; |
|
| 4310 | if ($itemsTempCount > $size) { |
|
| 4311 | return true; |
|
| 4312 | } |
|
| 4313 | } |
|
| 4314 | ||
| 4315 | return $itemsTempCount > $size; |
|
| 4316 | } |
|
| 4317 | ||
| 4318 | /** |
|
| 4319 | * Checks whether array has less than $size items. |
|
| @@ 4325-4338 (lines=14) @@ | ||
| 4322 | * |
|
| 4323 | * @return bool |
|
| 4324 | */ |
|
| 4325 | public function sizeIsLessThan(int $size): bool |
|
| 4326 | { |
|
| 4327 | // init |
|
| 4328 | $itemsTempCount = 0; |
|
| 4329 | ||
| 4330 | foreach ($this->getGenerator() as $key => $value) { |
|
| 4331 | ++$itemsTempCount; |
|
| 4332 | if ($itemsTempCount > $size) { |
|
| 4333 | return false; |
|
| 4334 | } |
|
| 4335 | } |
|
| 4336 | ||
| 4337 | return $itemsTempCount < $size; |
|
| 4338 | } |
|
| 4339 | ||
| 4340 | /** |
|
| 4341 | * Counts all elements in an array, or something in an object. |
|