src/JsonUtils.php
public static function decode($json, $assoc = false, $options = 0)
    {
        if (!is_string($json)) {
            throw new \InvalidArgumentException('Argument json is not a string');
        }
        $result = json_decode($json, (bool) $assoc, 512, (int) $options);
        if ($result === null) {
            throw new \RuntimeException(static::$errorMessages[json_last_error()]);
        }

        return $result;
    }
public static function decode($json, $assoc = false, $options = 0)
    {
        if (!is_string($json)) {
            throw new \InvalidArgumentException('Argument json is not a string');
        }
        $result = json_decode($json, (bool) $assoc, 512, (int) $options);
        if ($result === null) {
            throw new \RuntimeException(static::$errorMessages[json_last_error()]);
        }

        return $result;
    }
public static function decode ( $ json , $ assoc = false , $ options = 0 ) { if ( ! is_string ( $ json ) ) { throw new \ InvalidArgumentException ( 'Argument json is not a string' ) ; } $ result = json_decode ( $ json , ( bool ) $ assoc , 512 , ( int ) $ options ) ; if ( $ result === null ) { throw new \ RuntimeException ( static :: $ errorMessages [ json_last_error ( ) ] ) ; } return $ result ; }
Decode a JSON string into a php representation.

@param string $json    string to convert
@param bool   $assoc   return as associative array
@param int    $options JSON options

@throws \InvalidArgumentException
@throws \RuntimeException

@return mixed
Decode a JSON string into a php representation .