FeaturedFlagsModel::isEnabled()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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