Code Duplication    Length = 8-11 lines in 2 locations

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

@@ 339-346 (lines=8) @@
336
            $name = $file->getRelativePathname();
337
338
            // Check that we are allowed to overwrite the file if it already exists
339
            if (!is_file($targetDir . $name) || $override === true) {
340
                $fileParts = explode('.', $name);
341
                if (end($fileParts) === 'twig') {
342
                    $this->renderTwigFile($name, $targetDir . $name, $parameters, $sourceDir);
343
                } else {
344
                    $this->renderFile($name, $targetDir . $name, $parameters);
345
                }
346
            }
347
        }
348
    }
349
@@ 371-381 (lines=11) @@
368
369
        $this->setSkeletonDirs(array($sourceDir));
370
371
        if (is_file($sourceDir . $filename)) {
372
            // Check that we are allowed the overwrite the file if it already exists
373
            if (!is_file($targetDir . $targetFilename) || $override === true) {
374
                $fileParts = explode('.', $filename);
375
                if (end($fileParts) === 'twig') {
376
                    $this->renderTwigFile($filename, $targetDir . $targetFilename, $parameters, $sourceDir);
377
                } else {
378
                    $this->renderFile($filename, $targetDir . $targetFilename, $parameters);
379
                }
380
            }
381
        }
382
    }
383
384
    /**