コード例 #1
0
ファイル: Generator.php プロジェクト: sirone/apigen
 /**
  * Sorts functions by FQN.
  *
  * @param \ApiGen\Reflection\ReflectionProperty $one
  * @param \ApiGen\Reflection\ReflectionProperty $two
  * @return integer
  */
 private function sortProperties(Reflection\ReflectionProperty $one, Reflection\ReflectionProperty $two)
 {
     return strcasecmp($one->getDeclaringClassName() . '::' . $one->getName(), $two->getDeclaringClassName() . '::' . $two->getName());
 }
コード例 #2
0
 /**
  * @return string
  */
 private function createForProperty(ReflectionProperty $reflectionProperty, array $classes)
 {
     $text = $reflectionProperty->getDeclaringClassName() . '::' . Html::el('var')->setText('$' . $reflectionProperty->getName());
     return $this->linkBuilder->build($this->elementUrlFactory->createForProperty($reflectionProperty), $text, FALSE, $classes);
 }
コード例 #3
0
 /**
  * @return string
  */
 public function createForProperty(ReflectionProperty $property, ReflectionClass $class = NULL)
 {
     $className = $class !== NULL ? $class->getName() : $property->getDeclaringClassName();
     return $this->createForClass($className) . '#' . ($property->isMagic() ? 'm' : '') . '$' . $property->getName();
 }
コード例 #4
0
ファイル: Template.php プロジェクト: sirone/apigen
 /**
  * Returns a link to property in class summary file.
  *
  * @param \ApiGen\Reflection\ReflectionProperty $property Property reflection
  * @param \ApiGen\Reflection\ReflectionClass $class Property declaring class
  * @return string
  */
 public function getPropertyUrl(Reflection\ReflectionProperty $property, Reflection\ReflectionClass $class = null)
 {
     $className = null !== $class ? $class->getName() : $property->getDeclaringClassName();
     return $this->getClassUrl($className) . '#' . ($property->isMagic() ? 'm' : '') . '$' . $property->getName();
 }
コード例 #5
0
 /**
  * Returns visible properties declared by traits.
  *
  * @return array
  */
 public function getTraitProperties()
 {
     $properties = array();
     foreach ($this->reflection->getTraitProperties(self::$propertyAccessLevels) as $property) {
         $apiProperty = new ReflectionProperty($property, self::$generator);
         if (!$this->isDocumented() || $apiProperty->isDocumented()) {
             $properties[$property->getName()] = $apiProperty;
         }
     }
     return $properties;
 }