| @@ 5013-5026 (lines=14) @@ | ||
| 5010 | * |
|
| 5011 | * @return bool |
|
| 5012 | */ |
|
| 5013 | public function sizeIs(int $size): bool |
|
| 5014 | { |
|
| 5015 | // init |
|
| 5016 | $itemsTempCount = 0; |
|
| 5017 | ||
| 5018 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5019 | ++$itemsTempCount; |
|
| 5020 | if ($itemsTempCount > $size) { |
|
| 5021 | return false; |
|
| 5022 | } |
|
| 5023 | } |
|
| 5024 | ||
| 5025 | return $itemsTempCount === $size; |
|
| 5026 | } |
|
| 5027 | ||
| 5028 | /** |
|
| 5029 | * Checks whether array has between $fromSize to $toSize items. $toSize can be |
|
| @@ 5065-5078 (lines=14) @@ | ||
| 5062 | * |
|
| 5063 | * @return bool |
|
| 5064 | */ |
|
| 5065 | public function sizeIsGreaterThan(int $size): bool |
|
| 5066 | { |
|
| 5067 | // init |
|
| 5068 | $itemsTempCount = 0; |
|
| 5069 | ||
| 5070 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5071 | ++$itemsTempCount; |
|
| 5072 | if ($itemsTempCount > $size) { |
|
| 5073 | return true; |
|
| 5074 | } |
|
| 5075 | } |
|
| 5076 | ||
| 5077 | return $itemsTempCount > $size; |
|
| 5078 | } |
|
| 5079 | ||
| 5080 | /** |
|
| 5081 | * Checks whether array has less than $size items. |
|
| @@ 5087-5100 (lines=14) @@ | ||
| 5084 | * |
|
| 5085 | * @return bool |
|
| 5086 | */ |
|
| 5087 | public function sizeIsLessThan(int $size): bool |
|
| 5088 | { |
|
| 5089 | // init |
|
| 5090 | $itemsTempCount = 0; |
|
| 5091 | ||
| 5092 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5093 | ++$itemsTempCount; |
|
| 5094 | if ($itemsTempCount > $size) { |
|
| 5095 | return false; |
|
| 5096 | } |
|
| 5097 | } |
|
| 5098 | ||
| 5099 | return $itemsTempCount < $size; |
|
| 5100 | } |
|
| 5101 | ||
| 5102 | /** |
|
| 5103 | * Counts all elements in an array, or something in an object. |
|