Code Duplication    Length = 5-5 lines in 2 locations

DependencyInjection/FOSRestExtension.php 2 locations

@@ 300-304 (lines=5) @@
297
        }
298
299
        $formats = [];
300
        foreach ($config['view']['formats'] as $format => $enabled) {
301
            if ($enabled) {
302
                $formats[$format] = false;
303
            }
304
        }
305
        foreach ($config['view']['templating_formats'] as $format => $enabled) {
306
            if ($enabled) {
307
                $formats[$format] = true;
@@ 305-309 (lines=5) @@
302
                $formats[$format] = false;
303
            }
304
        }
305
        foreach ($config['view']['templating_formats'] as $format => $enabled) {
306
            if ($enabled) {
307
                $formats[$format] = true;
308
            }
309
        }
310
311
        $container->getDefinition('fos_rest.routing.loader.yaml_collection')->replaceArgument(3, $formats);
312
        $container->getDefinition('fos_rest.routing.loader.xml_collection')->replaceArgument(3, $formats);