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