InputForm::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * Multi-factor authentication for Yii2 projects
4
 *
5
 * @link      https://github.com/hiqdev/yii2-mfa
6
 * @package   yii2-mfa
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2016-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\yii2\mfa\forms;
12
13
use Yii;
14
15
/**
16
 * Verification code input form.
17
 */
18
class InputForm extends \yii\base\Model
19
{
20
    public $code;
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function rules()
26
    {
27
        return [
28
            ['code', 'integer', 'max' => 999999],
29
            ['code', 'required'],
30
        ];
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function attributeLabels()
37
    {
38
        return [
39
            'code' => Yii::t('mfa', 'Authentication code'),
40
        ];
41
    }
42
}
43