ValueEntry   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 7
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 67
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 3
A getValue() 0 4 1
A setValue() 0 6 1
A getType() 0 4 1
A setType() 0 6 1
1
<?php
2
/**
3
 * @link https://github.com/old-town/old-town-propertyset
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\PropertySet\Providers\Memory;
7
8
/**
9
 * Class ValueEntry
10
 *
11
 * @package OldTown\PropertySet\Providers\Memory
12
 */
13
class ValueEntry
14
{
15
    /**
16
     * @var mixed
17
     */
18
    protected $value;
19
20
    /**
21
     * @var integer
22
     */
23
    protected $type;
24
25
    /**
26
     * @param mixed $value
27
     * @param integer|null $type
28
     */
29
    public function __construct($value = null, $type = null)
30
    {
31
        if (null !== $value) {
32
            $this->setValue($value);
33
        }
34
35
        if (null !== $type) {
36
            $this->setType($type);
37
        }
38
    }
39
40
    /**
41
     * @return mixed
42
     */
43
    public function getValue()
44
    {
45
        return $this->value;
46
    }
47
48
    /**
49
     * @param mixed $value
50
     *
51
     * @return $this
52
     */
53
    public function setValue($value)
54
    {
55
        $this->value = $value;
56
57
        return $this;
58
    }
59
60
    /**
61
     * @return int
62
     */
63
    public function getType()
64
    {
65
        return $this->type;
66
    }
67
68
    /**
69
     * @param int $type
70
     *
71
     * @return $this
72
     */
73
    public function setType($type)
74
    {
75
        $this->type = (integer)$type;
76
77
        return $this;
78
    }
79
}
80