| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 16 | public static function createByFilepath($filepath) |
||
| 17 | { |
||
| 18 | $dom = new static('1.0', 'UTF-8'); |
||
| 19 | $dom->formatOutput = true; |
||
| 20 | $dom->preserveWhiteSpace = false; |
||
| 21 | |||
| 22 | if (file_exists($filepath)) { |
||
| 23 | $dom->load($filepath); |
||
| 24 | } else { |
||
| 25 | $dom->loadXML(static::$defaultXml); |
||
| 26 | } |
||
| 27 | |||
| 28 | return $dom; |
||
| 29 | } |
||
| 30 | } |
||
| 31 |