Completed
Pull Request — master (#15)
by
unknown
05:06
created

DeliveryOption::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 9

Duplication

Lines 18
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 18
loc 18
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
namespace pastuhov\ymlcatalog\models;
3
4
/**
5
 * Class DeliveryOption
6
 *
7
 * Модель опции условий доставки - тега option в секции delivery-option
8
 * @package pastuhov\ymlcatalog\models
9
 */
10 View Code Duplication
class DeliveryOption extends BaseModel
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * @inheritdoc
14
     */
15
    public static $tag = 'option';
16
17
    /**
18
     * @inheritdoc
19
     */
20
    public static $tagProperties = [
21
        'cost',
22
        'days',
23
    ];
24
25
    /** @var int Стоимость доставки в рублях. */
26
    public $cost;
27
28
    /** @var string Срок доставки в рабочих днях. */
29
    public $days;
30
31
    /**
32
     * @inheritdoc
33
     */
34
    public function rules()
35
    {
36
        return [
37
            [
38
                ['cost', 'days'],
39
                'required',
40
            ],
41
            [
42
                ['cost'],
43
                'integer',
44
            ],
45
            [
46
                ['days'],
47
                'string',
48
                'max' => 5,
49
            ],
50
        ];
51
    }
52
53
    /**
54
     * @inheritdoc
55
     */
56
    protected function getYmlBody()
57
    {
58
        return null;
59
    }
60
}
61