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