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