IdRulesTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 27
ccs 0
cts 21
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A idRules() 0 21 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipboxfactory/craft-ember/blob/master/LICENSE
6
 * @link       https://github.com/flipboxfactory/craft-ember/
7
 */
8
9
namespace flipbox\craft\ember\models;
10
11
use yii\base\Model;
12
13
/**
14
 * @property int|null $id
15
 *
16
 * @author Flipbox Factory <[email protected]>
17
 * @since 2.0.0
18
 */
19
trait IdRulesTrait
20
{
21
    /**
22
     * @inheritdoc
23
     */
24
    protected function idRules()
25
    {
26
        return [
27
            [
28
                [
29
                    'id'
30
                ],
31
                'number',
32
                'integerOnly' => true
33
            ],
34
            [
35
                [
36
                    'id'
37
                ],
38
                'safe',
39
                'on' => [
40
                    Model::SCENARIO_DEFAULT
41
                ]
42
            ]
43
        ];
44
    }
45
}
46