| @@ 210-220 (lines=11) @@ | ||
| 207 | /** |
|
| 208 | * {@inheritDoc} |
|
| 209 | */ |
|
| 210 | public function exists(Closure $p) |
|
| 211 | { |
|
| 212 | foreach ($this->collection as $element) { |
|
| 213 | $key = $this->getKey($element); |
|
| 214 | if ($p($key, $element)) { |
|
| 215 | return true; |
|
| 216 | } |
|
| 217 | } |
|
| 218 | ||
| 219 | return false; |
|
| 220 | } |
|
| 221 | ||
| 222 | /** |
|
| 223 | * {@inheritDoc} |
|
| @@ 233-243 (lines=11) @@ | ||
| 230 | /** |
|
| 231 | * {@inheritDoc} |
|
| 232 | */ |
|
| 233 | public function forAll(Closure $p) |
|
| 234 | { |
|
| 235 | foreach ($this->collection as $element) { |
|
| 236 | $key = $this->getKey($element); |
|
| 237 | if (!$p($key, $element)) { |
|
| 238 | return false; |
|
| 239 | } |
|
| 240 | } |
|
| 241 | ||
| 242 | return true; |
|
| 243 | } |
|
| 244 | ||
| 245 | /** |
|
| 246 | * {@inheritDoc} |
|