Conditions | 4 |
Paths | 6 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | 54 | public function toString() |
|
41 | { |
||
42 | 54 | $string = ''; |
|
43 | 54 | foreach ($this->data as $key => $value) { |
|
44 | 54 | $encode = rawurlencode($value); |
|
45 | 54 | if ($encode === '') { |
|
46 | 54 | $string .= "$key&"; |
|
47 | } else { |
||
48 | 54 | $string .= "$key=$encode&"; |
|
49 | 54 | } |
|
50 | 54 | } |
|
51 | |||
52 | 54 | if (0 < count($this->data)) { |
|
53 | $string = substr($string, 0, -1); |
||
54 | } |
||
55 | |||
56 | return $string; |
||
57 | } |
||
69 |