Exemple #1
0
 /**
  * @param \phpDocumentor\Reflection\ClassReflector $reflector
  * @param Context $context
  * @param array $config
  */
 public function __construct($reflector = null, $context = null, $config = [])
 {
     parent::__construct($reflector, $context, $config);
     if ($reflector === null) {
         return;
     }
     $this->parentClass = ltrim($reflector->getParentClass(), '\\');
     if (empty($this->parentClass)) {
         $this->parentClass = null;
     }
     $this->isAbstract = $reflector->isAbstract();
     $this->isFinal = $reflector->isFinal();
     foreach ($reflector->getInterfaces() as $interface) {
         $this->interfaces[] = ltrim($interface, '\\');
     }
     foreach ($reflector->getTraits() as $trait) {
         $this->traits[] = ltrim($trait, '\\');
     }
     foreach ($reflector->getConstants() as $constantReflector) {
         $docblock = $constantReflector->getDocBlock();
         if ($docblock !== null && count($docblock->getTagsByName('event')) > 0) {
             $event = new EventDoc($constantReflector);
             $event->definedBy = $this->name;
             $this->events[$event->name] = $event;
         } else {
             $constant = new ConstDoc($constantReflector);
             $constant->definedBy = $this->name;
             $this->constants[$constant->name] = $constant;
         }
     }
 }
Exemple #2
0
 /**
  * @param \phpDocumentor\Reflection\TraitReflector $reflector
  * @param Context                                  $context
  * @param array                                    $config
  */
 public function __construct($reflector = null, $context = null, $config = [])
 {
     parent::__construct($reflector, $context, $config);
     if ($reflector === null) {
         return;
     }
     foreach ($reflector->getTraits() as $trait) {
         $this->traits[] = ltrim($trait, '\\');
     }
 }
Exemple #3
0
 /**
  * @param \phpDocumentor\Reflection\InterfaceReflector $reflector
  * @param Context $context
  * @param array $config
  */
 public function __construct($reflector = null, $context = null, $config = [])
 {
     parent::__construct($reflector, $context, $config);
     if ($reflector === null) {
         return;
     }
     foreach ($reflector->getParentInterfaces() as $interface) {
         $this->parentInterfaces[] = ltrim($interface, '\\');
     }
     foreach ($this->methods as $method) {
         $method->isAbstract = true;
     }
     // interface can not have properties
     $this->properties = null;
 }