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::canShow()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 0
Metric Value
dl 0
loc 9
c 0
b 0
f 0
cc 4
eloc 5
nc 3
nop 0
ccs 0
cts 6
cp 0
crap 20
rs 9.2
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