private function getAllowedMethods(ServerRequestInterface $request): array
    {
        $allowed = [];

        $requestPath = $request->getUri()->getPath();

        foreach (Method::all() as $method) {
            $matchThis = "$requestPath{}$method";

            if (preg_match($this->pattern, $matchThis, $matches) === 1) {
                $allowed[$method] = $this->getRoute($matches);
            }
        }

        return $allowed;
    }