Completed
Pull Request — master (#51)
by
unknown
15:01
created

ParamOffer::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 8

Duplication

Lines 17
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 17
loc 17
rs 9.4285
cc 1
eloc 8
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 ParamOffer 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 = 'param';
16
17
    /**
18
     * @inheritdoc
19
     */
20
    public static $tagProperties = [
21
        'name',
22
        'unit',
23
    ];
24
25
    /** @var string Название параметра. */
26
    public $name;
27
28
    /** @var string Единицы измерения. */
29
    public $unit;
30
31
    /** @var string Значение параметра. */
32
    public $value;
33
34
    /**
35
     * @inheritdoc
36
     */
37
    public function rules()
38
    {
39
        return [
40
            [
41
                ['name', 'value'],
42
                'required',
43
            ],
44
            [
45
                ['cost'],
46
                'integer',
47
            ],
48
            [
49
                ['name', 'value', 'unit'],
50
                'string',
51
            ],
52
        ];
53
    }
54
}
55