Code Duplication    Length = 12-14 lines in 2 locations

src/Transfer/EzPlatform/Repository/Manager/UserGroupManager.php 1 location

@@ 206-217 (lines=12) @@
203
    /**
204
     * {@inheritdoc}
205
     */
206
    public function remove(ObjectInterface $object)
207
    {
208
        if (!$object instanceof UserGroupObject) {
209
            throw new UnsupportedObjectOperationException(UserGroupObject::class, get_class($object));
210
        }
211
212
        $userGroup = $this->find($object, true);
213
214
        $this->userService->deleteUserGroup($userGroup);
215
216
        return true;
217
    }
218
}
219

src/Transfer/EzPlatform/Repository/Manager/UserManager.php 1 location

@@ 181-194 (lines=14) @@
178
    /**
179
     * {@inheritdoc}
180
     */
181
    public function remove(ObjectInterface $object)
182
    {
183
        if (!$object instanceof UserObject) {
184
            throw new UnsupportedObjectOperationException(UserObject::class, get_class($object));
185
        }
186
187
        $user = $this->find($object);
188
189
        if ($user) {
190
            $this->userService->deleteUser($user);
191
        }
192
193
        return true;
194
    }
195
196
    /**
197
     * Assigns a collection of Transfer user groups from an eZ user, and returns the once who were added.