Code Duplication    Length = 17-18 lines in 2 locations

src/Tokens/Elements/A.php 1 location

@@ 22-39 (lines=18) @@
19
 */
20
class A extends OpenElement implements FlowContent, InteractiveContent, PhrasingContent, InlineElement
21
{
22
    protected function getAllowedAttributes()
23
    {
24
        $aAllowedAttributes = array(
25
            '/^href$/i' => Element::ATTR_URI,
26
            '/^target$/i' => Element::ATTR_CS_STRING,
27
            '/^download$/i' => Element::ATTR_CS_STRING,
28
            '/^ping$/i' => Element::ATTR_URI,
29
            '/^rel$/i' => Element::ATTR_CS_STRING,
30
            '/^hreflang$/i' => Element::ATTR_CS_STRING,
31
            '/^type$/i' => Element::ATTR_CS_STRING,
32
            '/^referrerpolicy$/i' => Element::ATTR_CS_STRING
33
        );
34
35
        return array_merge(
36
            $aAllowedAttributes,
37
            parent::getAllowedAttributes()
38
        );
39
    }
40
41
    protected function doClean(LoggerInterface $logger)
42
    {

src/Tokens/Elements/Link.php 1 location

@@ 13-29 (lines=17) @@
10
11
class Link extends ClosedElement implements MetadataContent
12
{
13
    protected function getAllowedAttributes()
14
    {
15
        $linkAllowedAttributes = array(
16
            '/^href$/i' => Element::ATTR_URI,
17
            '/^crossorigin$/i' => Element::ATTR_CS_STRING,
18
            '/^rel$/i' => Element::ATTR_CI_SSENUM . '("alternate","author","help","icon","license","next","pingback","prefetch","prev","search","stylesheet")',
19
            '/^media$/i' => Element::ATTR_CI_STRING,
20
            '/^hreflang$/i' => Element::ATTR_CS_STRING,
21
            '/^type$/i' => Element::ATTR_CI_STRING,
22
            '/^sizes$/i' => Element::ATTR_CI_STRING
23
        );
24
25
        return array_merge(
26
            $linkAllowedAttributes,
27
            parent::getAllowedAttributes()
28
        );
29
    }
30
31
    protected function doClean(LoggerInterface $logger)
32
    {