1 | <?php |
||
14 | class Variable extends AbstractAst implements ValueInterface |
||
15 | { |
||
16 | |||
17 | /** @var string */ |
||
18 | private $name; |
||
19 | |||
20 | /** @var mixed */ |
||
21 | private $value; |
||
22 | |||
23 | /** @var string */ |
||
24 | private $type; |
||
25 | |||
26 | /** @var bool */ |
||
27 | private $nullable = false; |
||
28 | |||
29 | /** @var bool */ |
||
30 | private $isArray = false; |
||
31 | |||
32 | /** @var bool */ |
||
33 | private $used = false; |
||
34 | |||
35 | /** @var bool */ |
||
36 | private $arrayElementNullable = true; |
||
37 | |||
38 | /** @var bool */ |
||
39 | private $hasDefaultValue = false; |
||
40 | |||
41 | /** @var mixed */ |
||
42 | private $defaultValue = null; |
||
43 | |||
44 | /** |
||
45 | * @param string $name |
||
46 | * @param string $type |
||
47 | * @param bool $nullable |
||
48 | * @param bool $isArray |
||
49 | * @param Location $location |
||
50 | * @param bool $arrayElementNullable |
||
51 | */ |
||
52 | 19 | public function __construct($name, $type, $nullable, $isArray, Location $location, $arrayElementNullable = true) |
|
62 | |||
63 | /** |
||
64 | * @return mixed |
||
65 | * |
||
66 | * @throws \LogicException |
||
67 | */ |
||
68 | 7 | public function getValue() |
|
79 | |||
80 | /** |
||
81 | * @param mixed $value |
||
82 | */ |
||
83 | 11 | public function setValue($value) |
|
87 | |||
88 | /** |
||
89 | * @return string |
||
90 | */ |
||
91 | 12 | public function getName() |
|
95 | |||
96 | /** |
||
97 | * @param string $name |
||
98 | */ |
||
99 | 1 | public function setName($name) |
|
103 | |||
104 | /** |
||
105 | * @return string |
||
106 | */ |
||
107 | 9 | public function getTypeName() |
|
111 | |||
112 | /** |
||
113 | * @param string $type |
||
114 | */ |
||
115 | 1 | public function setTypeName($type) |
|
119 | |||
120 | /** |
||
121 | * @return boolean |
||
122 | */ |
||
123 | 3 | public function isArray() |
|
127 | |||
128 | /** |
||
129 | * @param boolean $isArray |
||
130 | */ |
||
131 | 1 | public function setIsArray($isArray) |
|
135 | |||
136 | /** |
||
137 | * @return boolean |
||
138 | */ |
||
139 | 2 | public function isNullable() |
|
143 | |||
144 | /** |
||
145 | * @param boolean $nullable |
||
146 | */ |
||
147 | 1 | public function setNullable($nullable) |
|
151 | |||
152 | /** |
||
153 | * @return bool |
||
154 | */ |
||
155 | 5 | public function hasDefaultValue() |
|
159 | |||
160 | /** |
||
161 | * @return mixed |
||
162 | */ |
||
163 | public function getDefaultValue() |
||
167 | |||
168 | /** |
||
169 | * @param mixed $defaultValue |
||
170 | */ |
||
171 | 3 | public function setDefaultValue($defaultValue) |
|
177 | |||
178 | /** |
||
179 | * @return boolean |
||
180 | */ |
||
181 | 9 | public function isUsed() |
|
185 | |||
186 | /** |
||
187 | * @param boolean $used |
||
188 | * |
||
189 | * @return $this |
||
190 | */ |
||
191 | 10 | public function setUsed($used) |
|
197 | |||
198 | /** |
||
199 | * @return bool |
||
200 | */ |
||
201 | 1 | public function isArrayElementNullable() |
|
205 | |||
206 | /** |
||
207 | * @param bool $arrayElementNullable |
||
208 | */ |
||
209 | public function setArrayElementNullable($arrayElementNullable) |
||
213 | } |
||
214 |