| @@ 195-204 (lines=10) @@ | ||
| 192 | * @param CollectionInterface $collection |
|
| 193 | * @return CollectionInterface |
|
| 194 | */ |
|
| 195 | public function keys(CollectionInterface $collection = null): CollectionInterface |
|
| 196 | { |
|
| 197 | if (null === $collection) { |
|
| 198 | return new ArrayList($this->keys); |
|
| 199 | } |
|
| 200 | ||
| 201 | $collection->addAll(new ArrayList($this->keys)); |
|
| 202 | ||
| 203 | return $collection; |
|
| 204 | } |
|
| 205 | ||
| 206 | /** |
|
| 207 | * Returns the values as a collection |
|
| @@ 212-221 (lines=10) @@ | ||
| 209 | * @param CollectionInterface $collection |
|
| 210 | * @return CollectionInterface |
|
| 211 | */ |
|
| 212 | public function values(CollectionInterface $collection = null): CollectionInterface |
|
| 213 | { |
|
| 214 | if (null === $collection) { |
|
| 215 | return new ArrayList($this->values); |
|
| 216 | } |
|
| 217 | ||
| 218 | $collection->addAll(new ArrayList($this->values)); |
|
| 219 | ||
| 220 | return $collection; |
|
| 221 | } |
|
| 222 | ||
| 223 | /** |
|
| 224 | * Filter the collection using closure |
|