Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
40 | 23 | public function toString() |
|
41 | { |
||
42 | 23 | $key = \strtoupper($this->format); |
|
43 | |||
44 | $list = [ |
||
45 | 23 | 'JSON' => 'application/json', |
|
46 | 23 | 'XML' => 'application/xml', |
|
47 | 23 | 'RAW' => 'application/octet-stream', |
|
48 | 'FORM' => 'application/x-www-form-urlencoded' |
||
49 | 23 | ]; |
|
50 | |||
51 | 23 | return isset($list[$key]) ? $list[$key] : $list['RAW']; |
|
52 | } |
||
54 |