src/ResourceBuilder.php
public static function fromString(string $input, string $locale): Resource
    {
        $data = json_decode($input, true);
        if (json_last_error() !== \JSON_ERROR_NONE) {
            if (function_exists('json_last_error_msg')) {
                throw new \InvalidArgumentException(json_last_error_msg(), json_last_error());
            }
            throw new \InvalidArgumentException("Error parsing JSON.", json_last_error());
        }

        return static::fromArray($data, $locale);
    }
public static function fromString(string $input, string $locale): Resource
    {
        $data = json_decode($input, true);
        if (json_last_error() !== \JSON_ERROR_NONE) {
            if (function_exists('json_last_error_msg')) {
                throw new \InvalidArgumentException(json_last_error_msg(), json_last_error());
            }
            throw new \InvalidArgumentException("Error parsing JSON.", json_last_error());
        }

        return static::fromArray($data, $locale);
    }
public static function fromString ( string $ input , string $ locale ) : Resource { $ data = json_decode ( $ input , true ) ; if ( json_last_error ( ) !== \ JSON_ERROR_NONE ) { if ( function_exists ( 'json_last_error_msg' ) ) { throw new \ InvalidArgumentException ( json_last_error_msg ( ) , json_last_error ( ) ) ; } throw new \ InvalidArgumentException ( "Error parsing JSON." , json_last_error ( ) ) ; } return static :: fromArray ( $ data , $ locale ) ; }
Creates a Resource from a JSON string
@param string $input The JSON object
@param string $locale The locale
@return Resource
Creates a Resource from a JSON string