Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
26 | public function parse() |
||
27 | { |
||
28 | if ($this->body === false) { |
||
29 | return null; |
||
30 | } |
||
31 | |||
32 | $result = []; |
||
33 | $key = null; |
||
34 | foreach ($this->body as $value) { |
||
35 | if (!is_null($key)) { |
||
36 | $result[$key] = $value; |
||
37 | $key = null; |
||
38 | } else { |
||
39 | $key = $value; |
||
40 | } |
||
41 | } |
||
42 | |||
43 | return $result; |
||
44 | } |
||
45 | } |