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
                $function = new Functions\Widget($this->twig, $this->config, $widgetNameStr, $widgetActionStr, $args);
52
                return $function->run();
53
            },
54
            array('is_safe' => array('html'))
55
        );
56
        $this->twig->addFunction($filter);
57
    }
58
59
    protected function extendForQueryParams() : void
60
    {
61
        $filter = new \Twig_SimpleFunction(
62
            'queryParams',
63
            function ($queryParams, $prefix = '?') {