Completed
Push — master ( 3d485f...407dff )
by Paweł
66:49
created

ContainerWidgetRepository::findSortedWidgets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 0
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 1
crap 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A ContainerWidgetRepository::getSortedWidgets() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Superdesk Web Publisher Templates System Bundle.
7
 *
8
 * Copyright 2015 Sourcefabric z.u. and contributors.
9
 *
10
 * For the full copyright and license information, please see the
11
 * AUTHORS and LICENSE files distributed with this source code.
12
 *
13
 * @copyright 2015 Sourcefabric z.ú
14
 * @license http://www.superdesk.org/license
15
 */
16
17
namespace SWP\Bundle\TemplatesSystemBundle\Repository;
18
19
use Gedmo\Sortable\Entity\Repository\SortableRepository;
20
use SWP\Bundle\StorageBundle\Doctrine\ORM\EntityRepositoryTrait;
21
use SWP\Component\TemplatesSystem\Repository\ContainerWidgetRepositoryInterface;
22
23
/**
24
 * ContainerWidget Repository.
25
 */
26
class ContainerWidgetRepository extends SortableRepository implements ContainerWidgetRepositoryInterface
27
{
28
    use EntityRepositoryTrait;
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function getSortedWidgets(array $groupValues = [])
34
    {
35
        return parent::getBySortableGroupsQueryBuilder($groupValues)
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getBySortableGroupsQueryBuilder() instead of getSortedWidgets()). Are you sure this is correct? If so, you might want to change this to $this->getBySortableGroupsQueryBuilder().

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...
36
            ->select('n', 'w')
37
            ->leftJoin('n.widget', 'w');
38
    }
39
}
40