Code Duplication    Length = 7-7 lines in 2 locations

Routing/Loader/RestXmlCollectionLoader.php 1 location

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

Routing/Loader/RestYamlCollectionLoader.php 1 location

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