| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 4 | public function toXml(): string |
|
| 18 | { |
||
| 19 | 4 | $dom = new \DOMDocument('1.0', 'utf-8'); |
|
| 20 | 4 | $rss = $dom->appendChild($dom->createElement('rss')); |
|
| 21 | 4 | $rss->setAttribute('xmlns:googleplay', 'http://www.google.com/schemas/play-podcasts/1.0'); |
|
| 22 | 4 | $rss->setAttribute('xmlns:itunes', 'http://www.itunes.com/dtds/podcast-1.0.dtd'); |
|
| 23 | 4 | $rss->setAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom'); |
|
| 24 | 4 | $rss->setAttribute('version', '2.0'); |
|
| 25 | |||
| 26 | 4 | foreach ($this->channels as $channel) { |
|
| 27 | 4 | $rss->appendChild($channel->toDOMElement($dom)); |
|
| 28 | } |
||
| 29 | |||
| 30 | 4 | $dom->formatOutput = true; |
|
| 31 | |||
| 32 | 4 | return $dom->saveXML(); |
|
| 33 | } |
||
| 35 |