| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class HTMLHelper |
||
| 8 | { |
||
| 9 | public static function stripComments(string $html) : string |
||
| 12 | } |
||
| 13 | |||
| 14 | private static $newParaTags = array( |
||
| 15 | 'ul', |
||
| 16 | 'ol', |
||
| 17 | 'iframe', |
||
| 18 | 'table' |
||
| 19 | ); |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Injects the target text at the end of an HTML snippet, |
||
| 23 | * either in an existing <p> tag, or in a new <p> tag if |
||
| 24 | * the last block tag cannot be used (<ul> for example). |
||
| 25 | * |
||
| 26 | * NOTE: Assumes that it is not a whole HTML document. |
||
| 27 | * |
||
| 28 | * @param string $text |
||
| 29 | * @param string $html |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | public static function injectAtEnd(string $text, string $html) : string |
||
| 52 |