Code Duplication    Length = 15-15 lines in 2 locations

src/Twig/TwigExtensions.php 2 locations

@@ 30-44 (lines=15) @@
27
        $this->loadFunctions();
28
    }
29
30
    protected function extendForGetUrl() : void
31
    {
32
        $filter = new Twig_SimpleFunction(
33
            'getUrl',
34
            function (
35
                $alias,
36
                $params = []
37
            ) {
38
                $function = new Functions\GetUrl($this->config['base_url'], $this->config['aliases'], $alias, $params);
39
                return $function->run();
40
            },
41
            array('is_safe' => array('html'))
42
        );
43
        $this->twig->addFunction($filter);
44
    }
45
46
    protected function extendForWidget() : void
47
    {
@@ 46-60 (lines=15) @@
43
        $this->twig->addFunction($filter);
44
    }
45
46
    protected function extendForWidget() : void
47
    {
48
        $filter = new \Twig_SimpleFunction(
49
            'Widget_*_*',
50
            function ($widgetNameStr, $widgetActionStr, $args = []) {
51
52
53
                $function = new Functions\Widget($this->twig, $this->config, $widgetNameStr, $widgetActionStr, $args);
54
                return $function->run();
55
56
            },
57
            array('is_safe' => array('html'))
58
        );
59
        $this->twig->addFunction($filter);
60
    }
61
62
    protected function extendForQueryParams() : void
63
    {