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.

In::generateParameterName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Rb\Specification\Doctrine\Condition;
4
5
use Doctrine\ORM\QueryBuilder;
6
use Rb\Specification\Doctrine\AbstractSpecification;
7
8
class In extends AbstractSpecification
9
{
10
    /**
11
     * @var mixed
12
     */
13
    protected $value;
14
15
    /**
16
     * @param string      $field
17
     * @param mixed       $value
18
     * @param string|null $dqlAlias
19
     */
20
    public function __construct($field, $value, $dqlAlias = null)
21
    {
22
        $this->value = $value;
23
24
        parent::__construct($field, $dqlAlias);
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 View Code Duplication
    public function modify(QueryBuilder $queryBuilder, $dqlAlias)
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...
31
    {
32
        $paramName = $this->generateParameterName($queryBuilder);
33
        $queryBuilder->setParameter($paramName, $this->value);
34
35
        return (string) $queryBuilder->expr()->in(
36
            $this->createPropertyWithAlias($dqlAlias),
37
            sprintf(':%s', $paramName)
38
        );
39
    }
40
41
    /**
42
     * @param QueryBuilder $queryBuilder
43
     *
44
     * @return string
45
     */
46
    protected function generateParameterName(QueryBuilder $queryBuilder)
47
    {
48
        return sprintf('in_%d', count($queryBuilder->getParameters()));
49
    }
50
}
51