| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 8 | public function asXML(): SimpleXMLElement |
|
| 34 | { |
||
| 35 | 8 | $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><link>' |
|
| 36 | 8 | . $this->title . '</link>', LIBXML_NOERROR | LIBXML_ERR_NONE | LIBXML_ERR_FATAL); |
|
| 37 | |||
| 38 | 8 | $xml->addAttribute('url', $this->link); |
|
| 39 | |||
| 40 | 8 | if (!empty($this->img)) { |
|
| 41 | 8 | $xml->addAttribute('img', $this->img); |
|
| 42 | } |
||
| 43 | |||
| 44 | 8 | return $xml; |
|
| 45 | } |
||
| 46 | } |
||
| 47 |