public function validateHttpMethods($httpMethods, $availableHttpMethods)
    {
        if (empty($httpMethods)) {
            return null;
        }

        $missing_methods = array_diff(array_values($httpMethods), array_keys($availableHttpMethods));
        if (!empty($missing_methods)) {
            throw new \InvalidArgumentException(sprintf('HTTP methods "%s" are invalid.', implode(', ', $missing_methods)));
        }

        return $httpMethods;
    }