@@ 213-222 (lines=10) @@ | ||
210 | * @param CollectionInterface $collection |
|
211 | * @return CollectionInterface |
|
212 | */ |
|
213 | public function keys(CollectionInterface $collection = null): CollectionInterface |
|
214 | { |
|
215 | if (null === $collection) { |
|
216 | return new ArrayList($this->keys); |
|
217 | } |
|
218 | ||
219 | $collection->addAll(new ArrayList($this->keys)); |
|
220 | ||
221 | return $collection; |
|
222 | } |
|
223 | ||
224 | /** |
|
225 | * Returns the values as a collection |
|
@@ 230-239 (lines=10) @@ | ||
227 | * @param CollectionInterface $collection |
|
228 | * @return CollectionInterface |
|
229 | */ |
|
230 | public function values(CollectionInterface $collection = null): CollectionInterface |
|
231 | { |
|
232 | if (null === $collection) { |
|
233 | return new ArrayList($this->values); |
|
234 | } |
|
235 | ||
236 | $collection->addAll(new ArrayList($this->values)); |
|
237 | ||
238 | return $collection; |
|
239 | } |
|
240 | ||
241 | /** |
|
242 | * Filter the collection using closure |