Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 645-654 (lines=10) @@
642
     *
643
     * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException if a user with the given credentials was not found
644
     */
645
    public function loadUserByLogin($login, array $prioritizedLanguages = [])
646
    {
647
        if (!is_string($login) || empty($login)) {
648
            throw new InvalidArgumentValue('login', $login);
649
        }
650
651
        $spiUser = $this->userHandler->loadByLogin($login);
652
653
        return $this->buildDomainUserObject($spiUser, null, $prioritizedLanguages);
654
    }
655
656
    /**
657
     * Loads a user for the given email.
@@ 693-702 (lines=10) @@
690
     * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException
691
     * @throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentValue
692
     */
693
    public function loadUserByToken($hash, array $prioritizedLanguages = [])
694
    {
695
        if (!is_string($hash) || empty($hash)) {
696
            throw new InvalidArgumentValue('hash', $hash);
697
        }
698
699
        $spiUser = $this->userHandler->loadUserByToken($hash);
700
701
        return $this->buildDomainUserObject($spiUser, null, $prioritizedLanguages);
702
    }
703
704
    /**
705
     * This method deletes a user.