Completed
Pull Request — master (#20)
by
unknown
36:39
created

Currency::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 47
Code Lines 23

Duplication

Lines 47
Ratio 100 %

Code Coverage

Tests 31
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 47
loc 47
ccs 31
cts 31
cp 1
rs 9.0303
cc 1
eloc 23
nc 1
nop 0
crap 1
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 9 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 6
                    'id',
33 6
                    'rate',
34 6
                ],
35 6
                'required',
36 9
            ],
37
            [
38
                [
39 6
                    'rate',
40 6
                ],
41 6
                'string',
42 6
                'max' => 5,
43 6
            ],
44
            [
45
                [
46 6
                    'id',
47 6
                ],
48 6
                'string',
49 6
                'max' => 3,
50 6
            ],
51
            [
52
                [
53 6
                    'plus',
54 6
                ],
55 6
                'integer',
56 6
            ],
57
            [
58
                [
59 6
                    'id',
60 6
                ],
61 6
                'in',
62
                'range' => [
63 6
                    'RUR',
64 6
                    'RUB',
65 6
                    'UAH',
66 6
                    'BYR',
67 6
                    'KZT',
68
                    'USD',
69 6
                    'EUR'
70 6
                ],
71 6
            ],
72
        ];
73
    }
74
75
    /**
76
     * @inheritdoc
77 9
     */
78
    protected function getYmlBody()
79 9
    {
80
        return null;
81
    }
82
}
83