ValueEntry::getType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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