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