Code Duplication    Length = 13-20 lines in 2 locations

src/Kunstmaan/NodeSearchBundle/Twig/KunstmaanNodeSearchTwigExtension.php 1 location

@@ 72-91 (lines=20) @@
69
     *
70
     * @return string
71
     */
72
    public function renderIndexablePageParts(
73
        \Twig_Environment $env,
74
        array $twigContext,
75
        HasPagePartsInterface $page,
76
        $contextName = 'main',
77
        array $parameters = array()
78
    )
79
    {
80
        $template = $env->loadTemplate('KunstmaanNodeSearchBundle:PagePart:view.html.twig');
81
        $pageparts = $this->indexablePagePartsService->getIndexablePageParts($page, $contextName);
82
        $newTwigContext = array_merge(
83
            $parameters,
84
            array(
85
                'pageparts' => $pageparts
86
            )
87
        );
88
        $newTwigContext = array_merge($newTwigContext, $twigContext);
89
90
        return $template->render($newTwigContext);
91
    }
92
}
93

src/Kunstmaan/PagePartBundle/Twig/Extension/PagePartTwigExtension.php 1 location

@@ 50-62 (lines=13) @@
47
     *
48
     * @return string
49
     */
50
    public function renderPageParts(\Twig_Environment $env, array $twigContext, HasPagePartsInterface $page, $contextName = "main", array $parameters = array())
51
    {
52
        $template = $env->loadTemplate("KunstmaanPagePartBundle:PagePartTwigExtension:widget.html.twig");
53
        /* @var $entityRepository PagePartRefRepository */
54
        $pageparts = $this->getPageParts($page, $contextName);
55
        $newTwigContext = array_merge($parameters, array(
56
            'pageparts' => $pageparts,
57
            'page' => $page
58
        ));
59
        $newTwigContext = array_merge($newTwigContext, $twigContext);
60
61
        return $template->render($newTwigContext);
62
    }
63
64
    /**
65
     * @param HasPagePartsInterface $page    The page