GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( b2510c...ee0bb8 )
by
unknown
12:46
created

Delete   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 16.66%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 39
c 1
b 0
f 0
ccs 3
cts 18
cp 0.1666
rs 10
wmc 6
lcom 1
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A initialize() 0 10 1
A canShow() 0 9 4
1
<?php
2
3
namespace SleepingOwl\Admin\Form\Buttons;
4
5
/**
6
 * Class Save.
7
 */
8
class Delete extends FormButton
9
{
10
    protected $show = true;
11
    protected $name = 'delete';
12
    protected $iconClass = 'fa-times';
13
14 10
    public function __construct()
15
    {
16 10
        $this->setText(trans('sleeping_owl::lang.table.delete'));
17 10
    }
18
19
    /**
20
     * Init Cancel Button.
21
     */
22
    public function initialize()
23
    {
24
        parent::initialize();
25
        $this->setHtmlAttributes([
26
            'name'          => 'next_action',
27
            'class'         => 'btn btn-danger btn-delete',
28
            'data-url'      => $this->getModelConfiguration()->getDeleteUrl($this->getModel()->getKey()),
29
            'data-redirect' => $this->getModelConfiguration()->getDisplayUrl(),
30
        ]);
31
    }
32
33
    /**
34
     * Show policy.
35
     * @return bool
36
     */
37
    public function canShow()
38
    {
39
        if (is_null($this->getModel()->getKey()) || ! $this->show) {
40
            return false;
41
        }
42
43
        $this->show = ! $this->isTrashed() && $this->getModelConfiguration()->isDeletable($this->getModel());
44
        parent::canShow();
45
    }
46
}
47