Conditions | 4 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4.3731 |
Changes | 0 |
1 | <?php namespace Comodojo\Dispatcher\Request; |
||
42 | 7 | private static function getParameters() { |
|
43 | |||
44 | 7 | switch ($_SERVER['REQUEST_METHOD']) { |
|
45 | |||
46 | 7 | case 'POST': |
|
|
|||
47 | |||
48 | $parameters = $_POST; |
||
49 | |||
50 | break; |
||
51 | |||
52 | 7 | case 'PUT': |
|
53 | 7 | case 'DELETE': |
|
54 | |||
55 | parse_str(file_get_contents('php://input'), $parameters); |
||
56 | |||
57 | break; |
||
58 | |||
59 | 7 | default: |
|
60 | |||
61 | 7 | $parameters = array(); |
|
62 | |||
63 | 7 | break; |
|
64 | |||
65 | 7 | } |
|
66 | |||
67 | 7 | return $parameters; |
|
68 | |||
78 |
According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.
}
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.