| Total Complexity | 4 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | trait LibxmlTrait |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * Bitwise libxml options to use for parsing XML. |
||
| 20 | * |
||
| 21 | * @var int |
||
| 22 | */ |
||
| 23 | protected $libxml; |
||
|
|
|||
| 24 | |||
| 25 | /** |
||
| 26 | * Gets the default (preferred) configuration for libxml. |
||
| 27 | */ |
||
| 28 | 1 | public static function getDefaultLibxmlConfig(): int |
|
| 29 | { |
||
| 30 | return \LIBXML_HTML_NOIMPLIED // Required, or things crash. |
||
| 31 | | \LIBXML_BIGLINES |
||
| 32 | | \LIBXML_COMPACT |
||
| 33 | | \LIBXML_HTML_NODEFDTD |
||
| 34 | | \LIBXML_NOBLANKS |
||
| 35 | | \LIBXML_NOENT |
||
| 36 | | \LIBXML_NOXMLDECL |
||
| 37 | | \LIBXML_NSCLEAN |
||
| 38 | 1 | | \LIBXML_PARSEHUGE; |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Sets the libxml value to use for parsing XML. |
||
| 43 | * |
||
| 44 | * @param int $libxml TODO add a description here. |
||
| 45 | */ |
||
| 46 | 1 | public function setLibxml(int $libxml): self |
|
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Gets the libxml value to use for parsing XML. |
||
| 64 | */ |
||
| 65 | 1 | public function getLibxml(): int |
|
| 68 | } |
||
| 69 | } |
||
| 70 |