Code Duplication    Length = 8-11 lines in 2 locations

src/Kunstmaan/GeneratorBundle/Generator/KunstmaanGenerator.php 2 locations

@@ 312-319 (lines=8) @@
309
            $name = $file->getRelativePathname();
310
311
            // Check that we are allowed to overwrite the file if it already exists
312
            if (!is_file($targetDir . $name) || $override === true) {
313
                $fileParts = explode('.', $name);
314
                if (end($fileParts) === 'twig') {
315
                    $this->renderTwigFile($name, $targetDir . $name, $parameters, $sourceDir);
316
                } else {
317
                    $this->renderFile($name, $targetDir . $name, $parameters);
318
                }
319
            }
320
        }
321
    }
322
@@ 344-354 (lines=11) @@
341
342
        $this->setSkeletonDirs(array($sourceDir));
343
344
        if (is_file($sourceDir . $filename)) {
345
            // Check that we are allowed the overwrite the file if it already exists
346
            if (!is_file($targetDir . $targetFilename) || $override === true) {
347
                $fileParts = explode('.', $filename);
348
                if (end($fileParts) === 'twig') {
349
                    $this->renderTwigFile($filename, $targetDir . $targetFilename, $parameters, $sourceDir);
350
                } else {
351
                    $this->renderFile($filename, $targetDir . $targetFilename, $parameters);
352
                }
353
            }
354
        }
355
    }
356
357
    /**