Completed
Push — master ( b415f5...05f0c6 )
by Dmitry
05:23
created

ActionDto::load()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 18
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 0
cts 8
cp 0
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 10
nc 4
nop 2
crap 12
1
<?php
2
3
namespace hiqdev\billing\hiapi\commands\order;
4
5
use hiapi\validators\NestedModelValidator;
6
use yii\base\Model;
7
8
class ActionDto extends Model
9
{
10
    public $type;
11
12
    public $target;
13
14
    public $quantity;
15
16
    public function rules()
17
    {
18
        return [
19
            [['type', 'target', 'quantity'], 'required'],
20
            [['target'], NestedModelValidator::class, 'modelClass' => TargetDto::class],
21
            [['quantity'], NestedModelValidator::class, 'modelClass' => QuantityDto::class],
22
            [['type'], 'string']
23
        ];
24
    }
25
}
26