Code Duplication    Length = 25-33 lines in 65 locations

src/Element/Abbreviation.php 1 location

@@ 15-45 (lines=31) @@
12
 * Class Abbreviation
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr
14
 */
15
final class Abbreviation extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
22
        $this->tag = new Standard('abbr', $attributes, $children);
23
    }
24
25
    public function withAttribute(string $name, string $value = null): Abbreviation
26
    {
27
        if ($value) {
28
            $attribute = new StandardAttribute($name, $value);
29
        } else {
30
            $attribute = new BooleanAttribute($name);
31
        }
32
33
        return new Abbreviation($this->attributes->add($attribute), $this->children);
34
    }
35
36
    public function withChild(ElementInterface $element): Abbreviation
37
    {
38
        return new Abbreviation($this->attributes, $this->children->add($element));
39
    }
40
41
    public function withTitle(string $title): Abbreviation
42
    {
43
        return $this->withAttribute('title', $title);
44
    }
45
}
46

src/Element/Address.php 1 location

@@ 15-40 (lines=26) @@
12
 * Class Address
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/address
14
 */
15
final class Address extends AbstractElement
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
22
        $this->tag = new Standard('address', $attributes, $children);
23
    }
24
25
    public function withAttribute(string $name, string $value = null): Address
26
    {
27
        if ($value) {
28
            $attribute = new StandardAttribute($name, $value);
29
        } else {
30
            $attribute = new BooleanAttribute($name);
31
        }
32
33
        return new Address($this->attributes->add($attribute), $this->children);
34
    }
35
36
    public function withChild(ElementInterface $element): Address
37
    {
38
        return new Address($this->attributes, $this->children->add($element));
39
    }
40
}
41

src/Element/Article.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Article
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article
14
 */
15
final class Article extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('article', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Article
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Article($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Article
36
    {
37
        return new Article($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Aside.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Aside
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/aside
14
 */
15
final class Aside extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('aside', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Aside
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Aside($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Aside
36
    {
37
        return new Aside($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/B.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class B
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b
14
 */
15
final class B extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('b', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): B
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new B($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): B
36
    {
37
        return new B($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/BiDirectionalIsolation.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class BiDirectionalIsolation
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi
14
 */
15
final class BiDirectionalIsolation extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('bdi', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): BiDirectionalIsolation
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new BiDirectionalIsolation($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): BiDirectionalIsolation
36
    {
37
        return new BiDirectionalIsolation($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/BiDirectionalOverride.php 1 location

@@ 15-44 (lines=30) @@
12
 * Class BiDirectionalOverride
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdo
14
 */
15
final class BiDirectionalOverride extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('bdo', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): BiDirectionalOverride
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new BiDirectionalOverride($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): BiDirectionalOverride
36
    {
37
        return new BiDirectionalOverride($this->attributes, $this->children->add($element));
38
    }
39
40
    public function withDir(string $direction = 'auto'): BiDirectionalOverride
41
    {
42
        return $this->withAttribute('dir', $direction);
43
    }
44
}
45

src/Element/BlockQuote.php 1 location

@@ 15-44 (lines=30) @@
12
 * Class BlockQuote
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote
14
 */
15
final class BlockQuote extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('blockquote', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): BlockQuote
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new BlockQuote($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): BlockQuote
36
    {
37
        return new BlockQuote($this->attributes, $this->children->add($element));
38
    }
39
40
    public function withCite(string $url): BlockQuote
41
    {
42
        return $this->withAttribute('cite', $url);
43
    }
44
}
45

src/Element/Body.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Body
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
14
 */
15
final class Body extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('body', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Body
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Body($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Body
36
    {
37
        return new Body($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Caption.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Caption
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption
14
 */
15
final class Caption extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('caption', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Caption
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Caption($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Caption
36
    {
37
        return new Caption($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Cite.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Cite
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/cite
14
 */
15
final class Cite extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('cite', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Cite
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Cite($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Cite
36
    {
37
        return new Cite($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Code.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Code
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code
14
 */
15
final class Code extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('code', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Code
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Code($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Code
36
    {
37
        return new Code($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/ColumnGroup.php 1 location

@@ 15-44 (lines=30) @@
12
 * Class ColumnGroup
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup
14
 */
15
final class ColumnGroup extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('colgroup', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): ColumnGroup
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new ColumnGroup($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): ColumnGroup
36
    {
37
        return new ColumnGroup($this->attributes, $this->children->add($element));
38
    }
39
40
    public function withSpan(int $span = 1): ColumnGroup
41
    {
42
        return $this->withAttribute('span', $span);
43
    }
44
}
45

src/Element/Data.php 1 location

@@ 15-44 (lines=30) @@
12
 * Class Data
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/data
14
 */
15
final class Data extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('data', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Data
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Data($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Data
36
    {
37
        return new Data($this->attributes, $this->children->add($element));
38
    }
39
40
    public function withValue(string $value): Data
41
    {
42
        return $this->withAttribute('value', $value);
43
    }
44
}
45

src/Element/DataList.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class DataList
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist
14
 */
15
final class DataList extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('datalist', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): DataList
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new DataList($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): DataList
36
    {
37
        return new DataList($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Definition.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Definition
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dfn
14
 */
15
final class Definition extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('dfn', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Definition
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Definition($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Definition
36
    {
37
        return new Definition($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Description.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Description
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dd
14
 */
15
final class Description extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('dd', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Description
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Description($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Description
36
    {
37
        return new Description($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/DescriptionList.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class DescriptionList
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl
14
 */
15
final class DescriptionList extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('dl', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): DescriptionList
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new DescriptionList($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): DescriptionList
36
    {
37
        return new DescriptionList($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/DescriptionTerm.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class DescriptionTerm
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt
14
 */
15
final class DescriptionTerm extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('dt', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): DescriptionTerm
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new DescriptionTerm($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): DescriptionTerm
36
    {
37
        return new DescriptionTerm($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Details.php 1 location

@@ 15-44 (lines=30) @@
12
 * Class Details
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
14
 */
15
final class Details extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('details', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Details
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Details($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Details
36
    {
37
        return new Details($this->attributes, $this->children->add($element));
38
    }
39
40
    public function withOpen(string $open = 'false'): Details
41
    {
42
        return $this->withAttribute('open', $open);
43
    }
44
}
45

src/Element/Division.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Division
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div
14
 */
15
final class Division extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('div', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Division
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Division($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Division
36
    {
37
        return new Division($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Emphasis.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Emphasis
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em
14
 */
15
final class Emphasis extends AbstractElement
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('em', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Emphasis
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Emphasis($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Emphasis
36
    {
37
        return new Emphasis($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Figure.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Figure
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure
14
 */
15
final class Figure extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('figure', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Figure
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Figure($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Figure
36
    {
37
        return new Figure($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/FigureCaption.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class FigureCaption
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption
14
 */
15
final class FigureCaption extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('figcaption', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): FigureCaption
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new FigureCaption($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): FigureCaption
36
    {
37
        return new FigureCaption($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Footer.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Footer
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer
14
 */
15
final class Footer extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('footer', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Footer
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Footer($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Footer
36
    {
37
        return new Footer($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Head.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Head
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head
14
 */
15
final class Head extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('head', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Head
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Head($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Head
36
    {
37
        return new Head($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Header.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Header
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header
14
 */
15
final class Header extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('header', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Header
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Header($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Header
36
    {
37
        return new Header($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Html.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Html
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
14
 */
15
final class Html extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('html', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Html
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Html($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Html
36
    {
37
        return new Html($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/I.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class I
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i
14
 */
15
final class I extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('i', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): I
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new I($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): I
36
    {
37
        return new I($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Keyboard.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Keyboard
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd
14
 */
15
final class Keyboard extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('kbd', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Keyboard
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Keyboard($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Keyboard
36
    {
37
        return new Keyboard($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Label.php 1 location

@@ 15-44 (lines=30) @@
12
 * Class Label
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label
14
 */
15
final class Label extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('label', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Label
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Label($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Label
36
    {
37
        return new Label($this->attributes, $this->children->add($element));
38
    }
39
40
    public function withFor(string $id): Label
41
    {
42
        return $this->withAttribute('for', $id);
43
    }
44
}
45

src/Element/Legend.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Legend
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/legend
14
 */
15
final class Legend extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('legend', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Legend
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Legend($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Legend
36
    {
37
        return new Legend($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/ListItem.php 1 location

@@ 15-44 (lines=30) @@
12
 * Class ListItem
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li
14
 */
15
final class ListItem extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('li', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): ListItem
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new ListItem($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): ListItem
36
    {
37
        return new ListItem($this->attributes, $this->children->add($element));
38
    }
39
40
    public function withValue(int $value): ListItem
41
    {
42
        return $this->withAttribute('value', $value);
43
    }
44
}
45

src/Element/Main.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Main
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main
14
 */
15
final class Main extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('main', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Main
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Main($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Main
36
    {
37
        return new Main($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Map.php 1 location

@@ 15-44 (lines=30) @@
12
 * Class Map
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map
14
 */
15
final class Map extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('map', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Map
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Map($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Map
36
    {
37
        return new Map($this->attributes, $this->children->add($element));
38
    }
39
40
    public function withName(string $name): Map
41
    {
42
        return $this->withAttribute('name', $name);
43
    }
44
}
45

src/Element/Mark.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Mark
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark
14
 */
15
final class Mark extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('mark', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Mark
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Mark($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Mark
36
    {
37
        return new Mark($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Nav.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Nav
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav
14
 */
15
final class Nav extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('nav', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Nav
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Nav($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Nav
36
    {
37
        return new Nav($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/NoScript.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class NoScript
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
14
 */
15
final class NoScript extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('noscript', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): NoScript
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new NoScript($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): NoScript
36
    {
37
        return new NoScript($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Paragraph.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Paragraph
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p
14
 */
15
final class Paragraph extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('p', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Paragraph
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Paragraph($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Paragraph
36
    {
37
        return new Paragraph($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Pre.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Pre
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre
14
 */
15
final class Pre extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('pre', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Pre
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Pre($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Pre
36
    {
37
        return new Pre($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Quote.php 1 location

@@ 15-44 (lines=30) @@
12
 * Class Quote
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/q
14
 */
15
final class Quote extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('q', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Quote
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Quote($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Quote
36
    {
37
        return new Quote($this->attributes, $this->children->add($element));
38
    }
39
40
    public function withCite(string $url): Quote
41
    {
42
        return $this->withAttribute('cite', $url);
43
    }
44
}
45

src/Element/Rp.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Rp
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rp
14
 */
15
final class Rp extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('rp', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Rp
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Rp($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Rp
36
    {
37
        return new Rp($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Rt.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Rt
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rt
14
 */
15
final class Rt extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('rt', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Rt
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Rt($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Rt
36
    {
37
        return new Rt($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Ruby.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Ruby
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby
14
 */
15
final class Ruby extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('ruby', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Ruby
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Ruby($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Ruby
36
    {
37
        return new Ruby($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Sample.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Sample
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/samp
14
 */
15
final class Sample extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('samp', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Sample
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Sample($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Sample
36
    {
37
        return new Sample($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Section.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Section
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/section
14
 */
15
final class Section extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('section', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Section
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Section($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Section
36
    {
37
        return new Section($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Shadow.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Shadow
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/shadow
14
 */
15
final class Shadow extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('shadow', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Shadow
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Shadow($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Shadow
36
    {
37
        return new Shadow($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Small.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Small
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/small
14
 */
15
final class Small extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('small', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Small
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Small($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Small
36
    {
37
        return new Small($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Span.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Span
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span
14
 */
15
final class Span extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('span', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Span
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Span($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Span
36
    {
37
        return new Span($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Strike.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Strike
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s
14
 */
15
final class Strike extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('s', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Strike
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Strike($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Strike
36
    {
37
        return new Strike($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Strong.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Strong
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong
14
 */
15
final class Strong extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('strong', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Strong
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Strong($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Strong
36
    {
37
        return new Strong($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Subscript.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Subscript
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub
14
 */
15
final class Subscript extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('sub', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Subscript
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Subscript($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Subscript
36
    {
37
        return new Subscript($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Summary.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Summary
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary
14
 */
15
final class Summary extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('summary', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Summary
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Summary($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Summary
36
    {
37
        return new Summary($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Superscript.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Superscript
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup
14
 */
15
final class Superscript extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('sup', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Superscript
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Superscript($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Superscript
36
    {
37
        return new Superscript($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Table.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Table
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table
14
 */
15
final class Table extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('table', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Table
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Table($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Table
36
    {
37
        return new Table($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/TableBody.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class TableBody
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody
14
 */
15
final class TableBody extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('tbody', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): TableBody
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new TableBody($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): TableBody
36
    {
37
        return new TableBody($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/TableFoot.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class TableFoot
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tfoot
14
 */
15
final class TableFoot extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('tfoot', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): TableFoot
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new TableFoot($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): TableFoot
36
    {
37
        return new TableFoot($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/TableHeader.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class TableHeader
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/thead
14
 */
15
final class TableHeader extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('thead', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): TableHeader
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new TableHeader($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): TableHeader
36
    {
37
        return new TableHeader($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/TableRow.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class TableRow
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr
14
 */
15
final class TableRow extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('tr', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): TableRow
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new TableRow($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): TableRow
36
    {
37
        return new TableRow($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Template.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Template
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template
14
 */
15
final class Template extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('template', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Template
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Template($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Template
36
    {
37
        return new Template($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Time.php 1 location

@@ 15-47 (lines=33) @@
12
 * Class Time
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time
14
 */
15
final class Time extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('time', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Time
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Time($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Time
36
    {
37
        return new Time($this->attributes, $this->children->add($element));
38
    }
39
40
    /**
41
     * @see http://www.w3.org/TR/html-markup/datatypes.html#common.data.datetime
42
     */
43
    public function withDateTime(string $dateTime): Time
44
    {
45
        return $this->withAttribute('datetime', $dateTime);
46
    }
47
}
48

src/Element/Title.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Title
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
14
 */
15
final class Title extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('title', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Title
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Title($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Title
36
    {
37
        return new Title($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Underline.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Underline
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/u
14
 */
15
final class Underline extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('u', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Underline
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Underline($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Underline
36
    {
37
        return new Underline($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/UnorderedList.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class UnorderedList
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul
14
 */
15
final class UnorderedList extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('ul', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): UnorderedList
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new UnorderedList($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): UnorderedList
36
    {
37
        return new UnorderedList($this->attributes, $this->children->add($element));
38
    }
39
}
40

src/Element/Variable.php 1 location

@@ 15-39 (lines=25) @@
12
 * Class Variable
13
 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/var
14
 */
15
final class Variable extends AbstractElement implements ParentElementInterface
16
{
17
    public function __construct(AttributeSet $attributes = null, ElementSet $children = null)
18
    {
19
        $this->attributes = $attributes ?? new AttributeSet();
20
        $this->children = $children ?? new ElementSet();
21
        $this->tag = new Standard('var', $attributes, $children);
22
    }
23
24
    public function withAttribute(string $name, string $value = null): Variable
25
    {
26
        if ($value) {
27
            $attribute = new StandardAttribute($name, $value);
28
        } else {
29
            $attribute = new BooleanAttribute($name);
30
        }
31
32
        return new Variable($this->attributes->add($attribute), $this->children);
33
    }
34
35
    public function withChild(ElementInterface $element): Variable
36
    {
37
        return new Variable($this->attributes, $this->children->add($element));
38
    }
39
}
40