Code Duplication    Length = 3-7 lines in 2 locations

Routing/Loader/RestYamlCollectionLoader.php 1 location

@@ 138-140 (lines=3) @@
135
                    }
136
137
                    // set format requirement if configured globally
138
                    if (!isset($config['requirements']['_format']) && !empty($this->formats)) {
139
                        $config['requirements']['_format'] = implode('|', array_keys($this->formats));
140
                    }
141
                }
142
143
                // set the default format if configured

Routing/Loader/Reader/RestActionReader.php 1 location

@@ 442-448 (lines=7) @@
439
     */
440
    private function includeFormatIfNeeded(&$path, &$requirements)
441
    {
442
        if (true === $this->includeFormat) {
443
            $path .= '.{_format}';
444
445
            if (!isset($requirements['_format']) && !empty($this->formats)) {
446
                $requirements['_format'] = implode('|', array_keys($this->formats));
447
            }
448
        }
449
    }
450
451
    /**