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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 39
ccs 18
cts 18
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getSql() 0 3 1
A getQuery() 0 11 1
A __construct() 0 8 1
A getDql() 0 3 1
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