ProviderLock   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 44
ccs 0
cts 31
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A rules() 0 31 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
use flipbox\craft\ember\records\ActiveRecord;
13
14
/**
15
 * @author Flipbox Factory <[email protected]>
16
 * @since 1.0.0
17
 *
18
 * @property int $providerId
19
 * @property int $pluginId
20
 */
21
class ProviderLock extends ActiveRecord
22
{
23
    use ProviderAttributeTrait;
24
25
    /**
26
     * The table alias
27
     */
28
    const TABLE_ALIAS = 'patron_provider_locks';
29
30
    /**
31
     * @inheritdoc
32
     */
33
    public function rules()
34
    {
35
        return array_merge(
36
            parent::rules(),
37
            [
38
                [
39
                    [
40
                        'pluginId'
41
                    ],
42
                    'number',
43
                    'integerOnly' => true
44
                ],
45
                [
46
                    [
47
                        'providerId',
48
                        'pluginId'
49
                    ],
50
                    'required'
51
                ],
52
                [
53
                    [
54
                        'pluginId'
55
                    ],
56
                    'safe',
57
                    'on' => [
58
                        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...
59
                    ]
60
                ]
61
            ]
62
        );
63
    }
64
}
65