Code Duplication    Length = 10-11 lines in 2 locations

Core/Executor/UserGroupManager.php 1 location

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

Core/Executor/LocationManager.php 1 location

@@ 156-165 (lines=10) @@
153
                }
154
                $newParentLocation = $locationService->loadLocation($parentLocationId);
155
                $locationService->moveSubtree($location, $newParentLocation);
156
            } elseif (isset($this->dsl['swap_with_location'])) {
157
                //Swap locations
158
                $swapLocationId = $this->dsl['swap_with_location'];
159
                if ($this->referenceResolver->isReference($swapLocationId)) {
160
                    $swapLocationId = $this->referenceResolver->getReferenceValue($swapLocationId);
161
                }
162
                $locationToSwap = $locationService->loadLocation($swapLocationId);
163
164
                $locationService->swapLocation($location, $locationToSwap);
165
            }
166
167
            $locationCollection[$key] = $location;
168
        }