Passed
Push — master ( f4169b...5ce74f )
by Loban
02:35
created

SettingsForm::attributeLabels()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace example\models;
4
5
use lav45\settings\Model;
6
7
class SettingsForm extends Model
8
{
9
    /**
10
     * @var string
11
     */
12
    public $title;
13
    /**
14
     * @var string
15
     */
16
    public $meta_keywords;
17
    /**
18
     * @var string
19
     */
20
    public $meta_description;
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function rules()
26
    {
27
        return [
28
            [['title'], 'trim'],
29
            [['title'], 'string', 'max' => 128],
30
31
            [['meta_keywords'], 'trim'],
32
            [['meta_keywords'], 'string', 'max' => 128],
33
34
            [['meta_description'], 'trim'],
35
            [['meta_description'], 'string', 'max' => 256],
36
        ];
37
    }
38
39
    /**
40
     * @inheritdoc
41
     */
42
    public function attributeLabels()
43
    {
44
        return [
45
            'title' => 'Title',
46
            'meta_keywords' => 'Meta keywords',
47
            'meta_description' => 'Meta description',
48
        ];
49
    }
50
}