@@ 205-214 (lines=10) @@ | ||
202 | * @param CollectionInterface $collection |
|
203 | * @return CollectionInterface |
|
204 | */ |
|
205 | public function keys(CollectionInterface $collection = null): CollectionInterface |
|
206 | { |
|
207 | if (null === $collection) { |
|
208 | return new ArrayList($this->keys); |
|
209 | } |
|
210 | ||
211 | $collection->addAllArray($this->keys); |
|
212 | ||
213 | return $collection; |
|
214 | } |
|
215 | ||
216 | /** |
|
217 | * Returns the values as a collection |
|
@@ 222-231 (lines=10) @@ | ||
219 | * @param CollectionInterface $collection |
|
220 | * @return CollectionInterface |
|
221 | */ |
|
222 | public function values(CollectionInterface $collection = null): CollectionInterface |
|
223 | { |
|
224 | if (null === $collection) { |
|
225 | return new ArrayList($this->values); |
|
226 | } |
|
227 | ||
228 | $collection->addAllArray($this->values); |
|
229 | ||
230 | return $collection; |
|
231 | } |
|
232 | ||
233 | /** |
|
234 | * Filter the collection using closure |