public function getZooKeeper() { if ($this->metadata instanceof \Kafka\ZooKeeper) { return $this->metadata; } else { throw new \Kafka\Exception('ZooKeeper was not provided'); } }