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.
Completed
Pull Request — master (#22)
by Rik
02:05
created

Select::setType()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
dl 12
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 1
1
<?php
2
3
namespace Rb\Specification\Doctrine\Query;
4
5
use Doctrine\ORM\QueryBuilder;
6
use Rb\Specification\Doctrine\Helper\TypeCheckerTrait;
7
use Rb\Specification\Doctrine\SpecificationInterface;
8
9
/**
10
 * Select will modify the query-builder so you can specify SELECT-statements.
11
 */
12
class Select implements SpecificationInterface
13
{
14
    use TypeCheckerTrait;
15
16
    const SELECT     = 'select';
17
    const ADD_SELECT = 'addSelect';
18
19
    protected $validTypes = [self::SELECT, self::ADD_SELECT];
20
21
    /**
22
     * @var string|array
23
     */
24
    protected $select;
25
26
    /**
27
     * @param string|array $select
28
     * @param string       $type
29
     */
30
    public function __construct($select, $type = self::ADD_SELECT)
31
    {
32
        $this->setType($type);
33
        $this->select = $select;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function modify(QueryBuilder $queryBuilder, $dqlAlias)
40
    {
41
        call_user_func_array([$queryBuilder, $this->type], [$this->select]);
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function isSatisfiedBy($value)
48
    {
49
        return true;
50
    }
51
}
52