Code Duplication    Length = 3-7 lines in 2 locations

Routing/Loader/Reader/RestActionReader.php 1 location

@@ 316-322 (lines=7) @@
313
     */
314
    private function includeFormatIfNeeded(&$path, &$requirements)
315
    {
316
        if ($this->includeFormat === true) {
317
            $path .= '.{_format}';
318
319
            if (!isset($requirements['_format']) && !empty($this->formats)) {
320
                $requirements['_format'] = implode('|', array_keys($this->formats));
321
            }
322
        }
323
    }
324
325
    /**

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