public function getConstants()
{
if ($this->constants === null) {
$this->constants = [];
foreach ($this->reflection->getConstantReflections() as $constant) {
$apiConstant = $this->reflectionFactory->createFromReflection($constant);
if (!$this->isDocumented() || $apiConstant->isDocumented()) {
/** @var ReflectionElement $constant */
$this->constants[$constant->getName()] = $apiConstant;
}
}
}
return $this->constants;
}