| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 5 | public function getXML(): \SimpleXMLElement |
|
| 17 | { |
||
| 18 | 5 | if (is_null($this->namespace)) { |
|
| 19 | 1 | throw new PohodaException('Namespace not set.'); |
|
| 20 | } |
||
| 21 | |||
| 22 | 4 | if (is_null($this->nodePrefix)) { |
|
| 23 | 1 | throw new PohodaException('Node name prefix not set.'); |
|
| 24 | } |
||
| 25 | |||
| 26 | 3 | $xml = $this->createXML()->addChild($this->namespace . ':' . $this->nodePrefix . 'Item', '', $this->namespace($this->namespace)); |
|
| 27 | |||
| 28 | 3 | $this->addElements($xml, $this->getDataElements(), $this->namespace); |
|
| 29 | |||
| 30 | 3 | return $xml; |
|
| 31 | } |
||
| 41 |