@@ 126-129 (lines=4) @@ | ||
123 | string $requestedPath, |
|
124 | string $folder = '' |
|
125 | ) { |
|
126 | if (!in_array($method, self::$validRequestMethods, true)) { |
|
127 | $message = sprintf('%s is not valid Http request method.', $method); |
|
128 | throw new UnexpectedValueException($message); |
|
129 | } |
|
130 | $this->method = $method; |
|
131 | $this->requestedPath = $this->extractFolder($requestedPath, $folder); |
|
132 | $this->defaultReturnType = self::$translations[$defaultReturnType] ?? self::$validReturnTypes[0]; |
|
@@ 210-213 (lines=4) @@ | ||
207 | */ |
|
208 | private function checkRequestMethodIsValid(string $requestMethod) |
|
209 | { |
|
210 | if (!in_array(strtoupper($requestMethod), self::$validRequestMethods, true)) { |
|
211 | $message = sprintf('%s is not valid Http request method.', $requestMethod); |
|
212 | throw new UnexpectedValueException($message); |
|
213 | } |
|
214 | } |
|
215 | ||
216 | /** |