Exemplo n.º 1
0
 /**
  * 
  * @param string $type Class or Interface name
  * @return boolean
  */
 public function isInstanceOf($type)
 {
     $reflType = new \ReflectionClass($type);
     if ($reflType->isInterface()) {
         return $this->reflClass->implementsInterface($type);
     } else {
         return $this->reflClass->isSubclassOf($type) || $this->reflClass->getName() === $type;
     }
 }
Exemplo n.º 2
0
 public static function getName(ReflectionClass $reflClass)
 {
     $serviceName = $reflClass->getName();
     $component = $reflClass->getAnnotation(Component::class);
     if ($component && $component->name) {
         $serviceName = $component->name;
     }
     return $serviceName;
 }