@@ 197-206 (lines=10) @@ | ||
194 | * {@inheritDoc} |
|
195 | * @return $this |
|
196 | */ |
|
197 | public function indexBy($callback) |
|
198 | { |
|
199 | $group = new Map(); |
|
200 | foreach ($this as $value) { |
|
201 | $key = $callback($value); |
|
202 | $group->set($key, $value); |
|
203 | } |
|
204 | ||
205 | return $group; |
|
206 | } |
|
207 | ||
208 | /** |
|
209 | * {@inheritdoc} |
@@ 255-264 (lines=10) @@ | ||
252 | * {@inheritDoc} |
|
253 | * @return $this |
|
254 | */ |
|
255 | public function indexBy($callback) |
|
256 | { |
|
257 | $group = new Map(); |
|
258 | foreach ($this as $value) { |
|
259 | $key = $callback($value); |
|
260 | $group->set($key, $value); |
|
261 | } |
|
262 | ||
263 | return $group; |
|
264 | } |
|
265 | ||
266 | /** |
|
267 | * {@inheritdoc} |
@@ 398-407 (lines=10) @@ | ||
395 | * {@inheritDoc} |
|
396 | * @return $this |
|
397 | */ |
|
398 | public function indexBy($callback) |
|
399 | { |
|
400 | $group = new Map(); |
|
401 | foreach ($this as $value) { |
|
402 | $key = $callback($value); |
|
403 | $group->set($key, $value); |
|
404 | } |
|
405 | ||
406 | return $group; |
|
407 | } |
|
408 | ||
409 | /** |
|
410 | * {@inheritdoc} |