Completed
Pull Request — dev (#24)
by
unknown
03:38
created

SurveyRepository::findSurveyByStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
ccs 0
cts 9
cp 0
cc 1
eloc 7
nc 1
nop 1
crap 2
1
<?php
2
3
namespace AppBundle\Repository;
4
5
/**
6
 * SurveyRepository.
7
 *
8
 * This class was generated by the Doctrine ORM. Add your own custom
9
 * repository methods below.
10
 */
11
class SurveyRepository extends \Doctrine\ORM\EntityRepository
12
{
13 View Code Duplication
    public function findSurveyByStatus($status)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
    {
15
        $query = $this->createQueryBuilder('s')
16
            ->where('s.status = :status')
17
            ->setParameter('status', $status)
18
            ->orderBy('s.updatedAt', 'DESC')
19
            ->getQuery();
20
21
        return $query->getResult();
22
    }
23
24 View Code Duplication
    public function findSurveyByUser($user)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
    {
26
        $query = $this->createQueryBuilder('s')
27
            ->where('s.user = :user')
28
            ->setParameter('user', $user)
29
            ->orderBy('s.updatedAt', 'DESC')
30
            ->getQuery();
31
32
        return $query->getResult();
33
    }
34
}
35