src/Plugin/Json.php
public function decode($json, $assoc = false, $depth = 512, $options = 0)
    {
        $result = json_decode((string) $json, (bool) $assoc, (int) $depth, (int) $options);
        if (null === $result && JSON_ERROR_NONE !== json_last_error()) {
            throw new RuntimeException(
                json_last_error_msg(),
                json_last_error()
            );
        }

        return $result;
    }
public function decode($json, $assoc = false, $depth = 512, $options = 0)
    {
        $result = json_decode((string) $json, (bool) $assoc, (int) $depth, (int) $options);
        if (null === $result && JSON_ERROR_NONE !== json_last_error()) {
            throw new RuntimeException(
                json_last_error_msg(),
                json_last_error()
            );
        }

        return $result;
    }
public function decode ( $ json , $ assoc = false , $ depth = 512 , $ options = 0 ) { $ result = json_decode ( ( string ) $ json , ( bool ) $ assoc , ( int ) $ depth , ( int ) $ options ) ; if ( null === $ result && JSON_ERROR_NONE !== json_last_error ( ) ) { throw new RuntimeException ( json_last_error_msg ( ) , json_last_error ( ) ) ; } return $ result ; }
Decodes json.

@param string $json    The json string being decoded
@param bool   $assoc   When true, returned objects will be converted into
associative arrays
@param int    $depth   User specified recursion depth
@param int    $options Bitmask of JSON decode options

@throws \RuntimeException If decoding fails

@return mixed Returns the value encoded in json in appropriate PHP type
Decodes json .