Passed
Push — master ( 506560...11b166 )
by Loban
01:56
created

SettingsForm   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 2
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
}