| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function withVerbs(string ...$verbs): RouteInterface |
||
| 32 | { |
||
| 33 | foreach ($verbs as &$verb) { |
||
| 34 | $verb = strtoupper($verb); |
||
| 35 | if (!in_array($verb, RouteInterface::VERBS, true)) { |
||
| 36 | throw new RouteException("Invalid HTTP verb `{$verb}`"); |
||
| 37 | } |
||
| 38 | |||
| 39 | unset($verb); |
||
| 40 | } |
||
| 41 | unset($verb); |
||
| 42 | |||
| 43 | $route = clone $this; |
||
| 44 | $route->verbs = $verbs; |
||
| 45 | |||
| 46 | return $route; |
||
| 47 | } |
||
| 59 |