1 | <?php |
||
18 | class VarSymbol implements VarSymbolInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var bool |
||
22 | */ |
||
23 | protected $const = true; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $name; |
||
29 | |||
30 | /** |
||
31 | * @var null|TypeInterface |
||
32 | */ |
||
33 | private $type; |
||
34 | |||
35 | /** |
||
36 | * @var ValueInterface|null |
||
37 | */ |
||
38 | private $value; |
||
39 | |||
40 | /** |
||
41 | * Record constructor. |
||
42 | * @param string $name |
||
43 | * @param TypeInterface|null $type |
||
44 | */ |
||
45 | public function __construct(string $name, TypeInterface $type = null) |
||
50 | |||
51 | /** |
||
52 | * @return null|ValueInterface |
||
53 | */ |
||
54 | public function getValue(): ?ValueInterface |
||
58 | |||
59 | /** |
||
60 | * @param null|ValueInterface $value |
||
61 | * @return VarSymbolInterface |
||
62 | * @throws TypeConflictException |
||
63 | */ |
||
64 | public function set(?ValueInterface $value): VarSymbolInterface |
||
82 | |||
83 | /** |
||
84 | * @return VarSymbolInterface |
||
85 | */ |
||
86 | public function lock(): VarSymbolInterface |
||
92 | |||
93 | /** |
||
94 | * @return VarSymbolInterface |
||
95 | */ |
||
96 | public function unlock(): VarSymbolInterface |
||
102 | |||
103 | /** |
||
104 | * @return bool |
||
105 | */ |
||
106 | public function isConstant(): bool |
||
110 | |||
111 | /** |
||
112 | * @return string |
||
113 | */ |
||
114 | public function getName(): string |
||
118 | |||
119 | /** |
||
120 | * @return TypeInterface |
||
121 | */ |
||
122 | public function getType(): ?TypeInterface |
||
126 | |||
127 | /** |
||
128 | * @return string |
||
129 | */ |
||
130 | public function __toString(): string |
||
134 | } |
||
135 | |||
136 |