Completed
Pull Request — master (#6)
by
unknown
04:50
created

Currency::rules()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 46
Code Lines 22

Duplication

Lines 46
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 46
loc 46
ccs 0
cts 46
cp 0
rs 8.9411
cc 1
eloc 22
nc 1
nop 0
crap 2
1
<?php
2
namespace pastuhov\ymlcatalog\models;
3
4
class Currency extends BaseModel
5
{
6
    /**
7
     * @inheritdoc
8
     */
9
    public static $tag = 'currency';
10
11
    /**
12
     * @inheritdoc
13
     */
14
    public static $tagProperties = [
15
        'id',
16
        'rate',
17
        'plus',
18
    ];
19
20
    public $id;
21
    public $rate;
22
    public $plus;
23
24
    /**
25
     * @inheritdoc
26
     */
27 View Code Duplication
    public function rules()
0 ignored issues
show
Duplication introduced by
This method 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...
28
    {
29
        return [
30
            [
31
                [
32
                    'id',
33
                    'rate',
34
                ],
35
                'required',
36
            ],
37
            [
38
                [
39
                    'rate',
40
                ],
41
                'string',
42
                'max' => 5,
43
            ],
44
            [
45
                [
46
                    'id',
47
                ],
48
                'string',
49
                'max' => 3,
50
            ],
51
            [
52
                [
53
                    'plus',
54
                ],
55
                'integer',
56
            ],
57
            [
58
                [
59
                    'id',
60
                ],
61
                'in',
62
                'range' => [
63
                    'RUR',
64
                    'UAH',
65
                    'BYR',
66
                    'KZT',
67
                    'USD',
68
                    'EUR'
69
                ],
70
            ],
71
        ];
72
    }
73
74
    /**
75
     * @inheritdoc
76
     */
77
    protected function getYmlBody()
78
    {
79
        return null;
80
    }
81
}
82