TypeRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 2
b 0
f 0
dl 0
loc 19
ccs 0
cts 8
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
1
<?php
2
/**
3
 * API for Billing
4
 *
5
 * @link      https://github.com/hiqdev/billing-hiapi
6
 * @package   billing-hiapi
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\billing\hiapi\type;
12
13
use hiqdev\php\billing\target\TargetFactoryInterface;
14
use hiqdev\php\billing\type\TypeFactoryInterface;
15
use hiqdev\yii\DataMapper\components\ConnectionInterface;
16
use hiqdev\yii\DataMapper\components\EntityManagerInterface;
17
18
/**
19
 * Class TypeRepository.
20
 *
21
 * @author Dmytro Naumenko <[email protected]>
22
 */
23
class TypeRepository extends \hiqdev\yii\DataMapper\repositories\BaseRepository
24
{
25
    /**
26
     * @var TypeFactoryInterface
27
     */
28
    protected $factory;
29
30
    /** {@inheritdoc} */
31
    public $queryClass = TypeQuery::class;
32
33
    public function __construct(
34
        ConnectionInterface $db,
35
        EntityManagerInterface $em,
36
        TargetFactoryInterface $factory,
37
        array $config = []
38
    ) {
39
        parent::__construct($db, $em, $config);
0 ignored issues
show
Unused Code introduced by
The call to hiqdev\yii\DataMapper\re...pository::__construct() has too many arguments starting with $config. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

39
        parent::/** @scrutinizer ignore-call */ 
40
                __construct($db, $em, $config);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
40
41
        $this->factory = $factory;
0 ignored issues
show
Documentation Bug introduced by
It seems like $factory of type hiqdev\php\billing\target\TargetFactoryInterface is incompatible with the declared type hiqdev\php\billing\type\TypeFactoryInterface of property $factory.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
42
    }
43
}
44