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

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