Passed
Pull Request — master (#7)
by Alexander
02:25
created

NumberTestMock::behaviors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Horat1us\Yii\Tests\Mocks;
4
5
use Horat1us\Yii\Behaviors\NumberBehavior;
6
use yii\base\Model;
7
8
/**
9
 * Class NumberTestMock
10
 * @package Horat1us\Yii\Tests\Mocks
11
 */
12
class NumberTestMock extends Model
13
{
14
    /** @var  string */
15
    public $phone;
16
17
    /**
18
     * @return array
19
     */
20
    public function behaviors()
21
    {
22
        return [
23
            'numberBehavior' => [
24
                'class' => NumberBehavior::class,
25
                'attributes' => 'phone',
26
            ],
27
        ];
28
    }
29
30
    /**
31
     * @return array
32
     */
33
    public function rules()
34
    {
35
        return [
36
            ['phone', 'string',],
37
        ];
38
    }
39
}