public function checkMethods(array $methods): array
    {
        return array_map(
            function($method) {
                $method = strtolower($method);
                if (!\in_array($method, self::METHODS, false)) {
                    throw new Exception("Method \"$method\" is not in allowed list [" . implode(',',
                            self::METHODS) . ']');
                }
                return $method;
            },
            $methods
        );
    }