src/ApiProblem.php
public static function fromJson(string $json) : self
    {
        if (empty($json)) {
            throw new JsonParseException('An empty string is not a valid JSON value', JSON_ERROR_SYNTAX, null, $json);
        }
        $parsed = json_decode($json, true);

        $lastError = json_last_error();

        if (\JSON_ERROR_NONE !== $lastError) {
            throw JsonParseException::fromJsonError($lastError, $json);
        }

        return static::decompile($parsed);
    }
public static function fromJson(string $json) : self
    {
        if (empty($json)) {
            throw new JsonParseException('An empty string is not a valid JSON value', JSON_ERROR_SYNTAX, null, $json);
        }
        $parsed = json_decode($json, true);

        $lastError = json_last_error();

        if (\JSON_ERROR_NONE !== $lastError) {
            throw JsonParseException::fromJsonError($lastError, $json);
        }

        return static::decompile($parsed);
    }
public static function fromJson ( string $ json ) : self { if ( empty ( $ json ) ) { throw new JsonParseException ( 'An empty string is not a valid JSON value' , JSON_ERROR_SYNTAX , null , $ json ) ; } $ parsed = json_decode ( $ json , true ) ; $ lastError = json_last_error ( ) ; if ( \ JSON_ERROR_NONE !== $ lastError ) { throw JsonParseException :: fromJsonError ( $ lastError , $ json ) ; } return static :: decompile ( $ parsed ) ; }
Parses a JSON string into a Problem object.

@param string $json
The JSON string to parse.
@return ApiProblem
A newly constructed problem object.

@throws JsonParseException
Invalid JSON strings will result in a thrown exception.
Parses a JSON string into a Problem object .