Code Duplication    Length = 14-17 lines in 2 locations

src/allejo/stakx/Compiler.php 2 locations

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