src/Traits/Collections.php
public static function unease(array $collection, string $separator = '.'): array
    {
        $nonDefaultSeparator = $separator !== '.';
        $map = [];

        foreach ($collection as $key => $value) {
            $map = __::set(
                $map,
                $nonDefaultSeparator ? str_replace($separator, '.', $key) : $key,
                $value
            );
        }

        return $map;
    }
public static function unease(array $collection, string $separator = '.'): array
    {
        $nonDefaultSeparator = $separator !== '.';
        $map = [];

        foreach ($collection as $key => $value) {
            $map = __::set(
                $map,
                $nonDefaultSeparator ? str_replace($separator, '.', $key) : $key,
                $value
            );
        }

        return $map;
    }
public static function unease ( array $ collection , string $ separator = '.' ) : array { $ nonDefaultSeparator = $ separator !== '.' ; $ map = [ ] ; foreach ( $ collection as $ key => $ value ) { $ map = __ :: set ( $ map , $ nonDefaultSeparator ? str_replace ( $ separator , '.' , $ key ) : $ key , $ value ) ; } return $ map ; }
Builds a multidimensional collection out of a hash map using the key as indicator where to put the value.

@usage __::unease(['foo.bar' => 'ter', 'baz.0' => 'b', , 'baz.1' => 'z']);
>> '['foo' => ['bar' => 'ter'], 'baz' => ['b', 'z']]'

@param array  $collection hash map of values
@param string $separator  the glue used in the keys

@return array
@throws \Exception
Builds a multidimensional collection out of a hash map using the key as indicator where to put the value .