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

CachedQueryBuilderSearchingContext::getResults()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
ccs 5
cts 5
cp 1
cc 1
eloc 5
nc 1
nop 0
crap 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