Code Duplication    Length = 5-5 lines in 3 locations

src/Kunstmaan/GeneratorBundle/Generator/PagePartGenerator.php 1 location

@@ 148-152 (lines=5) @@
145
    private function generateSectionConfig()
146
    {
147
        if (count($this->sections) > 0) {
148
            if ($this->isSymfony4()) {
149
                $dir = $this->container->getParameter('kernel.project_dir') . '/config/kunstmaancms/pageparts/';
150
            } else {
151
                $dir = $this->bundle->getPath().'/Resources/config/pageparts/';
152
            }
153
154
            foreach ($this->sections as $section) {
155
                $data = Yaml::parse(file_get_contents($dir . $section));

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

@@ 231-235 (lines=5) @@
228
    protected function installDefaultPageTemplates($bundle)
229
    {
230
        // Configuration templates
231
        if ($this->isSymfony4()) {
232
            $dirPath = $this->container->getParameter('kernel.project_dir') . '/config/kunstmaancms/pagetemplates/';
233
        } else {
234
            $dirPath = sprintf('%s/Resources/config/pagetemplates/', $bundle->getPath());
235
        }
236
237
        $skeletonDir = sprintf('%s/Resources/config/pagetemplates/', GeneratorUtils::getFullSkeletonPath('/common'));
238
@@ 294-298 (lines=5) @@
291
    protected function installDefaultPagePartConfiguration($bundle)
292
    {
293
        // Pagepart configuration
294
        if ($this->isSymfony4()) {
295
            $dirPath = $this->container->getParameter('kernel.project_dir') . '/config/kunstmaancms/pageparts/';
296
        } else {
297
            $dirPath = sprintf('%s/Resources/config/pageparts/', $bundle->getPath());
298
        }
299
300
        $skeletonDir = sprintf('%s/Resources/config/pageparts/', GeneratorUtils::getFullSkeletonPath('/common'));
301