Completed
Push — master ( f8a59f...796b11 )
by Dmitry
02:31
created

PriceCreationDto   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 34
ccs 0
cts 2
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 9 2
1
<?php
2
3
namespace hiqdev\billing\hiapi\repositories;
4
5
class PriceCreationDto
6
{
7
    public $id;
8
9
    public $type;
10
11
    public $type_id;
12
13
    public $target_id;
14
15
    public $target_name;
16
17
    public $target_type_id;
18
19
    public $target_type_name;
20
21
    public $quantity;
22
23
    public $unit;
24
25
    public $currency;
26
27
    public $price;
28
29
    public static function fromArray(array $items)
30
    {
31
        $instance = new self;
32
        foreach ($items as $key => $value) {
33
            $instance->$key = $value;
34
        }
35
36
        return $instance;
37
    }
38
}
39