src/jsCallback.php
public function flatternArray($response)
    {
        if (!is_array($response)) {
            return [$response];
        }

        $out = [];

        foreach ($response as $element) {
            $out = array_merge($out, $this->flatternArray($element));
        }

        return $out;
    }
public function flatternArray($response)
    {
        if (!is_array($response)) {
            return [$response];
        }

        $out = [];

        foreach ($response as $element) {
            $out = array_merge($out, $this->flatternArray($element));
        }

        return $out;
    }
public function flatternArray ( $ response ) { if ( ! is_array ( $ response ) ) { return [ $ response ] ; } $ out = [ ] ; foreach ( $ response as $ element ) { $ out = array_merge ( $ out , $ this -> flatternArray ( $ element ) ) ; } return $ out ; }
When multiple jsExpressionable's are collected inside an array and may
have some degree of nesting, convert it into a one-dimensional array,
so that it's easier for us to wrap it into a function body.

@param [type] $response [description]

@return [type] [description]
When multiple jsExpressionable s are collected inside an array and may have some degree of nesting convert it into a one - dimensional array so that it s easier for us to wrap it into a function body .