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
Push — master ( e61fb8...8fb6b9 )
by Rik
19s queued 12s
created

IsMemberOf   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 3
dl 30
loc 30
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A modify() 7 7 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Rb\Specification\Doctrine\Condition;
4
5
use Doctrine\ORM\QueryBuilder;
6
use Rb\Specification\Doctrine\AbstractSpecification;
7
8 View Code Duplication
class IsMemberOf extends AbstractSpecification
0 ignored issues
show
Duplication introduced by
This class 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...
9
{
10
    /**
11
     * @var string
12
     */
13
    private $className;
14
15
    /**
16
     * @param string $field
17
     * @param string $className
18
     * @param string $dqlAlias
19
     */
20
    public function __construct($field, $className, $dqlAlias = null)
21
    {
22
        $this->className = $className;
23
24
        parent::__construct($field, $dqlAlias);
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function modify(QueryBuilder $queryBuilder, $dqlAlias)
31
    {
32
        return (string) $queryBuilder->expr()->isMemberOf(
33
            $this->createPropertyWithAlias($dqlAlias),
34
            $this->className
35
        );
36
    }
37
}
38