GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#52)
by Simone
03:32
created

CreateQuery::getQuery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 11
ccs 9
cts 9
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Mado\QueryBundle\Action;
4
5
use Mado\QueryBundle\Interfaces\EntityClass;
6
use Mado\QueryBundle\Queries\QueryBuilderOptions;
7
use Mado\QueryBundle\Repositories\BaseRepository;
8
9
final class CreateQuery
10
{
11
    private $manager;
12
13
    private $options;
14
15
    private $entityClass;
0 ignored issues
show
Unused Code introduced by
The property $entityClass is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
16
17 2
    public function __construct(
18
        \Doctrine\ORM\EntityManager $manager,
19
        QueryBuilderOptions $options,
20
        EntityClass $class
21
    ) {
22 2
        $this->manager = $manager;
23 2
        $this->options = $options;
24 2
        $this->class   = $class;
0 ignored issues
show
Bug Best Practice introduced by
The property class does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
25 2
    }
26
27 2
    private function getQuery()
28
    {
29 2
        return (new BaseRepository($this->manager,
30 2
            $this->manager->getClassMetadata($this->class->getFQNC())
31
        ))
32 2
        ->setQueryOptions($this->options)
33 2
        ->getQueryBuilderFactory()
34 2
        ->filter()
35 2
        ->sort()
36 2
        ->getQueryBuilder()
37 2
        ->getQuery();
38
    }
39
40 1
    public function getDql()
41
    {
42 1
        return $this->getQuery()->getDql();
43
    }
44
45 1
    public function getSql()
46
    {
47 1
        return $this->getQuery()->getSql();
48
    }
49
}
50