| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 18 | public function asXML() |
|
| 27 | { |
||
| 28 | 18 | $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><yandex:related xmlns:yandex="http://news.yandex.ru"></yandex:related>', LIBXML_NOERROR | LIBXML_ERR_NONE | LIBXML_ERR_FATAL); |
|
| 29 | |||
| 30 | 18 | foreach ($this->relatedItems as $item) { |
|
| 31 | 6 | $toDom = dom_import_simplexml($xml); |
|
| 32 | 6 | $fromDom = dom_import_simplexml($item->asXML()); |
|
| 33 | 6 | $toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true)); |
|
| 34 | 9 | } |
|
| 35 | |||
| 36 | 18 | return $xml; |
|
| 37 | } |
||
| 38 | } |
||
| 39 |