Code Duplication    Length = 14-14 lines in 2 locations

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

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