| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | 2 | public function buildMethod(Query $query) |
|
| 35 | { |
||
| 36 | static $defaultMethods = [ |
||
| 37 | 'get' => 'GET', |
||
| 38 | 'put' => 'PUT', |
||
| 39 | 'head' => 'HEAD', |
||
| 40 | 'post' => 'GET', |
||
| 41 | 'search' => 'GET', |
||
| 42 | 'insert' => 'POST', |
||
| 43 | 'update' => 'PUT', |
||
| 44 | 'delete' => 'DELETE', |
||
| 45 | 2 | ]; |
|
| 46 | |||
| 47 | 2 | return isset($defaultMethods[$query->action]) ? $defaultMethods[$query->action] : 'POST'; |
|
| 48 | } |
||
| 49 | |||
| 80 |