src/SellerLabs/Nucleus/Support/Std.php
public static function map(callable $function, $traversable)
    {
        $aggregation = [];

        foreach ($traversable as $key => $value) {
            $aggregation[$key] = $function($value, $key);
        }

        return $aggregation;
    }
public static function map(callable $function, $traversable)
    {
        $aggregation = [];

        foreach ($traversable as $key => $value) {
            $aggregation[$key] = $function($value, $key);
        }

        return $aggregation;
    }
public static function map ( callable $ function , $ traversable ) { $ aggregation = [ ] ; foreach ( $ traversable as $ key => $ value ) { $ aggregation [ $ key ] = $ function ( $ value , $ key ) ; } return $ aggregation ; }
Call a function on every item in a list and return the resulting list.

@param callable $function
@param array|Traversable $traversable

@return array
Call a function on every item in a list and return the resulting list .