Completed
Push — devel ( 4ef29d...480836 )
by Philippe
05:19 queued 02:10
created

User::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * User.php
4
 *
5
 * PHP version 5.6+
6
 *
7
 * @author pgaultier
8
 * @copyright 2010-2016 Ibitux
9
 * @license http://www.ibitux.com/license license
10
 * @version XXX
11
 * @link http://www.ibitux.com
12
 * @package sweelix\oauth2\server\forms
13
 */
14
15
namespace sweelix\oauth2\server\forms;
16
17
use yii\base\Model;
18
19
/**
20
 * Basic user form
21
 *
22
 * @author pgaultier
23
 * @copyright 2010-2016 Ibitux
24
 * @license http://www.ibitux.com/license license
25
 * @version XXX
26
 * @link http://www.ibitux.com
27
 * @package sweelix\oauth2\server\forms
28
 * @since XXX
29
 */
30
class User extends Model
31
{
32
    public $username;
33
    public $password;
34
35
    /**
36
     * @inheritdoc
37
     */
38 4
    public function rules()
39
    {
40
        return [
41 4
            [['username', 'password'], 'string'],
42 4
            [['username', 'password'], 'required'],
43 4
        ];
44
    }
45
}