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

@@ 140-149 (lines=10) @@
137
                }
138
                $newParentLocation = $locationService->loadLocation($parentLocationId);
139
                $locationService->moveSubtree($location, $newParentLocation);
140
            } elseif (isset($this->dsl['swap_with_location'])) {
141
                //Swap locations
142
                $swapLocationId = $this->dsl['swap_with_location'];
143
                if ($this->referenceResolver->isReference($swapLocationId)) {
144
                    $swapLocationId = $this->referenceResolver->getReferenceValue($swapLocationId);
145
                }
146
                $locationToSwap = $locationService->loadLocation($swapLocationId);
147
148
                $locationService->swapLocation($location, $locationToSwap);
149
            }
150
151
            $this->setReferences($location);
152
        }