Code Duplication    Length = 14-17 lines in 2 locations

src/allejo/stakx/Compiler.php 2 locations

@@ 147-160 (lines=14) @@
144
     *
145
     * @since 0.1.1
146
     */
147
    private function compileDynamicPageViews(&$pageView)
148
    {
149
        $contentItems = $pageView->getContentItems();
150
        $template = $this->createTwigTemplate($pageView);
151
152
        foreach ($contentItems as $contentItem)
153
        {
154
            $targetFile = $contentItem->getTargetFile();
155
            $output = $this->renderDynamicPageView($template, $pageView, $contentItem);
156
157
            $this->output->notice('Writing file: {file}', array('file' => $targetFile));
158
            $this->folder->writeFile($targetFile, $output);
159
        }
160
    }
161
162
    /**
163
     * Write the compiled output for a repeater PageView.
@@ 169-185 (lines=17) @@
166
     *
167
     * @since 0.1.1
168
     */
169
    private function compileRepeaterPageViews(&$pageView)
170
    {
171
        $pageView->rewindPermalink();
172
173
        $template = $this->createTwigTemplate($pageView);
174
        $permalinks = $pageView->getRepeaterPermalinks();
175
176
        foreach ($permalinks as $permalink)
177
        {
178
            $pageView->bumpPermalink();
179
            $targetFile = $pageView->getTargetFile();
180
            $output = $this->renderRepeaterPageView($template, $pageView, $permalink);
181
182
            $this->output->notice('Writing repeater file: {file}', array('file' => $targetFile));
183
            $this->folder->writeFile($targetFile, $output);
184
        }
185
    }
186
187
    ///
188
    // Redirect handling