/** * Return a single constant by given name or index of info * * @param string|int $constantNameOrInfoIndex * @throws Exception\InvalidArgumentException * @return bool|ConstantScanner */ public function getConstant($constantNameOrInfoIndex) { if ($this->classScanner->hasConstant($constantNameOrInfoIndex)) { return $this->classScanner->getConstant($constantNameOrInfoIndex); } foreach ($this->parentClassScanners as $pClassScanner) { if ($pClassScanner->hasConstant($constantNameOrInfoIndex)) { return $pClassScanner->getConstant($constantNameOrInfoIndex); } } throw new Exception\InvalidArgumentException(sprintf('Constant %s not found in %s', $constantNameOrInfoIndex, $this->classScanner->getName())); }