| @@ 5114-5127 (lines=14) @@ | ||
| 5111 | * |
|
| 5112 | * @return bool |
|
| 5113 | */ |
|
| 5114 | public function sizeIs(int $size): bool |
|
| 5115 | { |
|
| 5116 | // init |
|
| 5117 | $itemsTempCount = 0; |
|
| 5118 | ||
| 5119 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5120 | ++$itemsTempCount; |
|
| 5121 | if ($itemsTempCount > $size) { |
|
| 5122 | return false; |
|
| 5123 | } |
|
| 5124 | } |
|
| 5125 | ||
| 5126 | return $itemsTempCount === $size; |
|
| 5127 | } |
|
| 5128 | ||
| 5129 | /** |
|
| 5130 | * Checks whether array has between $fromSize to $toSize items. $toSize can be |
|
| @@ 5166-5179 (lines=14) @@ | ||
| 5163 | * |
|
| 5164 | * @return bool |
|
| 5165 | */ |
|
| 5166 | public function sizeIsGreaterThan(int $size): bool |
|
| 5167 | { |
|
| 5168 | // init |
|
| 5169 | $itemsTempCount = 0; |
|
| 5170 | ||
| 5171 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5172 | ++$itemsTempCount; |
|
| 5173 | if ($itemsTempCount > $size) { |
|
| 5174 | return true; |
|
| 5175 | } |
|
| 5176 | } |
|
| 5177 | ||
| 5178 | return $itemsTempCount > $size; |
|
| 5179 | } |
|
| 5180 | ||
| 5181 | /** |
|
| 5182 | * Checks whether array has less than $size items. |
|
| @@ 5188-5201 (lines=14) @@ | ||
| 5185 | * |
|
| 5186 | * @return bool |
|
| 5187 | */ |
|
| 5188 | public function sizeIsLessThan(int $size): bool |
|
| 5189 | { |
|
| 5190 | // init |
|
| 5191 | $itemsTempCount = 0; |
|
| 5192 | ||
| 5193 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5194 | ++$itemsTempCount; |
|
| 5195 | if ($itemsTempCount > $size) { |
|
| 5196 | return false; |
|
| 5197 | } |
|
| 5198 | } |
|
| 5199 | ||
| 5200 | return $itemsTempCount < $size; |
|
| 5201 | } |
|
| 5202 | ||
| 5203 | /** |
|
| 5204 | * Counts all elements in an array, or something in an object. |
|