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

Destroy::canShow()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 9
Code Lines 5

Duplication

Lines 9
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 0
Metric Value
dl 9
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 View Code Duplication
class Destroy extends FormButton
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    protected $show = true;
11
    protected $name = 'destroy';
12
    protected $iconClass = 'fa-ban';
13
14
    public function __construct()
15
    {
16
        $this->setText(trans('sleeping_owl::lang.table.destroy'));
17
    }
18
19
    /**
20
     * Init Cancel Button.
21
     */
22
    public function initialize()
23
    {
24
        parent::initialize();
25
        $this->setHtmlAttributes([
26
            'type'  => 'submit',
27
            'name'  => 'next_action',
28
            'class' => 'btn btn-danger',
29
            'data-url'=>$this->getModelConfiguration()->getDestroyUrl($this->getModel()->getKey()),
30
            'data-redirect'=>$this->getModelConfiguration()->getDisplayUrl(),
31
        ]);
32
    }
33
34
    /**
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() &&
44
            $this->getModelConfiguration()->isDestroyable($this->getModel());
45
    }
46
}
47