コード例 #1
0
 /**
  * @return string
  */
 private function getConstantFqnName(ReflectionConstant $reflection)
 {
     $class = $reflection->getDeclaringClassName() ?: $reflection->getNamespaceName();
     return $class . '\\' . $reflection->getName();
 }
コード例 #2
0
ファイル: Generator.php プロジェクト: sirone/apigen
 /**
  * Sorts constants by FQN.
  *
  * @param \ApiGen\Reflection\ReflectionConstant $one
  * @param \ApiGen\Reflection\ReflectionConstant $two
  * @return integer
  */
 private function sortConstants(Reflection\ReflectionConstant $one, Reflection\ReflectionConstant $two)
 {
     return strcasecmp(($one->getDeclaringClassName() ?: $one->getNamespaceName()) . '\\' . $one->getName(), ($two->getDeclaringClassName() ?: $two->getNamespaceName()) . '\\' . $two->getName());
 }
コード例 #3
0
 /**
  * @return string
  */
 private function getGlobalConstantName(ReflectionConstant $reflectionConstant)
 {
     if ($reflectionConstant->inNamespace()) {
         return $reflectionConstant->getNamespaceName() . '\\' . Html::el('b')->setText($reflectionConstant->getShortName());
     } else {
         return Html::el('b')->setText($reflectionConstant->getName());
     }
 }