/** * @return string */ public function createForConstant(ConstantReflectionInterface $constant) { // Class constant if ($className = $constant->getDeclaringClassName()) { return $this->createForClass($className) . '#' . $constant->getName(); } // Constant in namespace or global space return sprintf($this->configuration->getOption(CO::TEMPLATE)['templates']['constant']['filename'], Filters::urlize($constant->getName())); }
/** * @return string */ private function getGlobalConstantName(ConstantReflectionInterface $reflectionConstant) { if ($reflectionConstant->inNamespace()) { return $reflectionConstant->getNamespaceName() . '\\' . Html::el('b')->setText($reflectionConstant->getShortName()); } else { return Html::el('b')->setText($reflectionConstant->getName()); } }
/** * @return string */ private function getConstantFqnName(ConstantReflectionInterface $reflection) { $class = $reflection->getDeclaringClassName() ?: $reflection->getNamespaceName(); return $class . '\\' . $reflection->getName(); }