GroupSet::getValue()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace Dwo\Aggregator\Model;
4
5
/**
6
 * Class GroupSet
7
 *
8
 * @author Dave Www <[email protected]>
9
 */
10
class GroupSet
11
{
12
    /**
13
     * @var array
14
     */
15
    protected $in;
16
17
    /**
18
     * @var string
19
     */
20
    protected $out;
21
22
    /**
23
     * @param array  $in
24
     * @param string $out
25
     */
26
    public function __construct(array $in, $out)
27
    {
28
        $this->in = $in;
29
        $this->out = $out;
30
    }
31
32
    /**
33
     * @param string $value
34
     *
35
     * @return string
36
     */
37
    public function getValue($value)
38
    {
39
        if (!in_array($value, $this->in)) {
40
            $value = $this->out;
41
        }
42
43
        return $value;
44
    }
45
}