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

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 10
c 1
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
ccs 0
cts 9
cp 0
crap 2
rs 9.4285
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