Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
25 | 6 | public function toString($config, $pretty = true) |
|
26 | { |
||
27 | 6 | $xml = $this->toXML($config); |
|
28 | 6 | if ($pretty == false) { |
|
|
|||
29 | 3 | return $xml; |
|
30 | } |
||
31 | |||
32 | 3 | $dom = new DOMDocument(); |
|
33 | 3 | $dom->preserveWhiteSpace = false; |
|
34 | 3 | $dom->formatOutput = true; |
|
35 | 3 | $dom->loadXML($xml); |
|
36 | |||
37 | 3 | return $dom->saveXML(); |
|
38 | } |
||
39 | |||
74 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.