diff --git a/dictionaries/CallMap.php b/dictionaries/CallMap.php index 782ed5d8f..ccefe6a0b 100644 --- a/dictionaries/CallMap.php +++ b/dictionaries/CallMap.php @@ -9696,97 +9696,6 @@ return [ 'RarException::setUsingExceptions' => ['RarEntry', 'using_exceptions'=>'bool'], 'rawurldecode' => ['string', 'string'=>'string'], 'rawurlencode' => ['string', 'string'=>'string'], -'rd_kafka_err2str' => ['string', 'err'=>'int'], -'rd_kafka_errno' => ['int'], -'rd_kafka_errno2err' => ['int', 'errnox'=>'int'], -'rd_kafka_offset_tail' => ['int', 'cnt'=>'int'], -'RdKafka::addBrokers' => ['int', 'broker_list'=>'string'], -'RdKafka::flush' => ['int', 'timeout_ms'=>'int'], -'RdKafka::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'?RdKafka\Topic', 'timeout_ms'=>'int'], -'RdKafka::getOutQLen' => ['int'], -'RdKafka::newQueue' => ['RdKafka\Queue'], -'RdKafka::newTopic' => ['RdKafka\Topic', 'topic_name'=>'string', 'topic_conf='=>'?RdKafka\TopicConf'], -'RdKafka::poll' => ['void', 'timeout_ms'=>'int'], -'RdKafka::setLogLevel' => ['void', 'level'=>'int'], -'RdKafka\Conf::dump' => ['array'], -'RdKafka\Conf::set' => ['void', 'name'=>'string', 'value'=>'string'], -'RdKafka\Conf::setDefaultTopicConf' => ['void', 'topic_conf'=>'RdKafka\TopicConf'], -'RdKafka\Conf::setDrMsgCb' => ['void', 'callback'=>'callable'], -'RdKafka\Conf::setErrorCb' => ['void', 'callback'=>'callable'], -'RdKafka\Conf::setRebalanceCb' => ['void', 'callback'=>'callable'], -'RdKafka\Conf::setStatsCb' => ['void', 'callback'=>'callable'], -'RdKafka\Consumer::__construct' => ['void', 'conf='=>'?RdKafka\Conf'], -'RdKafka\Consumer::addBrokers' => ['int', 'broker_list'=>'string'], -'RdKafka\Consumer::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'?RdKafka\Topic', 'timeout_ms'=>'int'], -'RdKafka\Consumer::getOutQLen' => ['int'], -'RdKafka\Consumer::newQueue' => ['RdKafka\Queue'], -'RdKafka\Consumer::newTopic' => ['RdKafka\ConsumerTopic', 'topic_name'=>'string', 'topic_conf='=>'?RdKafka\TopicConf'], -'RdKafka\Consumer::poll' => ['void', 'timeout_ms'=>'int'], -'RdKafka\Consumer::setLogLevel' => ['void', 'level'=>'int'], -'RdKafka\ConsumerTopic::__construct' => ['void'], -'RdKafka\ConsumerTopic::consume' => ['RdKafka\Message', 'partition'=>'int', 'timeout_ms'=>'int'], -'RdKafka\ConsumerTopic::consumeQueueStart' => ['void', 'partition'=>'int', 'offset'=>'int', 'queue'=>'RdKafka\Queue'], -'RdKafka\ConsumerTopic::consumeStart' => ['void', 'partition'=>'int', 'offset'=>'int'], -'RdKafka\ConsumerTopic::consumeStop' => ['void', 'partition'=>'int'], -'RdKafka\ConsumerTopic::getName' => ['string'], -'RdKafka\ConsumerTopic::offsetStore' => ['void', 'partition'=>'int', 'offset'=>'int'], -'RdKafka\KafkaConsumer::__construct' => ['void', 'conf'=>'RdKafka\Conf'], -'RdKafka\KafkaConsumer::assign' => ['void', 'topic_partitions='=>'RdKafka\TopicPartition[]|null'], -'RdKafka\KafkaConsumer::commit' => ['void', 'message_or_offsets='=>'RdKafka\Message|RdKafka\TopicPartition[]|null'], -'RdKafka\KafkaConsumer::commitAsync' => ['void', 'message_or_offsets='=>'RdKafka\Message|RdKafka\TopicPartition[]|null'], -'RdKafka\KafkaConsumer::consume' => ['RdKafka\Message', 'timeout_ms'=>'int'], -'RdKafka\KafkaConsumer::getAssignment' => ['RdKafka\TopicPartition[]'], -'RdKafka\KafkaConsumer::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'?RdKafka\KafkaConsumerTopic', 'timeout_ms'=>'int'], -'RdKafka\KafkaConsumer::getSubscription' => ['array'], -'RdKafka\KafkaConsumer::subscribe' => ['void', 'topics'=>'array'], -'RdKafka\KafkaConsumer::unsubscribe' => ['void'], -'RdKafka\KafkaConsumerTopic::getName' => ['string'], -'RdKafka\KafkaConsumerTopic::offsetStore' => ['void', 'partition'=>'int', 'offset'=>'int'], -'RdKafka\Message::errstr' => ['string'], -'RdKafka\Metadata::getBrokers' => ['RdKafka\Metadata\Collection'], -'RdKafka\Metadata::getOrigBrokerId' => ['int'], -'RdKafka\Metadata::getOrigBrokerName' => ['string'], -'RdKafka\Metadata::getTopics' => ['RdKafka\Metadata\Collection|RdKafka\Metadata\Topic[]'], -'RdKafka\Metadata\Collection::__construct' => ['void'], -'RdKafka\Metadata\Collection::count' => ['int'], -'RdKafka\Metadata\Collection::current' => ['mixed'], -'RdKafka\Metadata\Collection::key' => ['mixed'], -'RdKafka\Metadata\Collection::next' => ['void'], -'RdKafka\Metadata\Collection::rewind' => ['void'], -'RdKafka\Metadata\Collection::valid' => ['bool'], -'RdKafka\Metadata\Partition::getErr' => ['mixed'], -'RdKafka\Metadata\Partition::getId' => ['int'], -'RdKafka\Metadata\Partition::getIsrs' => ['mixed'], -'RdKafka\Metadata\Partition::getLeader' => ['mixed'], -'RdKafka\Metadata\Partition::getReplicas' => ['mixed'], -'RdKafka\Metadata\Topic::getErr' => ['mixed'], -'RdKafka\Metadata\Topic::getPartitions' => ['RdKafka\Metadata\Partition[]'], -'RdKafka\Metadata\Topic::getTopic' => ['string'], -'RdKafka\Producer::__construct' => ['void', 'conf='=>'?RdKafka\Conf'], -'RdKafka\Producer::addBrokers' => ['int', 'broker_list'=>'string'], -'RdKafka\Producer::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'?RdKafka\Topic', 'timeout_ms'=>'int'], -'RdKafka\Producer::getOutQLen' => ['int'], -'RdKafka\Producer::newQueue' => ['RdKafka\Queue'], -'RdKafka\Producer::newTopic' => ['RdKafka\ProducerTopic', 'topic_name'=>'string', 'topic_conf='=>'?RdKafka\TopicConf'], -'RdKafka\Producer::poll' => ['void', 'timeout_ms'=>'int'], -'RdKafka\Producer::setLogLevel' => ['void', 'level'=>'int'], -'RdKafka\ProducerTopic::__construct' => ['void'], -'RdKafka\ProducerTopic::getName' => ['string'], -'RdKafka\ProducerTopic::produce' => ['void', 'partition'=>'int', 'msgflags'=>'int', 'payload'=>'string', 'key='=>'?string'], -'RdKafka\ProducerTopic::producev' => ['void', 'partition'=>'int', 'msgflags'=>'int', 'payload'=>'string', 'key='=>'?string', 'headers='=>'?array', 'timestamp_ms='=>'?int', 'opaque='=>'?string'], -'RdKafka\Queue::__construct' => ['void'], -'RdKafka\Queue::consume' => ['?RdKafka\Message', 'timeout_ms'=>'string'], -'RdKafka\Topic::getName' => ['string'], -'RdKafka\TopicConf::dump' => ['array'], -'RdKafka\TopicConf::set' => ['void', 'name'=>'string', 'value'=>'string'], -'RdKafka\TopicConf::setPartitioner' => ['void', 'partitioner'=>'int'], -'RdKafka\TopicPartition::__construct' => ['void', 'topic'=>'string', 'partition'=>'int', 'offset='=>'int'], -'RdKafka\TopicPartition::getOffset' => ['int'], -'RdKafka\TopicPartition::getPartition' => ['int'], -'RdKafka\TopicPartition::getTopic' => ['string'], -'RdKafka\TopicPartition::setOffset' => ['void', 'offset'=>'string'], -'RdKafka\TopicPartition::setPartition' => ['void', 'partition'=>'string'], -'RdKafka\TopicPartition::setTopic' => ['void', 'topic_name'=>'string'], 'readdir' => ['string|false', 'dir_handle='=>'resource'], 'readfile' => ['int|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'resource'], 'readgzfile' => ['int|false', 'filename'=>'string', 'use_include_path='=>'int'], diff --git a/dictionaries/CallMap_historical.php b/dictionaries/CallMap_historical.php index 5ff4033af..73ce32e3d 100644 --- a/dictionaries/CallMap_historical.php +++ b/dictionaries/CallMap_historical.php @@ -5070,93 +5070,6 @@ return [ 'RarException::getTraceAsString' => ['string'], 'RarException::isUsingExceptions' => ['bool'], 'RarException::setUsingExceptions' => ['RarEntry', 'using_exceptions'=>'bool'], - 'RdKafka::addBrokers' => ['int', 'broker_list'=>'string'], - 'RdKafka::flush' => ['int', 'timeout_ms'=>'int'], - 'RdKafka::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'?RdKafka\Topic', 'timeout_ms'=>'int'], - 'RdKafka::getOutQLen' => ['int'], - 'RdKafka::newQueue' => ['RdKafka\Queue'], - 'RdKafka::newTopic' => ['RdKafka\Topic', 'topic_name'=>'string', 'topic_conf='=>'?RdKafka\TopicConf'], - 'RdKafka::poll' => ['void', 'timeout_ms'=>'int'], - 'RdKafka::setLogLevel' => ['void', 'level'=>'int'], - 'RdKafka\Conf::dump' => ['array'], - 'RdKafka\Conf::set' => ['void', 'name'=>'string', 'value'=>'string'], - 'RdKafka\Conf::setDefaultTopicConf' => ['void', 'topic_conf'=>'RdKafka\TopicConf'], - 'RdKafka\Conf::setDrMsgCb' => ['void', 'callback'=>'callable'], - 'RdKafka\Conf::setErrorCb' => ['void', 'callback'=>'callable'], - 'RdKafka\Conf::setRebalanceCb' => ['void', 'callback'=>'callable'], - 'RdKafka\Conf::setStatsCb' => ['void', 'callback'=>'callable'], - 'RdKafka\Consumer::__construct' => ['void', 'conf='=>'?RdKafka\Conf'], - 'RdKafka\Consumer::addBrokers' => ['int', 'broker_list'=>'string'], - 'RdKafka\Consumer::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'?RdKafka\Topic', 'timeout_ms'=>'int'], - 'RdKafka\Consumer::getOutQLen' => ['int'], - 'RdKafka\Consumer::newQueue' => ['RdKafka\Queue'], - 'RdKafka\Consumer::newTopic' => ['RdKafka\ConsumerTopic', 'topic_name'=>'string', 'topic_conf='=>'?RdKafka\TopicConf'], - 'RdKafka\Consumer::poll' => ['void', 'timeout_ms'=>'int'], - 'RdKafka\Consumer::setLogLevel' => ['void', 'level'=>'int'], - 'RdKafka\ConsumerTopic::__construct' => ['void'], - 'RdKafka\ConsumerTopic::consume' => ['RdKafka\Message', 'partition'=>'int', 'timeout_ms'=>'int'], - 'RdKafka\ConsumerTopic::consumeQueueStart' => ['void', 'partition'=>'int', 'offset'=>'int', 'queue'=>'RdKafka\Queue'], - 'RdKafka\ConsumerTopic::consumeStart' => ['void', 'partition'=>'int', 'offset'=>'int'], - 'RdKafka\ConsumerTopic::consumeStop' => ['void', 'partition'=>'int'], - 'RdKafka\ConsumerTopic::getName' => ['string'], - 'RdKafka\ConsumerTopic::offsetStore' => ['void', 'partition'=>'int', 'offset'=>'int'], - 'RdKafka\KafkaConsumer::__construct' => ['void', 'conf'=>'RdKafka\Conf'], - 'RdKafka\KafkaConsumer::assign' => ['void', 'topic_partitions='=>'RdKafka\TopicPartition[]|null'], - 'RdKafka\KafkaConsumer::commit' => ['void', 'message_or_offsets='=>'RdKafka\Message|RdKafka\TopicPartition[]|null'], - 'RdKafka\KafkaConsumer::commitAsync' => ['void', 'message_or_offsets='=>'RdKafka\Message|RdKafka\TopicPartition[]|null'], - 'RdKafka\KafkaConsumer::consume' => ['RdKafka\Message', 'timeout_ms'=>'int'], - 'RdKafka\KafkaConsumer::getAssignment' => ['RdKafka\TopicPartition[]'], - 'RdKafka\KafkaConsumer::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'?RdKafka\KafkaConsumerTopic', 'timeout_ms'=>'int'], - 'RdKafka\KafkaConsumer::getSubscription' => ['array'], - 'RdKafka\KafkaConsumer::subscribe' => ['void', 'topics'=>'array'], - 'RdKafka\KafkaConsumer::unsubscribe' => ['void'], - 'RdKafka\KafkaConsumerTopic::getName' => ['string'], - 'RdKafka\KafkaConsumerTopic::offsetStore' => ['void', 'partition'=>'int', 'offset'=>'int'], - 'RdKafka\Message::errstr' => ['string'], - 'RdKafka\Metadata::getBrokers' => ['RdKafka\Metadata\Collection'], - 'RdKafka\Metadata::getOrigBrokerId' => ['int'], - 'RdKafka\Metadata::getOrigBrokerName' => ['string'], - 'RdKafka\Metadata::getTopics' => ['RdKafka\Metadata\Collection|RdKafka\Metadata\Topic[]'], - 'RdKafka\Metadata\Collection::__construct' => ['void'], - 'RdKafka\Metadata\Collection::count' => ['int'], - 'RdKafka\Metadata\Collection::current' => ['mixed'], - 'RdKafka\Metadata\Collection::key' => ['mixed'], - 'RdKafka\Metadata\Collection::next' => ['void'], - 'RdKafka\Metadata\Collection::rewind' => ['void'], - 'RdKafka\Metadata\Collection::valid' => ['bool'], - 'RdKafka\Metadata\Partition::getErr' => ['mixed'], - 'RdKafka\Metadata\Partition::getId' => ['int'], - 'RdKafka\Metadata\Partition::getIsrs' => ['mixed'], - 'RdKafka\Metadata\Partition::getLeader' => ['mixed'], - 'RdKafka\Metadata\Partition::getReplicas' => ['mixed'], - 'RdKafka\Metadata\Topic::getErr' => ['mixed'], - 'RdKafka\Metadata\Topic::getPartitions' => ['RdKafka\Metadata\Partition[]'], - 'RdKafka\Metadata\Topic::getTopic' => ['string'], - 'RdKafka\Producer::__construct' => ['void', 'conf='=>'?RdKafka\Conf'], - 'RdKafka\Producer::addBrokers' => ['int', 'broker_list'=>'string'], - 'RdKafka\Producer::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'?RdKafka\Topic', 'timeout_ms'=>'int'], - 'RdKafka\Producer::getOutQLen' => ['int'], - 'RdKafka\Producer::newQueue' => ['RdKafka\Queue'], - 'RdKafka\Producer::newTopic' => ['RdKafka\ProducerTopic', 'topic_name'=>'string', 'topic_conf='=>'?RdKafka\TopicConf'], - 'RdKafka\Producer::poll' => ['void', 'timeout_ms'=>'int'], - 'RdKafka\Producer::setLogLevel' => ['void', 'level'=>'int'], - 'RdKafka\ProducerTopic::__construct' => ['void'], - 'RdKafka\ProducerTopic::getName' => ['string'], - 'RdKafka\ProducerTopic::produce' => ['void', 'partition'=>'int', 'msgflags'=>'int', 'payload'=>'string', 'key='=>'?string'], - 'RdKafka\ProducerTopic::producev' => ['void', 'partition'=>'int', 'msgflags'=>'int', 'payload'=>'string', 'key='=>'?string', 'headers='=>'?array', 'timestamp_ms='=>'?int', 'opaque='=>'?string'], - 'RdKafka\Queue::__construct' => ['void'], - 'RdKafka\Queue::consume' => ['?RdKafka\Message', 'timeout_ms'=>'string'], - 'RdKafka\Topic::getName' => ['string'], - 'RdKafka\TopicConf::dump' => ['array'], - 'RdKafka\TopicConf::set' => ['void', 'name'=>'string', 'value'=>'string'], - 'RdKafka\TopicConf::setPartitioner' => ['void', 'partitioner'=>'int'], - 'RdKafka\TopicPartition::__construct' => ['void', 'topic'=>'string', 'partition'=>'int', 'offset='=>'int'], - 'RdKafka\TopicPartition::getOffset' => ['int'], - 'RdKafka\TopicPartition::getPartition' => ['int'], - 'RdKafka\TopicPartition::getTopic' => ['string'], - 'RdKafka\TopicPartition::setOffset' => ['void', 'offset'=>'string'], - 'RdKafka\TopicPartition::setPartition' => ['void', 'partition'=>'string'], - 'RdKafka\TopicPartition::setTopic' => ['void', 'topic_name'=>'string'], 'RecursiveArrayIterator::__construct' => ['void', 'array='=>'array|object', 'flags='=>'int'], 'RecursiveArrayIterator::append' => ['void', 'value'=>'mixed'], 'RecursiveArrayIterator::asort' => ['true', 'flags='=>'int'], @@ -13778,10 +13691,6 @@ return [ 'rar_wrapper_cache_stats' => ['string'], 'rawurldecode' => ['string', 'string'=>'string'], 'rawurlencode' => ['string', 'string'=>'string'], - 'rd_kafka_err2str' => ['string', 'err'=>'int'], - 'rd_kafka_errno' => ['int'], - 'rd_kafka_errno2err' => ['int', 'errnox'=>'int'], - 'rd_kafka_offset_tail' => ['int', 'cnt'=>'int'], 'read_exif_data' => ['array', 'filename'=>'string', 'sections_needed='=>'string', 'sub_arrays='=>'bool', 'read_thumbnail='=>'bool'], 'readdir' => ['string|false', 'dir_handle='=>'resource'], 'readfile' => ['int|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'resource'], diff --git a/src/Psalm/Config.php b/src/Psalm/Config.php index 0eaa9f837..c2a544773 100644 --- a/src/Psalm/Config.php +++ b/src/Psalm/Config.php @@ -631,6 +631,7 @@ class Config "mysqli" => null, "pdo" => null, "random" => null, + "rdkafka" => null, "redis" => null, "simplexml" => null, "soap" => null, diff --git a/stubs/extensions/rdkafka.phpstub b/stubs/extensions/rdkafka.phpstub new file mode 100644 index 000000000..af8c3a76e --- /dev/null +++ b/stubs/extensions/rdkafka.phpstub @@ -0,0 +1,1195 @@ + + */ + public function dump() + { + } + + /** + * @param string $name + * @param string $value + * + * @return void + */ + public function set($name, $value) + { + } + + /** + * @param TopicConf $topic_conf + * + * @return void + * @deprecated Set default topic settings normally like global configuration settings. + * + */ + public function setDefaultTopicConf(TopicConf $topic_conf) + { + } + + /** + * @param callable $callback + * + * @return void + */ + public function setDrMsgCb(callable $callback) + { + } + + /** + * @param callable $callback + * + * @return void + */ + public function setErrorCb(callable $callback) + { + } + + /** + * @param callable $callback + * + * @return void + */ + public function setRebalanceCb(callable $callback) + { + } + + /** + * @param callable $callback + * + * @return void + */ + public function setStatsCb(callable $callback) + { + } + + /** + * @param callable $callback + * + * @return void + */ + public function setConsumeCb(callable $callback) + { + } + + /** + * @param callable $callback + * + * @return void + */ + public function setOffsetCommitCb(callable $callback) + { + } + + /** + * @param callable $callback + * + * @return void + */ + public function setLogCb(callable $callback) + { + } + } + + class Consumer extends \RdKafka + { + /** + * @param Conf $conf + */ + public function __construct(Conf $conf = null) + { + } + + /** + * @param string $topic_name + * @param TopicConf $topic_conf + * + * @return ConsumerTopic + */ + public function newTopic($topic_name, TopicConf $topic_conf = null) + { + } + + /** + * @return Queue + */ + public function newQueue() + { + } + } + + class ConsumerTopic extends Topic + { + private function __construct() + { + } + + /** + * @param int $partition + * @param int $timeout_ms + * + * @return Message|null + */ + public function consume($partition, $timeout_ms) + { + } + + /** + * @param int $partition + * @param int $offset + * @param Queue $queue + * + * @return void + */ + public function consumeQueueStart($partition, $offset, Queue $queue) + { + } + + /** + * @param int $partition + * @param int $offset + * + * @return void + */ + public function consumeStart($partition, $offset) + { + } + + /** + * @param int $partition + * + * @return void + */ + public function consumeStop($partition) + { + } + + /** + * @param int $partition + * @param int $offset + * + * @return void + */ + public function offsetStore($partition, $offset) + { + } + + /** + * @param int $partition + * @param int $timeout_ms + * @param int $batch_size + * + * @return array + * @throws \InvalidArgumentException + * @throws Exception + */ + public function consumeBatch($partition, $timeout_ms, $batch_size) + { + } + + /** + * @param int $partition + * @param int $timeout_ms + * @param callable $callback + * + * @return void + */ + public function consumeCallback($partition, $timeout_ms, callable $callback) + { + } + } + + class Exception extends \Exception + { + } + + class KafkaConsumer + { + /** + * @param Conf $conf + */ + public function __construct(Conf $conf) + { + } + + /** + * @param TopicPartition[] $topic_partitions + * + * @return void + * @throws Exception + */ + public function assign($topic_partitions = null) + { + } + + /** + * @param null|Message|TopicPartition[] $message_or_offsets + * + * @return void + * @throws Exception + */ + public function commit($message_or_offsets = null) + { + } + + /** + * @param string $message_or_offsets + * + * @return void + * @throws Exception + */ + public function commitAsync($message_or_offsets = null) + { + } + + /** + * @param int $timeout_ms + * + * @return Message + * @throws \InvalidArgumentException + * @throws Exception + */ + public function consume($timeout_ms) + { + } + + /** + * @return TopicPartition[] + * @throws Exception + */ + public function getAssignment() + { + } + + /** + * @param bool $all_topics + * @param KafkaConsumerTopic|null $only_topic + * @param int $timeout_ms + * + * @return Metadata + * @throws Exception + */ + public function getMetadata($all_topics, $only_topic, $timeout_ms) + { + } + + /** + * @return array + */ + public function getSubscription() + { + } + + /** + * @param string $topic_name + * @param TopicConf $topic_conf + * + * @return KafkaConsumerTopic + */ + public function newTopic($topic_name, TopicConf $topic_conf = null) + { + } + + /** + * @param array $topics + * + * @return void + * @throws Exception + */ + public function subscribe($topics) + { + } + + /** + * @return void + * @throws Exception + */ + public function unsubscribe() + { + } + + /** + * @param TopicPartition[] $topicPartitions + * @param int $timeout_ms Timeout in milliseconds + * + * @return TopicPartition[] + * @throws Exception + */ + public function getCommittedOffsets($topicPartitions, $timeout_ms) + { + } + + /** + * @param array $topicPartitions + * @param int $timeout_ms + * @return array + */ + public function offsetsForTimes($topicPartitions, $timeout_ms) + { + } + + /** + * @param string $topic + * @param int $partition + * @param int $low + * @param int $high + * @param int $timeout_ms + */ + public function queryWatermarkOffsets($topic, $partition, &$low, &$high, $timeout_ms) + { + } + + /** + * @param array $topics + * + * @return array + * @throws Exception + */ + public function getOffsetPositions($topics) + { + } + + /** + * @return void + */ + public function close() + { + } + + /** + * @param TopicPartition[] $topic_partitions + * @return TopicPartition[] + */ + public function pausePartitions($topic_partitions) + { + } + + /** + * @param TopicPartition[] $topic_partitions + * @return TopicPartition[] + */ + public function resumePartitions($topic_partitions) + { + } + } + + class KafkaConsumerTopic extends Topic + { + /** + * @param int $partition + * @param int $offset + * + * @return void + */ + public function offsetStore($partition, $offset) + { + } + } + + class KafkaErrorException extends \Exception + { + /** + * @param string $message + * @param int $code + * @param string $errorString + * @param boolean $isFatal + * @param boolean $isRetriable + * @param boolean $transactionRequiresAbort + */ + public function __construct($message, $code, $errorString, $isFatal, $isRetriable, $transactionRequiresAbort) + { + parent::__construct($message, $code); + } + + /** + * @returns string + */ + public function getErrorString() + { + } + + /** + * @returns boolean + */ + public function isFatal() + { + } + + /** + * @returns boolean + */ + public function isRetriable() + { + } + + /** + * @returns boolean + */ + public function transactionRequiresAbort() + { + } + } + + class Message + { + /** + * @var int + */ + public $err; + + /** + * @var string + */ + public $topic_name; + + /** + * @var int + */ + public $partition; + + /** + * @var string|null + */ + public $payload; + + /** + * @var int|null + */ + public $len; + + /** + * @var string|null + */ + public $key; + + /** + * @var int + */ + public $offset; + + /** + * @var int + */ + public $timestamp; + + /** + * @var array|null + */ + public $headers; + + /** + * @var string|null + */ + public $opaque; + + /** + * @return string + */ + public function errstr() + { + } + } + + class Metadata + { + /** + * @return \RdKafka\Metadata\Collection|\RdKafka\Metadata\Broker[] + */ + public function getBrokers() + { + } + + /** + * @return \RdKafka\Metadata\Collection|\RdKafka\Metadata\Topic[] + */ + public function getTopics() + { + } + + /** + * @return int + */ + public function getOrigBrokerId() + { + } + + /** + * @return string + */ + public function getOrigBrokerName() + { + } + } + + class Producer extends \RdKafka + { + /** + * @param Conf $conf + */ + public function __construct(Conf $conf = null) + { + } + + /** + * @param string $topic_name + * @param TopicConf $topic_conf + * + * @return ProducerTopic + */ + public function newTopic($topic_name, TopicConf $topic_conf = null) + { + } + + /** + * @param int $timeoutMs + * + * @return void + * @throws KafkaErrorException + */ + public function initTransactions(int $timeoutMs) + { + } + + /** + * @return void + * @throws KafkaErrorException + */ + public function beginTransaction() + { + } + + /** + * @param int $timeoutMs + * + * @return void + * @throws KafkaErrorException + */ + public function commitTransaction(int $timeoutMs) + { + } + + /** + * @param int $timeoutMs + * + * @return void + * @throws KafkaErrorException + */ + public function abortTransaction(int $timeoutMs) + { + } + } + + class ProducerTopic extends Topic + { + private function __construct() + { + } + + /** + * @param int $partition + * @param int $msgflags + * @param string $payload + * @param string $key + * + * @return void + * @throws Exception + */ + public function produce($partition, $msgflags, $payload, $key = null) + { + } + + /** + * @param int $partition + * @param int $msgflags + * @param string $payload + * @param string|null $key + * @param array|null $headers + * @param int $timestamp_ms + * + * @throws Exception + */ + public function producev($partition, $msgflags, $payload, $key = null, $headers = null, $timestamp_ms = null) + { + } + } + + class Queue + { + private function __construct() + { + } + + /** + * @param string $timeout_ms + * + * @return Message|null + */ + public function consume($timeout_ms) + { + } + } + + abstract class Topic + { + /** + * @return string + */ + public function getName() + { + } + } + + /** + * Configuration reference: https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md + */ + class TopicConf + { + /** + * @return array + */ + public function dump() + { + } + + /** + * @param string $name + * @param string $value + * + * @return void + */ + public function set($name, $value) + { + } + + /** + * @param int $partitioner + * + * @return void + */ + public function setPartitioner($partitioner) + { + } + } + + class TopicPartition + { + /** + * @param string $topic + * @param int $partition + * @param int $offset + */ + public function __construct($topic, $partition, $offset = null) + { + } + + /** + * @return int + */ + public function getOffset() + { + } + + /** + * @return int + */ + public function getPartition() + { + } + + /** + * @return string + */ + public function getTopic() + { + } + + /** + * @param int $offset + * + * @return void + */ + public function setOffset($offset) + { + } + + /** + * @param int $partition + * + * @return void + */ + public function setPartition($partition) + { + } + + /** + * @param string $topic_name + * + * @return void + */ + public function setTopic($topic_name) + { + } + } +} + +namespace RdKafka\Metadata { + + class Broker + { + /** + * @return int + */ + public function getId() + { + } + + /** + * @return string + */ + public function getHost() + { + } + + /** + * @return int + */ + public function getPort() + { + } + } + + class Collection implements \Iterator, \Countable + { + /** + * @return mixed + */ + public function current() + { + } + + /** + * @return void + */ + public function next() + { + } + + /** + * @return mixed + */ + public function key() + { + } + + /** + * @return boolean + */ + public function valid() + { + } + + /** + * @return void + */ + public function rewind() + { + } + + /** + * @return int + */ + public function count() + { + } + } + + class Partition + { + /** + * @return int + */ + public function getId() + { + } + + /** + * @return mixed + */ + public function getErr() + { + } + + /** + * @return mixed + */ + public function getLeader() + { + } + + /** + * @return mixed + */ + public function getReplicas() + { + } + + /** + * @return mixed + */ + public function getIsrs() + { + } + } + + class Topic + { + /** + * @return string + */ + public function getTopic() + { + } + + /** + * @return Partition[] + */ + public function getPartitions() + { + } + + /** + * @return mixed + */ + public function getErr() + { + } + } +} \ No newline at end of file