Code Duplication    Length = 14-14 lines in 2 locations

eZ/Publish/Core/SignalSlot/UserService.php 2 locations

@@ 423-436 (lines=14) @@
420
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to assign the user group to the user
421
     * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if the user is already in the given user group
422
     */
423
    public function assignUserToUserGroup(User $user, UserGroup $userGroup)
424
    {
425
        $returnValue = $this->service->assignUserToUserGroup($user, $userGroup);
426
        $this->signalDispatcher->emit(
427
            new AssignUserToUserGroupSignal(
428
                array(
429
                    'userId' => $user->id,
430
                    'userGroupId' => $userGroup->id,
431
                )
432
            )
433
        );
434
435
        return $returnValue;
436
    }
437
438
    /**
439
     * Removes a user group from the user.
@@ 447-460 (lines=14) @@
444
     * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to remove the user group from the user
445
     * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if the user is not in the given user group
446
     */
447
    public function unAssignUserFromUserGroup(User $user, UserGroup $userGroup)
448
    {
449
        $returnValue = $this->service->unAssignUserFromUserGroup($user, $userGroup);
450
        $this->signalDispatcher->emit(
451
            new UnAssignUserFromUserGroupSignal(
452
                array(
453
                    'userId' => $user->id,
454
                    'userGroupId' => $userGroup->id,
455
                )
456
            )
457
        );
458
459
        return $returnValue;
460
    }
461
462
    /**
463
     * Loads the user groups the user belongs to.