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 — merge-dev-to-master ( fdc6fe )
by
unknown
11:18
created

MultiSelect::getValueFromModel()   A

Complexity

Conditions 6
Paths 8

Size

Total Lines 19
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 42

Importance

Changes 0
Metric Value
cc 6
eloc 9
nc 8
nop 0
dl 0
loc 19
ccs 0
cts 14
cp 0
crap 42
rs 9.2222
c 0
b 0
f 0
1
<?php
2
3
namespace SleepingOwl\Admin\Form\Element;
4
5
use SleepingOwl\Admin\Traits\ElementTaggable;
6
use SleepingOwl\Admin\Traits\ElementSaveRelation;
7
use SleepingOwl\Admin\Traits\ElementSyncCallback;
8
use SleepingOwl\Admin\Contracts\Form\Element\Taggable;
9
use SleepingOwl\Admin\Traits\ElementDeleteRelatedItem;
10
use SleepingOwl\Admin\Contracts\Form\Element\HasSyncCallback;
11
use SleepingOwl\Admin\Contracts\Form\Element\MustDeleteRelatedItem;
12
13
class MultiSelect extends Select implements Taggable, HasSyncCallback, MustDeleteRelatedItem
14
{
15
    use ElementSaveRelation,
16
        ElementTaggable,
17
        ElementSyncCallback,
18
        ElementDeleteRelatedItem;
19
20
    /**
21
     * @var string
22
     */
23
    protected $view = 'form.element.multiselect';
24
25
    /**
26
     * @return string
27
     */
28
    public function getName()
29
    {
30
        return parent::getName().'[]';
31
    }
32
33
    /**
34
     * @return array
35
     */
36
    public function toArray()
37
    {
38
        $this->setHtmlAttributes([
39
            'id' => $this->getId(),
40
            'class' => 'form-control',
41
            'multiple',
42
        ]);
43
44
        if ($this->isTaggable()) {
45
            $this->setHtmlAttribute('class', 'input-taggable');
46
        }
47
48
        if ($this->isReadonly()) {
49
            $this->setHtmlAttribute('disabled', 'disabled');
50
        }
51
52
        return [
53
                'taggable' => $this->isTaggable(),
54
                'attributes' => $this->htmlAttributesToString(),
55
            ] + parent::toArray();
56
    }
57
}
58