public static function fromJSON($json)
    {
        $request = new static();
        print_r($json);
        $data = json_decode($json, true);
print_r($data);
        if (!$data) {
            throw new UnexpectedValueException(sprintf(
                'Unexpected message, invalid JSON from nginx: "%s"', $json
            ));
        }

        if (isset($data['id'])) {
            $request->setId($data['id']);
        }

        if (isset($data['method'])) {
            $request->setMethod($data['method']);
        }

        if (isset($data['params'])) {
            $request->setPrams($data['params']);
        }

        return $request;
    }
public static function fromJSON($json)
    {
        $request = new static();
        print_r($json);
        $data = json_decode($json, true);
print_r($data);
        if (!$data) {
            throw new UnexpectedValueException(sprintf(
                'Unexpected message, invalid JSON from nginx: "%s"', $json
            ));
        }

        if (isset($data['id'])) {
            $request->setId($data['id']);
        }

        if (isset($data['method'])) {
            $request->setMethod($data['method']);
        }

        if (isset($data['params'])) {
            $request->setPrams($data['params']);
        }

        return $request;
    }
public static function fromJSON ( $ json ) { $ request = new static ( ) ; print_r ( $ json ) ; $ data = json_decode ( $ json , true ) ; print_r ( $ data ) ; if ( ! $ data ) { throw new UnexpectedValueException ( sprintf ( 'Unexpected message, invalid JSON from nginx: "%s"' , $ json ) ) ; } if ( isset ( $ data [ 'id' ] ) ) { $ request -> setId ( $ data [ 'id' ] ) ; } if ( isset ( $ data [ 'method' ] ) ) { $ request -> setMethod ( $ data [ 'method' ] ) ; } if ( isset ( $ data [ 'params' ] ) ) { $ request -> setPrams ( $ data [ 'params' ] ) ; } return $ request ; }
Configure the request based on a JSON

@param  string  $json
@return boolean
Configure the request based on a JSON