| Conditions | 3 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | 4 | public function compare(): bool |
|
| 45 | { |
||
| 46 | if ( |
||
| 47 | 4 | !$this->first instanceof XmlConvertibleInterface |
|
| 48 | 4 | || !$this->second instanceof XmlConvertibleInterface |
|
| 49 | ) { |
||
| 50 | 1 | return false; |
|
| 51 | } |
||
| 52 | |||
| 53 | 3 | $document = new \DOMDocument(); |
|
| 54 | 3 | $document->appendChild($this->first->toXml($document)); |
|
| 55 | 3 | $current = $document->saveXML(); |
|
| 56 | |||
| 57 | 3 | $document = new \DOMDocument(); |
|
| 58 | 3 | $document->appendChild($this->second->toXml($document)); |
|
| 59 | 3 | $compared = $document->saveXML(); |
|
| 60 | |||
| 61 | 3 | return $current === $compared; |
|
| 62 | } |
||
| 63 | } |