Example #1
0
 /**
  * Sorts methods by FQN.
  *
  * @param \ApiGen\Reflection\ReflectionMethod $one
  * @param \ApiGen\Reflection\ReflectionMethod $two
  * @return integer
  */
 private function sortMethods(Reflection\ReflectionMethod $one, Reflection\ReflectionMethod $two)
 {
     return strcasecmp($one->getDeclaringClassName() . '::' . $one->getName(), $two->getDeclaringClassName() . '::' . $two->getName());
 }
 /**
  * @param string $name
  * @param ReflectionClass|ReflectionMethod $reflection
  * @return string
  */
 private function getClassFqn($name, $reflection)
 {
     return Resolver::resolveClassFqn($name, $reflection->getNamespaceAliases(), $reflection->getNamespaceName());
 }
 /**
  * @return string
  */
 public function createForMethod(ReflectionMethod $method, ReflectionClass $class = NULL)
 {
     $className = $class !== NULL ? $class->getName() : $method->getDeclaringClassName();
     return $this->createForClass($className) . '#' . ($method->isMagic() ? 'm' : '') . '_' . ($method->getOriginalName() ?: $method->getName());
 }
Example #4
0
 /**
  * Returns a link to method in class summary file.
  *
  * @param \ApiGen\Reflection\ReflectionMethod $method Method reflection
  * @param \ApiGen\Reflection\ReflectionClass $class Method declaring class
  * @return string
  */
 public function getMethodUrl(Reflection\ReflectionMethod $method, Reflection\ReflectionClass $class = null)
 {
     $className = null !== $class ? $class->getName() : $method->getDeclaringClassName();
     return $this->getClassUrl($className) . '#' . ($method->isMagic() ? 'm' : '') . '_' . ($method->getOriginalName() ?: $method->getName());
 }
 /**
  * Returns visible methods declared by traits.
  *
  * @return array
  */
 public function getTraitMethods()
 {
     $methods = array();
     foreach ($this->reflection->getTraitMethods(self::$methodAccessLevels) as $method) {
         $apiMethod = new ReflectionMethod($method, self::$generator);
         if (!$this->isDocumented() || $apiMethod->isDocumented()) {
             $methods[$method->getName()] = $apiMethod;
         }
     }
     return $methods;
 }