Code Duplication    Length = 3-7 lines in 2 locations

Routing/Loader/RestYamlCollectionLoader.php 1 location

@@ 124-126 (lines=3) @@
121
                    }
122
123
                    // set format requirement if configured globally
124
                    if (!isset($config['requirements']['_format']) && !empty($this->formats)) {
125
                        $config['requirements']['_format'] = implode('|', array_keys($this->formats));
126
                    }
127
                }
128
129
                // set the default format if configured

Routing/Loader/Reader/RestActionReader.php 1 location

@@ 379-385 (lines=7) @@
376
     */
377
    private function includeFormatIfNeeded(&$path, &$requirements)
378
    {
379
        if ($this->includeFormat === true) {
380
            $path .= '.{_format}';
381
382
            if (!isset($requirements['_format']) && !empty($this->formats)) {
383
                $requirements['_format'] = implode('|', array_keys($this->formats));
384
            }
385
        }
386
    }
387
388
    /**