You are here

function json_decode in Auth0 Single Sign On 8.2

Wrapper for json_decode that throws when an error occurs.

@link http://www.php.net/manual/en/function.json-decode.php

Parameters

string $json JSON data to parse:

bool $assoc When true, returned objects will be converted: into associative arrays.

int $depth User specified recursion depth.:

int $options Bitmask of JSON decode options.:

Return value

mixed

Throws

Exception\InvalidArgumentException if the JSON cannot be decoded.

1 string reference to 'json_decode'
Oauth2Client::checkRequirements in vendor/auth0/auth0-php/src/API/Oauth2Client.php
Checks for all dependencies of SDK or API.

File

vendor/guzzlehttp/guzzle/src/functions.php, line 301

Namespace

GuzzleHttp

Code

function json_decode($json, $assoc = false, $depth = 512, $options = 0) {
  $data = \json_decode($json, $assoc, $depth, $options);
  if (JSON_ERROR_NONE !== json_last_error()) {
    throw new Exception\InvalidArgumentException('json_decode error: ' . json_last_error_msg());
  }
  return $data;
}