Code Duplication    Length = 10-11 lines in 2 locations

Core/Executor/UserGroupManager.php 1 location

@@ 97-107 (lines=11) @@
94
95
        $userService->updateUserGroup($userGroup, $updateStruct);
96
97
        if (array_key_exists('parent_group_id', $this->dsl)) {
98
            $parentGroupId = $this->dsl['parent_group_id'];
99
            if ($this->referenceResolver->isReference($parentGroupId)) {
100
                $parentGroupId = $this->referenceResolver->getReferenceValue($parentGroupId);
101
            }
102
103
            $newParentGroup = $userService->loadUserGroup($parentGroupId);
104
105
            // Move group to new parent
106
            $userService->moveUserGroup($userGroup, $newParentGroup);
107
        }
108
109
        $this->setReferences($userGroup);
110
    }

Core/Executor/LocationManager.php 1 location

@@ 173-182 (lines=10) @@
170
            }
171
            $newParentLocation = $locationService->loadLocation($parentLocationId);
172
            $locationService->moveSubtree($location, $newParentLocation);
173
        } elseif (isset($this->dsl['swap_with_location'])) {
174
            //Swap locations
175
            $swapLocationId = $this->dsl['swap_with_location'];
176
            if ($this->referenceResolver->isReference($swapLocationId)) {
177
                $swapLocationId = $this->referenceResolver->getReferenceValue($swapLocationId);
178
            }
179
            $locationToSwap = $locationService->loadLocation($swapLocationId);
180
181
            $locationService->swapLocation($location, $locationToSwap);
182
        }
183
184
        $this->setReferences($location);
185
    }