DeleteProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 31
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 4 1
A performAction() 0 4 1
A find() 0 7 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\actions\provider;
10
11
use flipbox\craft\ember\actions\records\DeleteRecord;
12
use flipbox\patron\records\Provider;
13
use yii\db\ActiveRecord;
14
15
/**
16
 * @author Flipbox Factory <[email protected]>
17
 * @since 1.0.0
18
 */
19
class DeleteProvider extends DeleteRecord
20
{
21
    /**
22
     * @inheritdoc
23
     */
24
    public function run($provider)
25
    {
26
        return parent::run($provider);
27
    }
28
29
    /**
30
     * @inheritdoc
31
     * @param Provider $record
32
     */
33
    protected function performAction(ActiveRecord $record): bool
34
    {
35
        return $record->delete();
36
    }
37
38
    /**
39
     * @inheritdoc
40
     * @return Provider|null
41
     */
42
    protected function find($id)
43
    {
44
        return Provider::findOne([
45
            'enabled' => null,
46
            'id' => $id
47
        ]);
48
    }
49
}
50