Code Duplication    Length = 12-14 lines in 2 locations

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

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