src/Web/Result.php
protected function simplifyResponse(array $response)
    {
        // Simplify response by removing main key (which should be the only
        // remaining one).
        if (!empty($this->mainResponseKey) && isset($response[$this->mainResponseKey])) {
            $response = $response[$this->mainResponseKey];

            if ($this->isList) {
                // Remove further indirection, i.e. get value of "singular",
                // which will be the first (and only) key.
                $response = reset($response);
                // If there was only 1 list result, it wasn't put in an array.
                if (!is_array(reset($response))) {
                    $response = array($response);
                }
            }
        }
        return $response;
    }
protected function simplifyResponse(array $response)
    {
        // Simplify response by removing main key (which should be the only
        // remaining one).
        if (!empty($this->mainResponseKey) && isset($response[$this->mainResponseKey])) {
            $response = $response[$this->mainResponseKey];

            if ($this->isList) {
                // Remove further indirection, i.e. get value of "singular",
                // which will be the first (and only) key.
                $response = reset($response);
                // If there was only 1 list result, it wasn't put in an array.
                if (!is_array(reset($response))) {
                    $response = array($response);
                }
            }
        }
        return $response;
    }
protected function simplifyResponse ( array $ response ) { // Simplify response by removing main key (which should be the only // remaining one). if ( ! empty ( $ this -> mainResponseKey ) && isset ( $ response [ $ this -> mainResponseKey ] ) ) { $ response = $ response [ $ this -> mainResponseKey ] ; if ( $ this -> isList ) { // Remove further indirection, i.e. get value of "singular", // which will be the first (and only) key. $ response = reset ( $ response ) ; // If there was only 1 list result, it wasn't put in an array. if ( ! is_array ( reset ( $ response ) ) ) { $ response = array ( $ response ) ; } } } return $ response ; }
Simplify the response by removing the main key.

@param array $response

@return array
Simplify the response by removing the main key .