Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
40 | public function toNode(DOMDocument $document = null) |
||
41 | { |
||
42 | if (is_null($document)) { |
||
43 | $document = new DOMDocument(); |
||
44 | } |
||
45 | |||
46 | $node = $document->createElement('BillShipper'); |
||
47 | if ($this->getAccountNumber()) { |
||
48 | $node->appendChild($document->createElement('AccountNumber', $this->getAccountNumber())); |
||
49 | } |
||
50 | |||
51 | return $node; |
||
52 | } |
||
53 | |||
93 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: