| Total Complexity | 6 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | trait STAHelper |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @param array $methods |
||
| 17 | * @param string $uri |
||
| 18 | * @param callable $processor |
||
| 19 | * @return static |
||
| 20 | */ |
||
| 21 | public function match(array $methods, string $uri, callable $processor) : self |
||
| 22 | { |
||
| 23 | foreach ($methods as $method) { |
||
| 24 | $this->$method($uri, $processor); |
||
| 25 | } |
||
| 26 | return $this; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param string $uri |
||
| 31 | * @param object $controller |
||
| 32 | * @return static |
||
| 33 | */ |
||
| 34 | public function rest(string $uri, object $controller) : self |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $uri |
||
| 44 | * @param callable $processor |
||
| 45 | * @return static |
||
| 46 | */ |
||
| 47 | public function any(string $uri, callable $processor) : self |
||
| 53 | } |
||
| 54 | } |
||
| 55 |