Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
33 | 21 | public function render() |
|
34 | { |
||
35 | 21 | $xml = new SimpleXMLElement('<?xml version="1.0" encoding="' . $this->encoding |
|
36 | 21 | . '" ?><rss version="2.0" xmlns:yandex="http://news.yandex.ru" xmlns:media="http://search.yahoo.com/mrss/" xmlns:turbo="http://turbo.yandex.ru" />', |
|
37 | 21 | LIBXML_NOERROR | LIBXML_ERR_NONE | LIBXML_ERR_FATAL); |
|
38 | |||
39 | 21 | foreach ($this->channels as $channel) { |
|
40 | 7 | $toDom = dom_import_simplexml($xml); |
|
41 | 7 | $fromDom = dom_import_simplexml($channel->asXML()); |
|
42 | 7 | $toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true)); |
|
43 | 9 | } |
|
44 | |||
45 | 21 | $dom = new DOMDocument('1.0', 'UTF-8'); |
|
46 | 21 | $dom->appendChild($dom->importNode(dom_import_simplexml($xml), true)); |
|
47 | 21 | $dom->formatOutput = true; |
|
48 | 21 | return $dom->saveXML(); |
|
49 | } |
||
50 | |||
56 |