UserRepository::findUserByPasswordResetToken()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * (c) FSi sp. z o.o. <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace FSi\Bundle\AdminSecurityBundle\Doctrine\Repository;
13
14
use Doctrine\ORM\EntityRepository;
15
use FSi\Bundle\AdminSecurityBundle\Security\User\ActivableInterface;
16
use FSi\Bundle\AdminSecurityBundle\Security\User\ResettablePasswordInterface;
17
use FSi\Bundle\AdminSecurityBundle\Security\User\UserRepositoryInterface;
18
use Symfony\Component\Security\Core\User\UserInterface as SymfonyUserInterface;
19
20
class UserRepository extends EntityRepository implements UserRepositoryInterface
21
{
22
    public function findUserByActivationToken(string $activationToken): ?ActivableInterface
23
    {
24
        return $this->findOneBy(['activationToken.token' => $activationToken]);
25
    }
26
27
    public function findUserByPasswordResetToken(string $confirmationToken): ?ResettablePasswordInterface
28
    {
29
        return $this->findOneBy(['passwordResetToken.token' => $confirmationToken]);
30
    }
31
32
    public function findUserByEmail(string $email): ?SymfonyUserInterface
33
    {
34
        return $this->findOneBy(['email' => $email]);
35
    }
36
}
37