in src/CodegenClassConstant.hack [61:78]
public function appendToBuilder(HackBuilder $builder): HackBuilder {
$value = $this->getValue();
$abstract = $this->isAbstract();
invariant(
($value !== null) !== $abstract,
'class constants must either be abstract or have a value',
);
$type = $this->getType();
return $builder
->addDocBlock($this->getDocBlock())
->ensureNewLine()
->addIf($abstract, 'abstract ')
->add('const ')
->addIf($type !== null, ($type ?? '').' ')
->add($this->getName())
->addIf($value !== null, ' = '.($value ?? ''))
->addLine(';');
}