|
@@ 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]; |
|
@@ 174-177 (lines=4) @@
|
| 171 |
|
$requestMethodParameterType); |
| 172 |
|
throw new InvalidArgumentException($message); |
| 173 |
|
} |
| 174 |
|
if (!in_array(strtoupper($requestMethod), self::$validRequestMethods, true)) { |
| 175 |
|
$message = sprintf('%s is not valid Http request method.', $requestMethod); |
| 176 |
|
throw new UnexpectedValueException($message); |
| 177 |
|
} |
| 178 |
|
if ($alias !== null) { |
| 179 |
|
$this->aliases[$alias] = $route; |
| 180 |
|
} |
|
@@ 192-195 (lines=4) @@
|
| 189 |
|
*/ |
| 190 |
|
public function __call(string $method, array $args) |
| 191 |
|
{ |
| 192 |
|
if (!in_array(strtoupper($method), self::$validRequestMethods, true)) { |
| 193 |
|
$message = sprintf('%s is not valid Http request method.', $method); |
| 194 |
|
throw new UnexpectedValueException($message); |
| 195 |
|
} |
| 196 |
|
$defaults = [ |
| 197 |
|
null, |
| 198 |
|
null, |