Passed
Push — master ( 4248bd...b32226 )
by Chris
02:25
created

MultiValueSelectionTrait::getClearControl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace WebTheory\Saveyour\Concerns;
4
5
trait MultiValueSelectionTrait
6
{
7
    /**
8
     *
9
     */
10
    protected function isSelectionSelected(string $value): bool
11
    {
12
        return in_array($value, $this->value);
13
    }
14
15
    /**
16
     * Set the value of value
17
     *
18
     * @param mixed $value
19
     *
20
     * @return self
21
     */
22
    public function setValue($value)
23
    {
24
        $this->value = (array) $value;
0 ignored issues
show
Bug Best Practice introduced by
The property value does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
25
26
        return $this;
27
    }
28
}
29