ProviderRulesTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
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 28
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A providerRules() 0 22 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/patron/license
6
 * @link       https://www.flipboxfactory.com/software/patron/
7
 */
8
9
namespace flipbox\patron\records;
10
11
use flipbox\craft\ember\helpers\ModelHelper;
12
13
/**
14
 * @property int|null $providerId
15
 * @property Provider|null $provider
16
 *
17
 * @author Flipbox Factory <[email protected]>
18
 * @since 1.0.0
19
 */
20
trait ProviderRulesTrait
21
{
22
    /**
23
     * @return array
24
     */
25
    protected function providerRules(): array
26
    {
27
        return [
28
            [
29
                [
30
                    'providerId'
31
                ],
32
                'number',
33
                'integerOnly' => true
34
            ],
35
            [
36
                [
37
                    'providerId',
38
                    'provider'
39
                ],
40
                'safe',
41
                'on' => [
42
                    ModelHelper::SCENARIO_DEFAULT
0 ignored issues
show
Deprecated Code introduced by
The constant flipbox\craft\ember\help...elper::SCENARIO_DEFAULT has been deprecated with message: Use `yii\base\Model::SCENARIO_DEFAULT`

This class constant has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the constant will be removed from the class and what other constant to use instead.

Loading history...
43
                ]
44
            ]
45
        ];
46
    }
47
}
48