Passed
Pull Request — master (#101)
by Łukasz
03:05
created

UserRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A findUserByEmail() 0 3 1
A findUserByActivationToken() 0 3 1
A findUserByPasswordResetToken() 0 3 1
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
namespace FSi\Bundle\AdminSecurityBundle\Doctrine\Repository;
11
12
use Doctrine\ORM\EntityRepository;
13
use FSi\Bundle\AdminSecurityBundle\Security\User\UserRepositoryInterface;
14
15
class UserRepository extends EntityRepository implements UserRepositoryInterface
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function findUserByActivationToken($activationToken)
21
    {
22
        return $this->findOneBy(['activationToken.token' => $activationToken]);
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function findUserByPasswordResetToken($confirmationToken)
29
    {
30
        return $this->findOneBy(['passwordResetToken.token' => $confirmationToken]);
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function findUserByEmail($email)
37
    {
38
        return $this->findOneBy(['email' => $email]);
39
    }
40
}
41