Completed
Push — master ( 55b270...9c7fd0 )
by Dmitry
03:07
created

PriceFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createModelGroupPrice() 0 4 1
1
<?php
2
3
namespace hiqdev\billing\hiapi\price;
4
5
use hiqdev\php\billing\price\EnumPrice;
6
use hiqdev\php\billing\price\SinglePrice;
7
8
class PriceFactory extends \hiqdev\php\billing\price\PriceFactory
9
{
10
    protected $creators = [
11
        SinglePrice::class => 'createSinglePrice',
12
        EnumPrice::class => 'createEnumPrice',
13
        ModelGroupPrice::class => 'createModelGroupPrice',
14
    ];
15
16
    public function createModelGroupPrice(ModelGroupPriceCreationDto $dto): ModelGroupPrice
17
    {
18
        return new ModelGroupPrice($dto->id, $dto->type, $dto->target, $dto->plan, $dto->prepaid, $dto->price, $dto->subprices);
19
    }
20
}
21