@@ 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} |
@@ 385-394 (lines=10) @@ | ||
382 | * {@inheritDoc} |
|
383 | * @return $this |
|
384 | */ |
|
385 | public function indexBy($callback) |
|
386 | { |
|
387 | $group = new Map(); |
|
388 | foreach ($this as $value) { |
|
389 | $key = $callback($value); |
|
390 | $group->set($key, $value); |
|
391 | } |
|
392 | ||
393 | return $group; |
|
394 | } |
|
395 | ||
396 | /** |
|
397 | * {@inheritdoc} |