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

PriceFactory::createModelGroupPrice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
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