Code Duplication    Length = 25-25 lines in 2 locations

src/Tokens/Elements/Body.php 1 location

@@ 17-41 (lines=25) @@
14
 */
15
class Body extends OpenElement implements SectioningRoot
16
{
17
    protected function getAllowedAttributes()
18
    {
19
        $bodyAllowedAttributes = array(
20
            '/^onafterprint$/i' => Attribute::JS,
21
            '/^onbeforeprint$/i' => Attribute::JS,
22
            '/^onbeforeunload$/i' => Attribute::JS,
23
            '/^onhashchange$/i' => Attribute::JS,
24
            '/^onlanguagechange$/i' => Attribute::JS,
25
            '/^onmessage$/i' => Attribute::JS,
26
            '/^onoffline$/i' => Attribute::JS,
27
            '/^ononline$/i' => Attribute::JS,
28
            '/^onpagehide$/i' => Attribute::JS,
29
            '/^onpageshow$/i' => Attribute::JS,
30
            '/^onpopstate$/i' => Attribute::JS,
31
            '/^onrejectionhandled$/i' => Attribute::JS,
32
            '/^onstorage$/i' => Attribute::JS,
33
            '/^onunhandledrejection$/i' => Attribute::JS,
34
            '/^onunload$/i' => Attribute::JS
35
        );
36
37
        return array_merge(
38
            $bodyAllowedAttributes,
39
            parent::getAllowedAttributes()
40
        );
41
    }
42
43
    protected function removeInvalidSelf(LoggerInterface $logger) : bool
44
    {

src/Tokens/Elements/Textarea.php 1 location

@@ 21-45 (lines=25) @@
18
 */
19
class Textarea extends OpenElement implements FlowContent, InteractiveContent, PhrasingContent
20
{
21
    protected function getAllowedAttributes()
22
    {
23
        $textareaAllowedAttributes = array(
24
            '/^autocomplete$/i' => Attribute::CS_STRING,
25
            '/^autofocus$/i' => Attribute::BOOL,
26
            '/^cols$/i' => Attribute::INT,
27
            '/^dirname$/i' => Attribute::CS_STRING,
28
            '/^disabled$/i' => Attribute::BOOL,
29
            '/^form$/i' => Attribute::CS_STRING,
30
            '/^inputmode$/i' => Attribute::CS_STRING,
31
            '/^maxlength$/i' => Attribute::CS_STRING,
32
            '/^minlength$/i' => Attribute::CS_STRING,
33
            '/^name$/i' => Attribute::CS_STRING,
34
            '/^placeholder$/i' => Attribute::CS_STRING,
35
            '/^readonly$/i' => Attribute::BOOL,
36
            '/^required$/i' => Attribute::BOOL,
37
            '/^rows$/i' => Attribute::INT,
38
            '/^wrap$/i' => Attribute::CI_ENUM . '("","soft","hard"|"soft")'
39
        );
40
41
        return array_merge(
42
            $textareaAllowedAttributes,
43
            parent::getAllowedAttributes()
44
        );
45
    }
46
47
    protected function removeInvalidChildren(LoggerInterface $logger)
48
    {