DataSetQueryBuilderFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/*
3
 * WellCommerce Open-Source E-Commerce Platform
4
 *
5
 * This file is part of the WellCommerce package.
6
 *
7
 * (c) Adam Piotrowski <[email protected]>
8
 *
9
 * For the full copyright and license information,
10
 * please view the LICENSE file that was distributed with this source code.
11
 */
12
13
namespace WellCommerce\Component\DataSet\QueryBuilder;
14
15
use WellCommerce\Component\DataSet\Repository\DataSetAwareRepositoryInterface;
16
17
/**
18
 * Class DataSetQueryBuilderFactory
19
 *
20
 * @author  Adam Piotrowski <[email protected]>
21
 */
22
final class DataSetQueryBuilderFactory
23
{
24
    public function create(DataSetAwareRepositoryInterface $repository) : DataSetQueryBuilderInterface
25
    {
26
        return new DataSetQueryBuilder($repository);
0 ignored issues
show
Documentation introduced by
$repository is of type object<WellCommerce\Comp...areRepositoryInterface>, but the function expects a object<Doctrine\ORM\QueryBuilder>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
27
    }
28
}
29