public function getMethod(): string
    {
        if (null === $this->method) {
            $this->method = strtoupper(
                $this->server->get('REQUEST_METHOD', RequestMethod::GET)
            );

            if (RequestMethod::POST === $this->method) {
                if ($method = $this->headers->get('X-HTTP-METHOD-OVERRIDE')) {
                    $this->method = strtoupper($method);
                } elseif (self::$httpMethodParameterOverride) {
                    $this->method = strtoupper(
                        $this->request->get(
                            '_method',
                            $this->query->get(
                                '_method',
                                RequestMethod::POST
                            )
                        )
                    );
                }
            }
        }

        return $this->method;
    }