Code Duplication    Length = 12-14 lines in 2 locations

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

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