Completed
Push — master ( 7a35bc...7eff79 )
by Krzysztof
05:49 queued 02:58
created

CachedQueryBuilderSearchingContext   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 1
c 2
b 1
f 1
lcom 0
cbo 3
dl 0
loc 13
rs 10
ccs 5
cts 5
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResults() 0 7 1
1
<?php
2
3
namespace KGzocha\Searcher\Context\Doctrine;
4
5
/**
6
 * Use this class as a SearchingContext in order to allow all criteria builders
7
 * to work with Doctrine's QueryBuilder, with query caching enabled by default.
8
 *
9
 * @author Daniel Ribeiro <[email protected]>
10
 */
11
class CachedQueryBuilderSearchingContext extends QueryBuilderSearchingContext
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 1
    public function getResults()
17
    {
18 1
        return parent::getQueryBuilder()
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getQueryBuilder() instead of getResults()). Are you sure this is correct? If so, you might want to change this to $this->getQueryBuilder().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
19 1
            ->getQuery()
20 1
            ->useQueryCache(true)
21 1
            ->getResult();
22
    }
23
}
24