| Total Complexity | 4 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | trait XMLBase64ElementTrait |
||
| 17 | { |
||
| 18 | use XMLStringElementTrait; |
||
| 19 | |||
| 20 | |||
| 21 | /** |
||
| 22 | * Get the content of the element. |
||
| 23 | * |
||
| 24 | * @return string |
||
| 25 | */ |
||
| 26 | public function getContent(): string |
||
| 27 | { |
||
| 28 | return $this->sanitizeContent($this->getRawContent()); |
||
| 29 | } |
||
| 30 | |||
| 31 | |||
| 32 | /** |
||
| 33 | * Get the raw and unsanitized content of the element. |
||
| 34 | * |
||
| 35 | * @return string |
||
| 36 | */ |
||
| 37 | public function getRawContent(): string |
||
| 40 | } |
||
| 41 | |||
| 42 | |||
| 43 | /** |
||
| 44 | * Sanitize the content of the element. |
||
| 45 | * |
||
| 46 | * @param string $content The unsanitized textContent |
||
| 47 | * @throws \Exception on failure |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | protected function sanitizeContent(string $content): string |
||
| 53 | } |
||
| 54 | |||
| 55 | |||
| 56 | /** |
||
| 57 | * Validate the content of the element. |
||
| 58 | * |
||
| 59 | * @param string $content The value to go in the XML textContent |
||
| 60 | * @throws \Exception on failure |
||
| 61 | * @return void |
||
| 62 | */ |
||
| 63 | protected function validateContent(string $content): void |
||
| 67 | } |
||
| 68 | } |
||
| 69 |