Product   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A tableName() 0 4 1
A getPrice() 0 4 1
A getLabel() 0 4 1
A getUniqueId() 0 4 1
1
<?php
2
3
namespace yii2mod\cart\tests\data;
4
5
use yii\db\ActiveRecord;
6
use yii2mod\cart\models\CartItemInterface;
7
8
/**
9
 * Class Product
10
 *
11
 * @property int $id
12
 * @property string $name
13
 * @property string $price
14
 */
15
class Product extends ActiveRecord implements CartItemInterface
16
{
17
    /**
18
     * @return string
19
     */
20
    public static function tableName(): string
21
    {
22
        return 'product';
23
    }
24
25
    /**
26
     * @return int
27
     */
28
    public function getPrice(): int
29
    {
30
        return $this->price;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getLabel(): string
37
    {
38
        return $this->name;
39
    }
40
41
    /**
42
     * @return mixed
43
     */
44
    public function getUniqueId(): int
45
    {
46
        return $this->id;
47
    }
48
}
49