Code Duplication    Length = 7-7 lines in 2 locations

Routing/Loader/RestYamlCollectionLoader.php 1 location

@@ 98-104 (lines=7) @@
95
                $currentDir = dirname($path);
96
97
                $parents = [];
98
                if (!empty($parent)) {
99
                    if (!isset($this->collectionParents[$parent])) {
100
                        throw new \InvalidArgumentException(sprintf('Cannot find parent resource with name %s', $parent));
101
                    }
102
103
                    $parents = $this->collectionParents[$parent];
104
                }
105
106
                $imported = $this->processor->importResource($this, $resource, $parents, $prefix, $namePrefix, $type, $currentDir);
107

Routing/Loader/RestXmlCollectionLoader.php 1 location

@@ 78-84 (lines=7) @@
75
                $currentDir = dirname($path);
76
77
                $parents = [];
78
                if (!empty($parent)) {
79
                    if (!isset($this->collectionParents[$parent])) {
80
                        throw new \InvalidArgumentException(sprintf('Cannot find parent resource with name %s', $parent));
81
                    }
82
83
                    $parents = $this->collectionParents[$parent];
84
                }
85
86
                $imported = $this->processor->importResource($this, $resource, $parents, $prefix, $namePrefix, $type, $currentDir);
87