Documentation Bug - mapcat
will1471 opened this issue · comments
William Redman commented
The examples for mapcat appear to be wrong.
Collection::from([1, 3, 3, 2])
->mapcat(function ($value) {
return [[$value]];
})
->toArray()
outputs [[2]]
not [[1], [3], [3], [2]]
Presumably a call to values
needs adding in the examples. eg
Collection::from([1, 3, 3, 2])
->mapcat(function ($value) {
return [[$value]];
})
->values()
->toArray()
Dušan Kasan commented
Good catch, fixed in 5e3619e