src/Message.php
private static function fromJsonString($requestBody)
    {
        $data = json_decode($requestBody, true);
        if (JSON_ERROR_NONE !== json_last_error() || !is_array($data)) {
            throw new \RuntimeException('Invalid POST data.');
        }

        return new Message($data);
    }
private static function fromJsonString($requestBody)
    {
        $data = json_decode($requestBody, true);
        if (JSON_ERROR_NONE !== json_last_error() || !is_array($data)) {
            throw new \RuntimeException('Invalid POST data.');
        }

        return new Message($data);
    }
private static function fromJsonString ( $ requestBody ) { $ data = json_decode ( $ requestBody , true ) ; if ( JSON_ERROR_NONE !== json_last_error ( ) || ! is_array ( $ data ) ) { throw new \ RuntimeException ( 'Invalid POST data.' ) ; } return new Message ( $ data ) ; }
Creates a Message object from a JSON-decodable string.

@param string $requestBody
@return Message
Creates a Message object from a JSON - decodable string .