Total Complexity | 2 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 50% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class NoInvoker implements InvokerInterface |
||
11 | { |
||
12 | /** |
||
13 | * Generate code for a function or method class for the route. |
||
14 | * |
||
15 | * The argument template should have two '%s' placeholders. The first is used for the argument name, the second for |
||
16 | * the default value. |
||
17 | * |
||
18 | * @param array $route |
||
19 | * @param callable $genArg Callback to generate code for arguments. |
||
20 | * @param string $new PHP code to instantiate class. |
||
21 | * @return string |
||
22 | */ |
||
23 | public function generateInvocation(array $route, callable $genArg, string $new = '(new %s)'): string |
||
24 | { |
||
25 | return '[200, ' . var_export($route, true) . ', ' . $genArg(null) . ']'; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Generate standard code for when no route matches. |
||
30 | * |
||
31 | * @return string |
||
32 | */ |
||
33 | 1 | public function generateDefault(): string |
|
36 | } |
||
37 | } |
||
38 |