From 47cf69ded1307c70c26a57673caa861e59dc82b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Podlipsk=C3=BD?= Date: Tue, 19 May 2020 16:13:25 +0200 Subject: [PATCH] Fix RdKafka maps (#3404) Resolves #3388 --- src/Psalm/Internal/CallMap.php | 8 ++++---- src/Psalm/Internal/PropertyMap.php | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Psalm/Internal/CallMap.php b/src/Psalm/Internal/CallMap.php index d20bd17df..c70e25813 100644 --- a/src/Psalm/Internal/CallMap.php +++ b/src/Psalm/Internal/CallMap.php @@ -10433,7 +10433,7 @@ return [ '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::dump' => ['array'], 'RdKafka\Conf::set' => ['void', 'name'=>'string', 'value'=>'string'], 'RdKafka\Conf::setDefaultTopicConf' => ['void', 'topic_conf'=>'RdKafka\TopicConf'], 'RdKafka\Conf::setDrMsgCb' => ['void', 'callback'=>'callable'], @@ -10456,10 +10456,10 @@ return [ '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[]'], +'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='=>'string'], -'RdKafka\KafkaConsumer::consume' => ['RdKafka\Message', 'timeout_ms'=>'string'], +'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'], @@ -10501,7 +10501,7 @@ return [ 'RdKafka\Queue::__construct' => ['void'], 'RdKafka\Queue::consume' => ['?RdKafka\Message', 'timeout_ms'=>'string'], 'RdKafka\Topic::getName' => ['string'], -'RdKafka\TopicConf::dump' => ['array'], +'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'], diff --git a/src/Psalm/Internal/PropertyMap.php b/src/Psalm/Internal/PropertyMap.php index 0893966bf..46b91df25 100644 --- a/src/Psalm/Internal/PropertyMap.php +++ b/src/Psalm/Internal/PropertyMap.php @@ -509,4 +509,14 @@ return [ 'phpparser\\node\\stmt\\interface_' => [ 'stmts' => 'array', ], + 'rdkafka\\message' => [ + 'err' => 'int', + 'topic_name' => 'string', + 'partition' => 'int', + 'payload' => 'string', + 'key' => 'string|null', + 'offset' => 'int', + 'timestamp' => 'int', + 'headers' => 'array|null', + ], ];