Hello,
We're typing a lot our arrays as list<T>
usually we're using array_values() to ensure we have a list. But it feels really cumbersome to do something like array_values(listOf($foo)->toArray())
Would you be OK to add something like this?
// \Noctud\Collection\Collection
/**
* Convert to a primitive PHP array list preserving iteration order.
*
* @return list<E>
*/
#[NoDiscard]
public function toArrayList(): array;
not sure about the method's name. In doctrine/collection it is called getValues()
Hello,
We're typing a lot our arrays as
list<T>usually we're using
array_values()to ensure we have a list. But it feels really cumbersome to do something likearray_values(listOf($foo)->toArray())Would you be OK to add something like this?
not sure about the method's name. In
doctrine/collectionit is calledgetValues()