FeaturedFlagsModel   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 2
cbo 0
dl 0
loc 36
ccs 13
cts 13
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getParamsArray() 0 8 2
A isEnabled() 0 4 1
A getEndDate() 0 4 1
1
<?php
2
3
namespace FeaturedFlags;
4
5
class FeaturedFlagsModel
6
{
7
    protected $_status;
8
    protected $_data;
9
    protected $_endDate;
10
11 24
    public function __construct($status, $data = array(), $endDate = null)
12
    {
13 24
        $this->_status = $status;
14 24
        $this->_data = $data;
15 24
        $this->_endDate = $endDate;
16 24
    }
17
18
    /**
19
     * @return array
20
     */
21 7
    public function getParamsArray()
22
    {
23 7
        if (is_string($this->_data)) {
24 4
            return json_decode($this->_data, true);
25
        } else {
26 3
            return array();
27
        }
28
    }
29
30 17
    public function isEnabled()
31
    {
32 17
        return $this->_status == true;
33
    }
34
35
36 21
    public function getEndDate()
37
    {
38 21
        return $this->_endDate;
39
    }
40
}
41