User::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace App\Models;
4
5
use Micro\Mvc\Models\Model;
6
7
/**
8
 * Class User
9
 * @property string login
10
 * @property string fio
11
 * @property string pass
12
 *
13
 * @package App
14
 * @subpackage Models
15
 */
16
class User extends Model
17
{
18
    /**
19
     * @return string
20
     */
21
    static public function tableName()
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
22
    {
23
        return 'users';
24
    }
25
26
    /**
27
     * @return array
28
     */
29
    public function rules()
30
    {
31
        return [
32
            ['email,login', 'required'],
33
            ['email', 'email']
34
        ];
35
    }
36
37
    /**
38
     * @return array
39
     */
40
    public function attributeLabels()
41
    {
42
        return [
43
            'email' => 'E-mail',
44
            'login' => 'Логин',
45
            'pass' => 'Пароль',
46
            'fio' => 'ФИО'
47
48
        ];
49
    }
50
}
51