protected static function flatten(array $array): array
    {
        $flattened = [];

        foreach ($array as $key => $value) {
            if (\is_array($value)) {
                $flattened = \array_merge($flattened, static::flatten($value));
            } else {
                $flattened[] = $value;
            }
        }

        return $flattened;
    }
protected static function flatten(array $array): array
    {
        $flattened = [];

        foreach ($array as $key => $value) {
            if (\is_array($value)) {
                $flattened = \array_merge($flattened, static::flatten($value));
            } else {
                $flattened[] = $value;
            }
        }

        return $flattened;
    }
protected static function flatten ( array $ array ) : array { $ flattened = [ ] ; foreach ( $ array as $ key => $ value ) { if ( \ is_array ( $ value ) ) { $ flattened = \ array_merge ( $ flattened , static :: flatten ( $ value ) ) ; } else { $ flattened [ ] = $ value ; } } return $ flattened ; }
Convert a multi-dimensional array into a single-dimensional array without keys.

@param array $array

@return array
Convert a multi - dimensional array into a single - dimensional array without keys .