Пример #1
0
 /**
  * @return ReflectedClass
  */
 public function getClass()
 {
     if ($this->object instanceof ReflectedClass) {
         return $this->object;
     }
     throw new \RuntimeException('Method is not part of a class but of ' . $this->object->getKind() . ' instead');
 }
Пример #2
0
 public function __construct(\ReflectionClass $interface)
 {
     if (!$interface->isInterface() || $interface->isTrait()) {
         throw new \InvalidArgumentException('Only interfaces supported');
     }
     parent::__construct($interface);
 }