| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | abstract class BaseTag extends Model implements TagInterface |
||
| 23 | { |
||
| 24 | use TagTrait; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Attributes that are allowed to be an empty string |
||
| 28 | */ |
||
| 29 | protected const ALLOWED_EMPTY_ATTRS = ['alt']; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @return string |
||
| 33 | */ |
||
| 34 | public function __toString(): string |
||
| 35 | { |
||
| 36 | return $this->render(); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Render the tag |
||
| 41 | * |
||
| 42 | * @return Markup |
||
| 43 | */ |
||
| 44 | public function render(): Markup |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Filter out attributes with empty values in them, so they don't get rendered |
||
| 51 | * |
||
| 52 | * @param array $attrs |
||
| 53 | * @return array |
||
| 54 | */ |
||
| 55 | public function filterEmptyAttributes(array $attrs): array |
||
| 61 |