| Total Complexity | 5 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 14 | trait HasDomTrait |
||
| 15 | { |
||
| 16 | /** @var DOMDocument $dom */ |
||
| 17 | private $dom; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param $tagType |
||
| 21 | * @return DOMElement |
||
| 22 | */ |
||
| 23 | 34 | public function createElement($tagType) |
|
| 24 | { |
||
| 25 | 34 | return $this->dom->createElement($tagType); |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param $text |
||
| 30 | * @return DOMText |
||
| 31 | */ |
||
| 32 | 25 | public function createText($text) |
|
| 33 | { |
||
| 34 | 25 | return new DOMText($text); |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return DOMElement |
||
| 39 | */ |
||
| 40 | 3 | public function createLineBreak() |
|
| 41 | { |
||
| 42 | 3 | return $this->createElement('br'); |
|
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return DOMDocument |
||
| 47 | */ |
||
| 48 | 66 | public function getDom() |
|
| 49 | { |
||
| 50 | 66 | return $this->dom; |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param DOMDocument $dom |
||
| 55 | * @return $this |
||
| 56 | */ |
||
| 57 | 66 | public function setDom($dom) |
|
| 61 | } |
||
| 62 | } |