Code Duplication    Length = 12-14 lines in 2 locations

src/allejo/stakx/Templating/Twig/TwigStakxBridge.php 2 locations

@@ 63-74 (lines=12) @@
60
    /**
61
     * {@inheritdoc}
62
     */
63
    public function getAssortmentDependencies($namespace, $bodyContent)
64
    {
65
        // To see what this regex should match and what shouldn't be see:
66
        //     tests/allejo/stakx/Test/FrontMatter/FrontMatterDocumentTest.php
67
68
        $regex = "/{[{%].*?(?:$namespace)(?:\.|\[['\"])?([^_][^\W]+)?(?:\.|['\"]\])?[^_=]*?[%}]}/";
69
        $results = [];
70
71
        preg_match_all($regex, $bodyContent, $results);
72
73
        return array_unique($results[1]);
74
    }
75
76
    /**
77
     * {@inheritdoc}
@@ 79-92 (lines=14) @@
76
    /**
77
     * {@inheritdoc}
78
     */
79
    public function getTemplateImportDependencies($bodyContent)
80
    {
81
        $regex = "/{%\s?(?:import|from|include)\s?['\"](.+)['\"].+/";
82
        $results = [];
83
84
        preg_match_all($regex, $bodyContent, $results);
85
86
        if (empty($results[1]))
87
        {
88
            return [];
89
        }
90
91
        return array_unique($results[1]);
92
    }
93
94
    /**
95
     * {@inheritdoc}