Completed
Pull Request — master (#144)
by
unknown
13:51
created

ClientRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
dl 0
loc 18
rs 10
c 1
b 1
f 0
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
    public function isBanned($ip) : bool
13
    {
14
        return null !== $this->createQueryBuilder('c')
15
            ->select('c')
16
            ->where('c.ip = :param')
17
            ->andWhere('c.banned = 1')
18
            ->setParameter(':param', $ip)
19
            ->getQuery()
20
            ->getOneOrNullResult();
21
    }
22
}
23