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

ContainerWidgetRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 14
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A 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