public function getConstant($nameOrConstant)
{
if ($nameOrConstant instanceof PhpConstant) {
$nameOrConstant = $nameOrConstant->getName();
}
if (!$this->constants->has($nameOrConstant)) {
throw new \InvalidArgumentException(sprintf('The constant "%s" does not exist.', $nameOrConstant));
}
return $this->constants->get($nameOrConstant);
}