Code Duplication    Length = 10-10 lines in 2 locations

src/Compiler.php 2 locations

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