Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 446-452 (lines=7) @@
443
            $partialFunctions .= $this->render('/PagePartialFunctions.php.twig', $twigParameters);
444
        }
445
446
        if ($parameters['uses_category']) {
447
            $twigParameters['type'] = 'Category';
448
            $twigParameters['pluralType'] = 'categories';
449
            $partial .= $this->render('/PagePartial.php.twig', $twigParameters);
450
            $partialFunctions .= $this->render('/PagePartialFunctions.php.twig', $twigParameters);
451
            $constructor .= '$this->categories = new ArrayCollection();' . "\n";
452
        }
453
454
        if ($parameters['uses_tag']) {
455
            $twigParameters['type'] = 'Tag';
@@ 454-460 (lines=7) @@
451
            $constructor .= '$this->categories = new ArrayCollection();' . "\n";
452
        }
453
454
        if ($parameters['uses_tag']) {
455
            $twigParameters['type'] = 'Tag';
456
            $twigParameters['pluralType'] = 'tags';
457
            $partial .= $this->render('/PagePartial.php.twig', $twigParameters);
458
            $partialFunctions .= $this->render('/PagePartialFunctions.php.twig', $twigParameters);
459
            $constructor .= '$this->tags = new ArrayCollection();' . "\n";
460
        }
461
        GeneratorUtils::replace('//%PagePartial.php.twig%', $partial, $dirPath . '/' . $this->entity . 'Page.php');
462
        GeneratorUtils::replace('//%PagePartialFunctions.php.twig%', $partialFunctions, $dirPath . '/' . $this->entity . 'Page.php');
463
        GeneratorUtils::replace('//%constructor%', $constructor, $dirPath . '/' . $this->entity . 'Page.php');