<?php
declare(strict_types=1);
namespace League\CommonMark\Util;
final class HtmlElement implements \Stringable
{
private string $tagName;
private array $attributes = [];
private $contents;
private bool $selfClosing;
public function __construct(string $tagName, array $attributes = [], $contents = '', bool $selfClosing = false)
{
$this->tagName = $tagName;
$this->selfClosing = $selfClosing;
foreach ($attributes as $name => $value) {
$this->setAttribute($name, $value);