Conditions | 6 |
Paths | 6 |
Total Lines | 16 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 10.5 |
Changes | 0 |
1 | <?php |
||
20 | 18 | public static function create(string $name): Method |
|
21 | { |
||
22 | switch ($name) { |
||
23 | 18 | case 'LIST': |
|
24 | 16 | return new MethodList(); |
|
25 | 4 | case 'POST': |
|
26 | return new MethodPost(); |
||
27 | 4 | case 'GET': |
|
28 | 4 | return new MethodGet(); |
|
29 | case 'PUT': |
||
30 | return new MethodPut(); |
||
31 | case 'DELETE': |
||
32 | return new MethodDelete(); |
||
33 | } |
||
34 | throw new \RuntimeException(sprintf('Unknown Method %s', $name)); |
||
35 | } |
||
36 | } |
||
37 |