public function map(callable $func) : self
    {
        $list = $this->list;

        foreach ($list as $index => $val) {
            $list[$index] = $func($val);
        }

        return new static($list);
    }
public function map(callable $func) : self
    {
        $list = $this->list;

        foreach ($list as $index => $val) {
            $list[$index] = $func($val);
        }

        return new static($list);
    }
public function map ( callable $ func ) : self { $ list = $ this -> list ; foreach ( $ list as $ index => $ val ) { $ list [ $ index ] = $ func ( $ val ) ; } return new static ( $ list ) ; }
map method.

@method map

@param callable $func

@return object Collection
map method .