| @@ 5104-5117 (lines=14) @@ | ||
| 5101 | * |
|
| 5102 | * @return bool |
|
| 5103 | */ |
|
| 5104 | public function sizeIs(int $size): bool |
|
| 5105 | { |
|
| 5106 | // init |
|
| 5107 | $itemsTempCount = 0; |
|
| 5108 | ||
| 5109 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5110 | ++$itemsTempCount; |
|
| 5111 | if ($itemsTempCount > $size) { |
|
| 5112 | return false; |
|
| 5113 | } |
|
| 5114 | } |
|
| 5115 | ||
| 5116 | return $itemsTempCount === $size; |
|
| 5117 | } |
|
| 5118 | ||
| 5119 | /** |
|
| 5120 | * Checks whether array has between $fromSize to $toSize items. $toSize can be |
|
| @@ 5156-5169 (lines=14) @@ | ||
| 5153 | * |
|
| 5154 | * @return bool |
|
| 5155 | */ |
|
| 5156 | public function sizeIsGreaterThan(int $size): bool |
|
| 5157 | { |
|
| 5158 | // init |
|
| 5159 | $itemsTempCount = 0; |
|
| 5160 | ||
| 5161 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5162 | ++$itemsTempCount; |
|
| 5163 | if ($itemsTempCount > $size) { |
|
| 5164 | return true; |
|
| 5165 | } |
|
| 5166 | } |
|
| 5167 | ||
| 5168 | return $itemsTempCount > $size; |
|
| 5169 | } |
|
| 5170 | ||
| 5171 | /** |
|
| 5172 | * Checks whether array has less than $size items. |
|
| @@ 5178-5191 (lines=14) @@ | ||
| 5175 | * |
|
| 5176 | * @return bool |
|
| 5177 | */ |
|
| 5178 | public function sizeIsLessThan(int $size): bool |
|
| 5179 | { |
|
| 5180 | // init |
|
| 5181 | $itemsTempCount = 0; |
|
| 5182 | ||
| 5183 | foreach ($this->getGenerator() as $key => $value) { |
|
| 5184 | ++$itemsTempCount; |
|
| 5185 | if ($itemsTempCount > $size) { |
|
| 5186 | return false; |
|
| 5187 | } |
|
| 5188 | } |
|
| 5189 | ||
| 5190 | return $itemsTempCount < $size; |
|
| 5191 | } |
|
| 5192 | ||
| 5193 | /** |
|
| 5194 | * Counts all elements in an array, or something in an object. |
|