Code Duplication    Length = 10-10 lines in 2 locations

src/Compiler.php 2 locations

@@ 40-49 (lines=10) @@
37
        return $viewContents;
38
    }
39
40
    protected function parseSelfClosingTags(string $viewContents, Component $component): string
41
    {
42
        $pattern = "/<\s*{$component->getTag()}\s*(?<attributes>(?:\s+[\w\-:]+(=(?:\\\"[^\\\"]+\\\"|\'[^\']+\'|[^\'\\\"=<>]+))?)*\s*)\/>/";
43
44
        return preg_replace_callback($pattern, function (array $matches) use ($component) {
45
            $attributes = $this->getAttributesFromAttributeString($matches['attributes']);
46
47
            return $this->componentString($component, $attributes);
48
        }, $viewContents);
49
    }
50
51
    protected function parseOpeningTags(string $viewContents, Component $component): string
52
    {
@@ 51-60 (lines=10) @@
48
        }, $viewContents);
49
    }
50
51
    protected function parseOpeningTags(string $viewContents, Component $component): string
52
    {
53
        $pattern = "/<\s*{$component->getTag()}(?<attributes>(?:\s+[\w\-:]+(=(?:\\\"[^\\\"]*\\\"|\'[^\']*\'|[^\'\\\"=<>]+))?)*\s*)(?<![\/=\-])>/";
54
55
        return preg_replace_callback($pattern, function (array $matches) use ($component) {
56
            $attributes = $this->getAttributesFromAttributeString($matches['attributes']);
57
58
            return $this->componentStartString($component, $attributes);
59
        }, $viewContents);
60
    }
61
62
    protected function parseClosingTags(string $viewContents, Component $component): string
63
    {