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