Element.php 452 B

123456789101112131415161718192021
  1. <?php
  2. namespace App\Services\Markup\Ir;
  3. use App\Services\Markup\Html\HtmlPolicy;
  4. /**
  5. * 普通 HTML 元素。tag 与属性都已经过 {@see HtmlPolicy} 白名单。
  6. */
  7. final class Element implements Node
  8. {
  9. /**
  10. * @param array<string, string> $attrs
  11. * @param list<Node> $children
  12. */
  13. public function __construct(
  14. public string $tag,
  15. public array $attrs = [],
  16. public array $children = [],
  17. ) {}
  18. }