Ejemplo n.º 1
0
 /**
  * Returns a link to function summary file.
  *
  * @param \ApiGen\ReflectionFunction $function Function reflection
  *
  * @return string
  */
 public function getFunctionUrl(ReflectionFunction $function)
 {
     return sprintf($this->config->template['templates']['main']['function']['filename'], $this->urlize($function->getName()));
 }
Ejemplo n.º 2
0
 /**
  * Sorts functions by FQN.
  *
  * @param \ApiGen\ReflectionFunction $one
  * @param \ApiGen\ReflectionFunction $two
  *
  * @return integer
  */
 private function sortFunctions(ReflectionFunction $one, ReflectionFunction $two)
 {
     return strcasecmp($one->getNamespaceName() . '\\' . $one->getName(), $two->getNamespaceName() . '\\' . $two->getName());
 }
Ejemplo n.º 3
0
 /**
  * Processes a function/method and adds classes from annotations to the overall class array.
  *
  * @param array                                                               $declared   Array of declared classes
  * @param array                                                               $allClasses Array with all classes parsed so far
  * @param \ApiGen\ReflectionFunction|\TokenReflection\IReflectionFunctionBase $function   Function/method reflection
  *
  * @return array
  */
 private function processFunction(array $declared, array $allClasses, $function)
 {
     static $parsedAnnotations = array('param', 'return', 'throws');
     $annotations = $function->getAnnotations();
     foreach ($parsedAnnotations as $annotation) {
         if (!isset($annotations[$annotation])) {
             continue;
         }
         foreach ($annotations[$annotation] as $doc) {
             foreach (explode('|', preg_replace('~\\s.*~', '', $doc)) as $name) {
                 if ($name) {
                     $name = Resolver::resolveClassFQN(rtrim($name, '[]'), $function->getNamespaceAliases(), $function->getNamespaceName());
                     $allClasses = $this->addClass($declared, $allClasses, $name);
                 }
             }
         }
     }
     foreach ($function->getParameters() as $param) {
         if ($hint = $param->getClassName()) {
             $allClasses = $this->addClass($declared, $allClasses, $hint);
         }
     }
     return $allClasses;
 }