示例#1
0
文件: Document.php 项目: dotink/sage
 /**
  * Keys any modifier information we can glean from our reflection
  *
  * @access private
  * @param IReflection $context The context with which we want to analyze the reflection
  * @return void
  */
 private function keyModifiers($context)
 {
     if ($declaring_class = $this->reflection->getDeclaringClass()) {
         if ($declaring_class != $context) {
             $this->keys[] = 'inherited';
             $this->keys[] = 'external';
         }
     } elseif ($declaring_trait = $this->reflection->getDeclaringTrait()) {
         if ($declaring_trait != $context) {
             $this->keys[] = 'included';
             $this->keys[] = 'external';
         }
     }
     if ($this->type == self::TYPE_METHOD) {
         if ($this->reflection->isFinal()) {
             $this->keys[] = 'final';
         }
         if ($this->reflection->isAbstract()) {
             $this->keys[] = 'abstract';
         }
     }
     if ($this->reflection->isPublic()) {
         $this->keys[] = 'public';
     }
     if ($this->reflection->isPrivate()) {
         $this->keys[] = 'private';
     }
     if ($this->reflection->isProtected()) {
         $this->keys[] = 'protected';
     }
     if ($this->reflection->isStatic()) {
         $this->keys[] = 'static';
     } else {
         $this->keys[] = 'instance';
     }
 }
示例#2
0
 /**
  *
  * @param IReflection $reflection
  * @return string
  */
 protected static function getAccessibility(IReflection $reflection)
 {
     return $reflection->isPrivate() ? "Private" : ($reflection->isProtected() ? "Protected" : "Public");
 }