@param string $requestFormat

@return $this
16911
public function setRequestFormat($requestFormat)
    {
        $this->requestFormat = $requestFormat;
        switch ($requestFormat) {
            case self::FORMAT_JSON:
                $this->setRequestContentType(self::CONTENT_TYPE_JSON);
                break;
            case self::FORMAT_XML:
                $this->setRequestContentType(self::CONTENT_TYPE_XML);
                break;
            case self::FORMAT_URL_ENCODED:
                $this->setRequestContentType(self::CONTENT_TYPE_URL_ENCODED);
                break;
        }

        return $this;
    }
766314
public function setRequestMode($requestMode)
    {
        if (null !== $requestMode && (self::REQUEST_MODE_ASYNCHRONOUS !== $requestMode && self::REQUEST_MODE_SYNCHRONOUS !== $requestMode)) {
            throw new \InvalidArgumentException("invalid mode [{$requestMode}], expecting one of self::REQUEST_MODE_*");
        }
        $this->requestMode = $requestMode;
    }
1137977
public function setColumnFormat($attr, $format = null)
    {
        $formats = is_array($attr)
            ? $attr
            : [$attr => $format];

        foreach ($formats as $a => $f)
            $this->_setSingleColumnFormat($a, $f);

        return $this;
    }
266483
private function createFormat($audioFormat)
    {
        switch ($audioFormat) {
            case 'aac':
                $format = new Aac();
                break;

            case 'flac':
                $format = new Flac();
                break;

            case 'vorbis':
                $format = new Vorbis();
                break;

            case 'mp3':
            default:
                $format = new Mp3();
                break;
        }

        return $format;
    }
575427
public function setFormatter(FormatterInterface $formatter)
    {
        foreach ($this->results as $name) {
            $this->columns->offsetGet($name)->setFormatter($formatter);
        }

        return $this;
    }
1322307
public function setFormat($format)
    {
        if (!is_null($format)) {
            $this->format = $format;
            $this->useFormat(false);
        }

        return $this;
    }
787732
protected function getFormat(Request $request)
    {
        $format = $request->getQueryParam('format');
        if (!isset($format)) {
            $format = $this->defaultFormat;
        }

        return $format;
    }
242438
public function setTimeFormat($format) {
        if (is_string($format)) {
            $this->timeFormatter = function ($t) use ($format) {
                return strftime($format, $t);
            };
        } else {
            $this->timeFormatter = $format;
        }

        return $this;
    }
408511
public function setRequestUri(string $requestUri) : Request
    {
        $pos = strpos($requestUri, '?');

        if ($pos === false) {
            $this->path = $requestUri;
            $this->queryString = '';
            $this->query = [];
        } else {
            $this->path        = substr($requestUri, 0, $pos);
            $this->queryString = substr($requestUri, $pos + 1);

            if ($this->queryString === '') {
                $this->query = [];
            } else {
                parse_str($this->queryString, $this->query);
            }
        }

        $this->requestUri = $requestUri;

        return $this;
    }
505992
public function setFormat($format)
    {
        $this->_format = $format;
        // Use formatter content type if exists
        if (isset($this->contentTypes[$this->_format])) {
            $this->ci->output
                ->set_content_type($this->contentTypes[$this->_format]);
        }

        return $this;
    }
12250
public function format($newFormat = null)
    {
        if ($newFormat === null) {
            return $this->format;
        }

        $this->format = $newFormat;

        return $this;
    }
629389
public function setDisplayFormat($displayFormat)
    {
        if (!in_array($displayFormat, static::FORMATS)) {
            throw new \InvalidArgumentException("bad format '{$displayFormat}'");
        }
        $this->displayFormat = $displayFormat;

        return $this;
    }
1210283
public function allowsRequestMethod($requestMethod) {

		return empty($this->requestMethods) || in_array(strtoupper($requestMethod), $this->requestMethods);

	}
1170169
public static function resolve($format, $requestName)
    {
        if (! array_key_exists($requestName, self::$variants)) {
            throw new RequestNotSupportedException(sprintf(
                'Request [%s] not supported here.', $requestName
            ));
        }

        if (! array_key_exists($format, self::$variants[$requestName])) {
            throw new FormatNotSupportedException(sprintf(
                'Format [%s] not supported for request [%s].', $format, $requestName
            ));
        }

        return self::$variants[$requestName][$format];
    }
525208
public function setFormat($format)
    {
        switch ($format) {
            case self::FORMAT_BASE32:
                $this->encoder = new Base32Encoder();
                break;
            case self::FORMAT_HEX:
                $this->encoder = new HexEncoder();
                break;
            case self::FORMAT_RAW:
            default:
                $this->encoder = new RawEncoder();
        }

        return $this;
    }
311064
public function buildArgsFormat(ArgsFormat $baseFormat = null)
    {
        $formatBuilder = ArgsFormat::build($baseFormat);

        if (!$this->anonymous) {
            $formatBuilder->addCommandName(new CommandName($this->name, $this->aliases));
        }

        $formatBuilder->addOptions($this->getOptions());
        $formatBuilder->addArguments($this->getArguments());

        return $formatBuilder->getFormat();
    }
1198378
public function setFormat(string $format = \null)
    {
        $validValues = ['png', 'jpg', 'webp'];

        if (\null !== $format && !\in_array($format, $validValues, \true)) {
            throw new \InvalidArgumentException(\sprintf(
                'Unknown format "%s" given. Expected "%s" or null.',
                $format,
                \implode(', ', $validValues)
            ));
        }

        $this->format = $format;

        return $this;
    }