Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.0309 |
Changes | 0 |
1 | <?php |
||
31 | 3 | public function selectUsersByParams(Filter $filter):Query |
|
32 | { |
||
33 | 3 | $postsQuery = $this->createQueryBuilder('u'); |
|
34 | 3 | if ($filter->name) { |
|
35 | $postsQuery->where( |
||
36 | $postsQuery->expr()->like('u.firstName', ':name') |
||
37 | ) |
||
38 | ->orWhere( |
||
39 | $postsQuery->expr()->like('u.lastName', ':name') |
||
40 | ) |
||
41 | ->orWhere( |
||
42 | $postsQuery->expr()->like('u.email', ':name') |
||
43 | ) |
||
44 | ->setParameter('name', '%'.$filter->name.'%'); |
||
45 | } |
||
46 | |||
47 | 3 | return $postsQuery->getQuery(); |
|
48 | } |
||
49 | |||
59 |