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.
Completed
Push — bs4 ( c19352...5a3403 )
by
unknown
05:17 queued 53s
created

Text::setModifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace SleepingOwl\Admin\Display\Column;
4
5
class Text extends NamedColumn
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $view = 'column.text';
11
12
    /**
13
     * @var \Closure|mixed
14
     */
15
    protected $modifier = null;
16
17
    /**
18
     * @var bool
19
     */
20
    protected $isSearchable = true;
21
22
    /**
23
     * @return \Closure|mixed
24
     */
25
    public function getModifier()
26
    {
27
        return $this->modifier;
28
    }
29
30
    /**
31
     * @param \Closure|mixed $modifier
32
     *
33
     * @return $this
34
     */
35
    public function setModifier($modifier)
36
    {
37
        $this->modifier = $modifier;
38
39
        return $this;
40
    }
41
42
    /**
43
     * @return array
44
     */
45
    public function toArray()
46
    {
47
        $model_value = $this->getModelValue();
48
        if (is_callable($modifier = $this->getModifier())) {
49
            $model_value = $modifier($model_value, $this->getModel());
50
        }
51
52
        return parent::toArray() + [
53
                'value' => $model_value,
54
                'small' => $this->getModelSmallValue(),
55
            ];
56
    }
57
}
58