Completed
Pull Request — master (#317)
by Guilherme
03:59
created

BlockedPhoneNumberRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A findByPhone() 0 6 1
1
<?php
2
/**
3
 * This file is part of the login-cidadao project or it's bundles.
4
 *
5
 * (c) Guilherme Donato <guilhermednt on github>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace LoginCidadao\PhoneVerificationBundle\Entity;
12
13
use Doctrine\ORM\EntityRepository;
14
use libphonenumber\PhoneNumber;
15
use LoginCidadao\PhoneVerificationBundle\Model\BlockedPhoneNumberInterface;
16
17
/**
18
 * Class BlockedPhoneNumberRepository
19
 * @package LoginCidadao\PhoneVerificationBundle\Entity
20
 *
21
 * @codeCoverageIgnore
22
 */
23
class BlockedPhoneNumberRepository extends EntityRepository
24
{
25
    /**
26
     * @param PhoneNumber $phoneNumber
27
     * @return BlockedPhoneNumber
28
     */
29
    public function findByPhone(PhoneNumber $phoneNumber): ?BlockedPhoneNumberInterface
30
    {
31
        /** @var BlockedPhoneNumber $blockedPhone */
32
        $blockedPhone = $this->findOneBy(['phoneNumber' => $phoneNumber]);
33
34
        return $blockedPhone;
35
    }
36
}
37