ProviderRulesTrait::providerRules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 0
cts 4
cp 0
rs 9.568
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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