protected function registerDefaultParser()
    {
        $this->registerMediaTypeParser('application/json', function (string $input) {
            $result = json_decode($input, true);
            if (! is_array($result)) {
                return null;
            }

            return $result;
        }, null);
        $this->registerMediaTypeParser('application/xml', function (string $input) {
            $backup        = libxml_disable_entity_loader(true);
            $backup_errors = libxml_use_internal_errors(true);
            $result        = simplexml_load_string($input);
            libxml_disable_entity_loader($backup);
            libxml_clear_errors();
            libxml_use_internal_errors($backup_errors);
            if ($result === false) {
                return null;
            }

            return $result;
        }, null);
        $this->registerMediaTypeParser('text/xml', function (string $input) {
            $backup        = libxml_disable_entity_loader(true);
            $backup_errors = libxml_use_internal_errors(true);
            $result        = simplexml_load_string($input);
            libxml_disable_entity_loader($backup);
            libxml_clear_errors();
            libxml_use_internal_errors($backup_errors);
            if ($result === false) {
                return null;
            }

            return $result;
        }, null);
        $this->registerMediaTypeParser('application/x-www-form-urlencoded', function (string $input) {
            parse_str($input, $data);
            return $data;
        }, null);
    }