Code Duplication    Length = 7-9 lines in 3 locations

src/Tokens/Elements/A.php 1 location

@@ 41-49 (lines=9) @@
38
        );
39
    }
40
41
    protected function fixSelf(LoggerInterface $logger)
42
    {
43
        // If the "itemprop" attribute is specified on an "a" element, then
44
        // the "href" attribute must also be specified.
45
        if ($this->hasAttribute('itemprop') && !$this->hasAttribute('href')) {
46
            $logger->debug($this . ' with "itemprop" attribute requires the "href" attribute also.  Adding empty "href" attribute.');
47
            $this->addAttribute('href', '');
48
        }
49
    }
50
51
    protected function removeInvalidChildren(LoggerInterface $logger)
52
    {

src/Tokens/Elements/Menu.php 1 location

@@ 34-40 (lines=7) @@
31
        );
32
    }
33
34
    protected function fixSelf(LoggerInterface $logger)
35
    {
36
        if (!$this->hasAttribute('type')) {
37
            $logger->debug('Modifying ' . $this . '. Adding the default "type" attribute for the "menu" element.');
38
            $this->addAttribute('type', 'context');
39
        }
40
    }
41
42
    protected function removeInvalidChildren(LoggerInterface $logger)
43
    {

src/Tokens/Elements/Meta.php 1 location

@@ 28-35 (lines=8) @@
25
        );
26
    }
27
28
    protected function fixSelf(LoggerInterface $logger)
29
    {
30
        // "name" attribute requires "content" attribute.
31
        if ($this->hasAttribute('name') && !$this->hasAttribute('content')) {
32
            $logger->debug('Modifying ' . $this . '. A "meta" element with a "name" attribute requires a "content" attribute.  Adding empty "content" attribute.');
33
            $this->addAttribute('content', '');
34
        }
35
    }
36
37
    protected function removeInvalidSelf(LoggerInterface $logger) : bool
38
    {