Completed
Pull Request — master (#144)
by Serhii
24:57
created

ClientRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 18
ccs 8
cts 8
cp 1
rs 10
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A isBanned() 0 10 1
1
<?php
2
3
namespace AppBundle\Repository;
4
5
class ClientRepository extends \Doctrine\ORM\EntityRepository
6
{
7
    /**
8
     * @param string $ip
9
     *
10
     * @return bool
11
     */
12 99
    public function isBanned($ip) : bool
13
    {
14 99
        return null !== $this->createQueryBuilder('c')
15 99
            ->select('c')
16 99
            ->where('c.ip = :param')
17 99
            ->andWhere('c.banned = 1')
18 99
            ->setParameter(':param', $ip)
19 99
            ->getQuery()
20 99
            ->getOneOrNullResult();
21
    }
22
}
23