function map(callable $closure) {
        $keys = \array_keys($this->data);
        $items = \array_map($closure, $this->data, $keys);
        
        return (new self(\array_combine($keys, $items)));
    }
function map(callable $closure) {
        $keys = \array_keys($this->data);
        $items = \array_map($closure, $this->data, $keys);
        
        return (new self(\array_combine($keys, $items)));
    }
function map ( callable $ closure ) { $ keys = \ array_keys ( $ this -> data ) ; $ items = \ array_map ( $ closure , $ this -> data , $ keys ) ; return ( new self ( \ array_combine ( $ keys , $ items ) ) ) ; }
Iterates through the collection and passes each value to the given callback. The callback is free to modify the item and return it, thus forming a new collection of modified items.
@param callable|null  $closure  Callback specification: `function ($value, $key): mixed`
@return \CharlotteDunois\Collect\Collection
Iterates through the collection and passes each value to the given callback . The callback is free to modify the item and return it thus forming a new collection of modified items .