Code Duplication    Length = 16-23 lines in 7 locations

src/Tokens/Elements/Del.php 1 location

@@ 17-36 (lines=20) @@
14
 *
15
 * https://html.spec.whatwg.org/multipage/semantics.html#the-del-element
16
 */
17
class Del extends OpenElement implements FlowContent, PhrasingContent, InlineElement, TransparentElement
18
{
19
    protected function getAllowedAttributes()
20
    {
21
        $delAllowedAttributes = array(
22
            '/^cite$/i' => Attribute::URI,
23
            '/^datetime$/i' => Attribute::CS_STRING
24
       );
25
26
        return array_merge(
27
            $delAllowedAttributes,
28
            parent::getAllowedAttributes()
29
        );
30
    }
31
32
    public function isTransparentElement() : bool
33
    {
34
        return true;
35
    }
36
}
37

src/Tokens/Elements/Ins.php 1 location

@@ 17-36 (lines=20) @@
14
 *
15
 * https://html.spec.whatwg.org/multipage/semantics.html#the-ins-element
16
 */
17
class Ins extends OpenElement implements FlowContent, PhrasingContent, InlineElement, TransparentElement
18
{
19
    protected function getAllowedAttributes()
20
    {
21
        $insAllowedAttributes = array(
22
            '/^cite$/i' => Attribute::URI,
23
            '/^datetime$/i' => Attribute::CS_STRING
24
       );
25
26
        return array_merge(
27
            $insAllowedAttributes,
28
            parent::getAllowedAttributes()
29
        );
30
    }
31
32
    public function isTransparentElement() : bool
33
    {
34
        return true;
35
    }
36
}
37

src/Tokens/Elements/Map.php 1 location

@@ 16-34 (lines=19) @@
13
 *
14
 * https://html.spec.whatwg.org/multipage/semantics.html#the-map-element
15
 */
16
class Map extends OpenElement implements FlowContent, PhrasingContent, TransparentElement
17
{
18
    protected function getAllowedAttributes()
19
    {
20
        $mapAllowedAttributes = array(
21
            '/^name$/i' => Attribute::CS_STRING
22
        );
23
24
        return array_merge(
25
            $mapAllowedAttributes,
26
            parent::getAllowedAttributes()
27
        );
28
    }
29
30
    public function isTransparentElement() : bool
31
    {
32
        return true;
33
    }
34
}
35

src/Tokens/Elements/Details.php 1 location

@@ 16-34 (lines=19) @@
13
 *
14
 * https://html.spec.whatwg.org/multipage/forms.html#the-details-element
15
 */
16
class Details extends OpenElement implements FlowContent, SectioningRoot, InteractiveContent
17
{
18
    protected function getAllowedAttributes()
19
    {
20
        $detailsAllowedAttributes = array(
21
            '/^open$/i' => Attribute::BOOL
22
        );
23
24
        return array_merge(
25
            $detailsAllowedAttributes,
26
            parent::getAllowedAttributes()
27
        );
28
    }
29
30
    public function isInteractiveContent() : bool
31
    {
32
        return true;
33
    }
34
}
35

src/Tokens/Elements/Output.php 1 location

@@ 15-30 (lines=16) @@
12
 *
13
 * https://html.spec.whatwg.org/multipage/forms.html#the-output-element
14
 */
15
class Output extends OpenElement implements FlowContent, PhrasingContent
16
{
17
    protected function getAllowedAttributes()
18
    {
19
        $outputAllowedAttributes = array(
20
            '/^for$/i' => Attribute::CS_STRING,
21
            '/^form$/i' => Attribute::CS_STRING,
22
            '/^name$/i' => Attribute::CS_STRING
23
        );
24
25
        return array_merge(
26
            $outputAllowedAttributes,
27
            parent::getAllowedAttributes()
28
        );
29
    }
30
}
31

src/Tokens/Elements/Slot.php 1 location

@@ 18-36 (lines=19) @@
15
 *
16
 * @todo Implement checks.
17
 */
18
class Slot extends OpenElement implements FlowContent, PhrasingContent, TransparentElement
19
{
20
    protected function getAllowedAttributes()
21
    {
22
        $slotAllowedAttributes = array(
23
            '/^name$/i' => Attribute::CS_STRING
24
        );
25
26
        return array_merge(
27
            $slotAllowedAttributes,
28
            parent::getAllowedAttributes()
29
        );
30
    }
31
32
    public function isTransparentElement() : bool
33
    {
34
        return true;
35
    }
36
}
37

src/Tokens/Elements/Fieldset.php 1 location

@@ 16-38 (lines=23) @@
13
 *
14
 * https://html.spec.whatwg.org/multipage/forms.html#the-fieldset-element
15
 */
16
class Fieldset extends OpenElement implements FlowContent, SectioningRoot
17
{
18
    protected function getAllowedAttributes()
19
    {
20
        $fieldsetAllowedAttributes = array(
21
            '/^disabled$/i' => Attribute::BOOL,
22
            '/^form$/i' => Attribute::CS_STRING,
23
            '/^name$/i' => Attribute::CS_STRING
24
        );
25
26
        return array_merge(
27
            $fieldsetAllowedAttributes,
28
            parent::getAllowedAttributes()
29
        );
30
    }
31
32
    protected function fixSelf(LoggerInterface $logger)
33
    {
34
        // If "legend" element is present, then it must be the first
35
        // child of "fieldset" element.
36
        /// @todo
37
    }
38
}
39