Code Duplication    Length = 3-4 lines in 2 locations

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

@@ 153-155 (lines=3) @@
150
            $dir = $this->isSymfony4() ? $this->container->getParameter('kernel.project_dir') . '/config/kunstmaancms/pageparts/' : $this->bundle->getPath() . '/Resources/config/pageparts/';
151
            foreach ($this->sections as $section) {
152
                $data = $originalData = Yaml::parse(file_get_contents($dir . $section));
153
                if (array_key_exists('kunstmaan_page_part', $data)) {
154
                    $data['types'] = $originalData['kunstmaan_page_part']['pageparts'][substr($section, 0, -4)]['types'];
155
                }
156
157
                if (!array_key_exists('types', $data)) {
158
                    $data['types'] = array();
@@ 175-178 (lines=4) @@
172
                    );
173
                }
174
175
                if (array_key_exists('kunstmaan_page_part', $originalData)) {
176
                    $originalData['kunstmaan_page_part']['pageparts'][substr($section, 0, -4)]['types'] = $data['types'];
177
                    $data = $originalData;
178
                }
179
180
                //Sf4 structure of the config file is nested deeper, increase the level when values are inlined
181
                $ymlData = Yaml::dump($data, $this->isSymfony4() ? 5 : 2);