Code Duplication    Length = 20-22 lines in 3 locations

src/Tokens/Elements/Video.php 1 location

@@ 24-44 (lines=21) @@
21
 */
22
class Video extends OpenElement implements FlowContent, PhrasingContent, EmbeddedContent, InteractiveContent, TransparentElement, MediaElement
23
{
24
    protected function getAllowedAttributes()
25
    {
26
        $videoAllowedAttributes = array(
27
            '/^src$/i' => Attribute::URI,
28
            '/^crossorigin$/i' => Attribute::CS_STRING,
29
            '/^poster$/i' => Attribute::URI,
30
            '/^preload$/i' => Attribute::CI_ENUM . '("","none","metadata","auto"|"")',
31
            '/^autoplay$/i' => Attribute::BOOL,
32
            '/^mediagroup$/i' => Attribute::CS_STRING,
33
            '/^loop$/i' => Attribute::BOOL,
34
            '/^muted$/i' => Attribute::BOOL,
35
            '/^controls$/i' => Attribute::BOOL,
36
            '/^width$/i' => Attribute::INT,
37
            '/^height$/i' => Attribute::INT
38
        );
39
40
        return array_merge(
41
            $videoAllowedAttributes,
42
            parent::getAllowedAttributes()
43
        );
44
    }
45
46
    protected function removeInvalidChildren(LoggerInterface $logger)
47
    {

src/Tokens/Elements/Button.php 1 location

@@ 19-40 (lines=22) @@
16
 */
17
class Button extends OpenElement implements FlowContent, InteractiveContent, PhrasingContent
18
{
19
    protected function getAllowedAttributes()
20
    {
21
        $buttonAllowedAttributes = array(
22
            '/^autofocus$/i' => Attribute::BOOL,
23
            '/^disabled$/i' => Attribute::BOOL,
24
            '/^form$/i' => Attribute::CS_STRING,
25
            '/^formaction$/i' => Attribute::URI,
26
            '/^formenctype$/i' => Attribute::CS_STRING,
27
            '/^formmethod$/i' => Attribute::CI_ENUM . '("","get","post","dialog"|"get")',
28
            '/^formnovalidate$/i' => Attribute::BOOL,
29
            '/^formtarget$/i' => Attribute::CS_STRING,
30
            '/^menu$/i' => Attribute::CS_STRING,
31
            '/^name$/i' => Attribute::CS_STRING,
32
            '/^type$/i' => Attribute::CI_ENUM . '("submit","reset","button","menu"|"submit")',
33
            '/^value$/i' => Attribute::CS_STRING
34
        );
35
36
        return array_merge(
37
            $buttonAllowedAttributes,
38
            parent::getAllowedAttributes()
39
        );
40
    }
41
42
    protected function removeInvalidChildren(LoggerInterface $logger)
43
    {

src/Tokens/Elements/Img.php 1 location

@@ 17-36 (lines=20) @@
14
 */
15
class Img extends ClosedElement
16
{
17
    protected function getAllowedAttributes()
18
    {
19
        $imgAllowedAttributes = array(
20
            '/^alt$/i' => Attribute::CS_STRING,
21
            '/^src$/i' => Attribute::URI,
22
            '/^srcset$/i' => Attribute::CS_STRING,
23
            '/^sizes$/i' => Attribute::CS_STRING,
24
            '/^crossorigin$/i' => Attribute::CS_STRING,
25
            '/^usemap$/i' => Attribute::CS_STRING,
26
            '/^ismap$/i' => Attribute::CS_STRING,
27
            '/^width$/i' => Attribute::INT,
28
            '/^height$/i' => Attribute::INT,
29
            '/^referrerpolicy$/i' => Attribute::CS_STRING
30
        );
31
32
        return array_merge(
33
            $imgAllowedAttributes,
34
            parent::getAllowedAttributes()
35
        );
36
    }
37
}
38