GroupSet   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 36
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getValue() 0 8 2
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
}