Code Duplication    Length = 14-17 lines in 2 locations

src/allejo/stakx/Compiler.php 2 locations

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