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

NumberTestMock   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A behaviors() 0 9 1
A rules() 0 6 1
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
}