Code Duplication    Length = 12-12 lines in 2 locations

src/Tokens/Elements/ClosedElement.php 1 location

@@ 22-33 (lines=12) @@
19
        return true;
20
    }
21
22
    public function toString($prefix = '', $suffix = '')
23
    {
24
        $output = $prefix . '<' . $this->name;
25
        foreach ($this->attributes as $key => $value) {
26
            $output .= ' ' . $key;
27
            if (is_string($value)) {
28
                $output .= '="' . $value . '"';
29
            }
30
        }
31
32
        return $output . '/>' . $suffix;
33
    }
34
}
35

src/Tokens/Elements/OpenElement.php 1 location

@@ 7-18 (lines=12) @@
4
5
class OpenElement extends Element
6
{
7
    public function toString($prefix = '', $suffix = '')
8
    {
9
        $output = $prefix . '<' . $this->name;
10
        foreach ($this->attributes as $key => $value) {
11
            $output .= ' ' . $key;
12
            if (is_string($value)) {
13
                $output .= '="' . $value . '"';
14
            }
15
        }
16
17
        return $output . '>' . $suffix;
18
    }
19
}
20