Code Duplication    Length = 9-10 lines in 2 locations

src/Starkerxp/StructureBundle/Generator/ControllerGenerator.php 1 location

@@ 43-51 (lines=9) @@
40
        $parameters['nomService'] = strtolower(
41
            str_replace(['_Bundle', '@'], '', preg_replace('#\B([A-Z])#', '_\1', $parameters['namespaceBundle']))
42
        );
43
        foreach ($this->getFichiers() as $template) {
44
            try {
45
                $this->kernel->locateResource("@StarkerxpStructureBundle/Resources/views/Gabarit/".$template.".twig");
46
            } catch (\InvalidArgumentException $e) {
47
                throw new \InvalidArgumentException('Il manque un fichier de template');
48
            }
49
            $fichierACreerModifier = $bundle->getPath().str_replace("_nomController_", $libelle, $template);
50
            $this->traiterLeFichier($template, $fichierACreerModifier, $parameters);
51
        }
52
    }
53
54
    public function getFichiers()

src/Starkerxp/StructureBundle/Generator/EntiteGenerator.php 1 location

@@ 22-31 (lines=10) @@
19
        ];
20
        $parameters['nomService'] = strtolower(str_replace(['_Bundle', '@'], '', preg_replace('#\B([A-Z])#', '_\1', $parameters['namespaceBundle'])));
21
22
        foreach ($this->getFichiers() as $template) {
23
            try {
24
                $this->kernel->locateResource("@StarkerxpStructureBundle/Resources/views/Gabarit/".$template.".twig");
25
            } catch (\InvalidArgumentException $e) {
26
                throw new \InvalidArgumentException('Il manque un fichier de template');
27
            }
28
            // On génère le nom de fichier qui va être modifié ou généré.
29
            $fichierACreerModifier = $bundle->getPath().str_replace("_nomEntity_", $libelle, $template);
30
            $this->traiterLeFichier($template, $fichierACreerModifier, $parameters);
31
        }
32
    }
33
34
    public function getFichiers()