Completed
Push — develop ( fcce06...87d9a9 )
by Nate
02:07
created

DeleteOrganization   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 22
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 4 1
A find() 0 7 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/organization/license
6
 * @link       https://www.flipboxfactory.com/software/organization/
7
 */
8
9
namespace flipbox\organizations\actions\organizations;
10
11
use flipbox\craft\ember\actions\elements\DeleteElement;
12
use flipbox\organizations\elements\Organization;
13
use flipbox\organizations\elements\Organization as OrganizationElement;
14
15
/**
16
 * @author Flipbox Factory <[email protected]>
17
 * @since 1.0.0
18
 */
19
class DeleteOrganization extends DeleteElement
20
{
21
    /**
22
     * @inheritdoc
23
     */
24
    public function run($organization)
25
    {
26
        return parent::run($organization);
27
    }
28
29
    /**
30
     * @inheritdoc
31
     * @return OrganizationElement
32
     */
33
    public function find($identifier)
34
    {
35
        return Organization::findOne([
0 ignored issues
show
Bug Compatibility introduced by
The expression \flipbox\organizations\e...er, 'status' => null)); of type craft\base\Element|null|craft\base\Element[] adds the type craft\base\Element[] to the return on line 35 which is incompatible with the return type documented by flipbox\organizations\ac...eleteOrganization::find of type flipbox\organizations\elements\Organization|null.
Loading history...
36
            (is_numeric($identifier) ? 'id' : 'slug') => $identifier,
37
            'status' => null
38
        ]);
39
    }
40
}
41