<commit_before><?php

namespace RoyallTheFourth\HtmlDocument\Element;

use RoyallTheFourth\HtmlDocument\Attribute\BooleanAttribute;
use RoyallTheFourth\HtmlDocument\Attribute\StandardAttribute;
use RoyallTheFourth\HtmlDocument\Set\AttributeSet;
use RoyallTheFourth\HtmlDocument\Tag\EmptyTag;

/**
 * Class Arbitrary
 * Any type of tag without a matching close tag.
 */
final class ArbitrarySingle extends AbstractElement
{
    private $name;

    public function __construct(string $name, AttributeSet $attributes = null)
    {
        $this->name = $name;
        $this->attributes = $attributes ?? new AttributeSet();
        $this->tag = new EmptyTag($name, $attributes);
    }

    public function withAttribute(string $name, string $value = null): ArbitrarySingle
    {
        if ($value) {
            $attribute = new StandardAttribute($name, $value);
        } else {
            $attribute = new BooleanAttribute($name);
        }

        return new ArbitrarySingle($this->name, $this->attributes->add($attribute));
    }
}<commit_msg>Fix name of ArbitraryEmpty element class<commit_after><?php

namespace RoyallTheFourth\HtmlDocument\Element;

use RoyallTheFourth\HtmlDocument\Attribute\BooleanAttribute;
use RoyallTheFourth\HtmlDocument\Attribute\StandardAttribute;
use RoyallTheFourth\HtmlDocument\Set\AttributeSet;
use RoyallTheFourth\HtmlDocument\Tag\EmptyTag;

/**
 * Class Arbitrary
 * Any type of tag without a matching close tag.
 */
final class ArbitraryEmpty extends AbstractElement
{
    private $name;

    public function __construct(string $name, AttributeSet $attributes = null)
    {
        $this->name = $name;
        $this->attributes = $attributes ?? new AttributeSet();
        $this->tag = new EmptyTag($name, $attributes);
    }

    public function withAttribute(string $name, string $value = null): ArbitraryEmpty
    {
        if ($value) {
            $attribute = new StandardAttribute($name, $value);
        } else {
            $attribute = new BooleanAttribute($name);
        }

        return new ArbitraryEmpty($this->name, $this->attributes->add($attribute));
    }
}
{'fraction_non_alphanumeric': 0.10869565217391304, 'fraction_numerical': 0.0, 'mean_word_length': 3.5625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1759493', 'n_tokens_mistral': 595, 'n_tokens_neox': 558, 'n_words': 141}