Code Duplication    Length = 14-17 lines in 2 locations

src/allejo/stakx/Compiler.php 2 locations

@@ 140-153 (lines=14) @@
137
     * @param DynamicPageView $pageView
138
     * @since 0.1.1
139
     */
140
    private function compileDynamicPageViews (&$pageView)
141
    {
142
        $contentItems = $pageView->getContentItems();
143
        $template = $this->createTwigTemplate($pageView);
144
145
        foreach ($contentItems as $contentItem)
146
        {
147
            $targetFile = $contentItem->getTargetFile();
148
            $output = $this->renderDynamicPageView($template, $pageView, $contentItem);
149
150
            $this->output->notice("Writing file: {file}", array('file' => $targetFile));
151
            $this->folder->writeFile($targetFile, $output);
152
        }
153
    }
154
155
    /**
156
     * Write the compiled output for a repeater PageView
@@ 161-177 (lines=17) @@
158
     * @param RepeaterPageView $pageView
159
     * @since 0.1.1
160
     */
161
    private function compileRepeaterPageViews (&$pageView)
162
    {
163
        $pageView->rewindPermalink();
164
165
        $template = $this->createTwigTemplate($pageView);
166
        $permalinks = $pageView->getRepeaterPermalinks();
167
168
        foreach ($permalinks as $permalink)
169
        {
170
            $pageView->bumpPermalink();
171
            $targetFile = $pageView->getTargetFile();
172
            $output = $this->renderRepeaterPageView($template, $pageView, $permalink);
173
174
            $this->output->notice("Writing repeater file: {file}", array('file' => $targetFile));
175
            $this->folder->writeFile($targetFile, $output);
176
        }
177
    }
178
179
    ///
180
    // Twig Functionality