protected function filterMethod(string $method) : string { if (!is_string($method)) { throw new InvalidMethodException('Request method must be a string.'); } return strtoupper($method); }