Completed
Push — php7 ( ab40a7 )
by personal
04:06
created

ReflectedReturn   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 89
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getValue() 0 4 1
A setValue() 0 5 1
A getType() 0 4 1
A setType() 0 5 1
A getMode() 0 4 1
A setMode() 0 5 1
1
<?php
2
3
/*
4
 * (c) Jean-François Lépine <https://twitter.com/Halleck45>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Hal\Component\OOP\Reflected;
11
use Hal\Component\OOP\Resolver\NameResolver;
12
13
14
/**
15
 * represents the value returned by a method
16
 *
17
 * @author Jean-François Lépine <https://twitter.com/Halleck45>
18
 */
19
class ReflectedReturn {
20
21
    const STRICT_TYPE_HINT = 1;
22
    const DOC_TYPE_HINT = 2;
23
    const ESTIMATED_TYPE_HINT = 3;
24
    const VALUE_UNKNOW = 'unknown';
25
26
    /**
27
     * @var string
28
     */
29
    private $value = self::VALUE_UNKNOW;
30
31
    /**
32
     * @var string
33
     */
34
    private $type;
35
36
    /**
37
     * @var int
38
     */
39
    private $mode = self::ESTIMATED_TYPE_HINT;
40
41
    /**
42
     * @param null $type
43
     * @param string $value
44
     * @param int $mode
45
     */
46
    public function __construct($type = null, $value = self::VALUE_UNKNOW, $mode = self::ESTIMATED_TYPE_HINT)
47
    {
48
        $this->type = $type;
49
        $this->value = $value;
50
        $this->mode = $mode;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getValue()
57
    {
58
        return $this->value;
59
    }
60
61
    /**
62
     * @param string $value
63
     * @return ReflectedReturn
64
     */
65
    public function setValue($value)
66
    {
67
        $this->value = $value;
68
        return $this;
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    public function getType()
75
    {
76
        return $this->type;
77
    }
78
79
    /**
80
     * @param string $type
81
     * @return ReflectedReturn
82
     */
83
    public function setType($type)
84
    {
85
        $this->type = $type;
86
        return $this;
87
    }
88
89
    /**
90
     * @return int
91
     */
92
    public function getMode()
93
    {
94
        return $this->mode;
95
    }
96
97
    /**
98
     * @param int $mode
99
     * @return ReflectedReturn
100
     */
101
    public function setMode($mode)
102
    {
103
        $this->mode = $mode;
104
        return $this;
105
    }
106
107
};