UserLogin::attributeLabels()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace app\models;
4
5
use Yii;
6
7
/**
8
 * This is the model class for login form.
9
 *
10
 * @property string $username
11
 * @property string $password
12
 * @property bool $remember_me
13
 */
14
class UserLogin extends \yii\base\Model
15
{
16
    public $username;
17
    public $password;
18
    public $remember_me = false;
19
20
    /**
21
     * {@inheritdoc}
22
     */
23 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...
24
    {
25
        return [
26
            [['username', 'password'], 'required'],
27
            [['username', 'password'], 'string', 'max' => 64],
28
            [['remember_me'], 'boolean'],
29
        ];
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function attributeLabels()
36
    {
37
        return [
38
            'username' => Yii::t('app', 'Username'),
39
            'password' => Yii::t('app', 'Password'),
40
            'remember_me' => Yii::t('app', 'Remember me'),
41
        ];
42
    }
43
44
    /**
45
     * Override action to disable default save
46
     * This model has no true support table and is only used for display and validation purposes.
47
     *
48
     * @return bool success
49
     */
50
    public function save()
51
    {
52
        return false;
53
    }
54
}
55