Passed
Push — master ( 487c66...f7d584 )
by Alexander
01:51
created

EntityTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 14
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
4
namespace Horat1us\Yii\Traits;
5
6
use Horat1us\Yii\Helpers\TransactionHelper;
7
use Horat1us\Yii\Interfaces\TransactionInterface;
8
use yii\db\ActiveRecordInterface;
9
10
11
/**
12
 * Trait EntityTrait
13
 * @package Horat1us\Yii\Traits
14
 */
15
trait EntityTrait
16
{
17
    /** @var  ActiveRecordInterface */
18
    protected $activeRecord;
19
20
    /** @var  TransactionHelper */
21
    protected $transaction;
22
23
    public function __construct(ActiveRecordInterface $activeRecord, TransactionInterface $transaction)
24
    {
25
        $this->activeRecord = $activeRecord;
26
        $this->transaction = $transaction;
0 ignored issues
show
Documentation Bug introduced by
It seems like $transaction of type object<Horat1us\Yii\Inte...s\TransactionInterface> is incompatible with the declared type object<Horat1us\Yii\Helpers\TransactionHelper> of property $transaction.

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...
27
    }
28
}