public function getConstants()
{
if (null !== $this->cachedConstants) {
return $this->cachedConstants;
}
$constants = [];
foreach ($this->node->stmts as $stmt) {
if ($stmt instanceof ConstNode) {
$constName = $stmt->consts[0]->name;
$constValue = (new CompileNodeToValue())->__invoke($stmt->consts[0]->value, new CompilerContext($this->reflector, $this));
$constants[$constName] = $constValue;
}
}
$this->cachedConstants = $constants;
return $constants;
}