Jackalope\Transport\Jackrabbit\Request::executeJson PHP Метод

executeJson() публичный Метод

Returns a decoded json string from the backend or throws exception
public executeJson ( boolean $forceMultiple = false ) : mixed
$forceMultiple boolean whether to force parallel requests or not
Результат mixed
    public function executeJson($forceMultiple = false)
    {
        $responses = $this->execute(null, $forceMultiple);
        if (!is_array($responses)) {
            $responses = array($responses);
            $reset = true;
        }
        $json = array();
        foreach ($responses as $key => $response) {
            $json[$key] = json_decode($response);
            if (null === $json[$key] && 'null' !== strtolower($response)) {
                $uri = reset($this->uri);
                throw new RepositoryException("Not a valid json object: \nRequest: {$this->method} {$uri} \nResponse: \n{$response}");
            }
        }
        //TODO: are there error responses in json format? if so, handle them
        if (isset($reset)) {
            return reset($json);
        }
        return $json;
    }