private function setAllowedMethods(array $allowedMethods)
{
foreach ($allowedMethods as $key => $method) {
if (!\is_string($method)) {
throw new \DomainException(\sprintf("Invalid type at key %s of allowed methods array: %s", $key, \is_object($method) ? \get_class($method) : \gettype($method)));
}
if ($method === "") {
throw new \DomainException("Invalid empty HTTP method at key {$key} of allowed methods array");
}
}
if (!\in_array("GET", $allowedMethods)) {
throw new \DomainException("Servers must support GET as an allowed HTTP method");
}
if (!\in_array("HEAD", $allowedMethods)) {
throw new \DomainException("Servers must support HEAD as an allowed HTTP method");
}
$this->allowedMethods = $allowedMethods;
}