/** * @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'); }
public function __construct(\ReflectionClass $interface) { if (!$interface->isInterface() || $interface->isTrait()) { throw new \InvalidArgumentException('Only interfaces supported'); } parent::__construct($interface); }