Skip to content

Commit 664374b

Browse files
committed
style: fix code style checks
1 parent dbe56f2 commit 664374b

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

pkg/rdkafka/RdKafkaProducer.php

+1-18
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function send(Destination $destination, Message $message): void
3737
InvalidDestinationException::assertDestinationInstanceOf($destination, RdKafkaTopic::class);
3838
InvalidMessageException::assertMessageInstanceOf($message, RdKafkaMessage::class);
3939

40-
$partition = $this->getPartition($destination, $message);
40+
$partition = $message->getPartition() ?? $destination->getPartition() ?? RD_KAFKA_PARTITION_UA;
4141
$payload = $this->serializer->toString($message);
4242
$key = $message->getKey() ?? $destination->getKey() ?? null;
4343

@@ -122,21 +122,4 @@ public function flush(int $timeout): void
122122
$this->producer->flush($timeout);
123123
}
124124
}
125-
126-
/**
127-
* @param RdKafkaTopic $destination
128-
* @param RdKafkaMessage $message
129-
*/
130-
private function getPartition(Destination $destination, Message $message): int
131-
{
132-
if (null !== $message->getPartition()) {
133-
return $message->getPartition();
134-
}
135-
136-
if (null !== $destination->getPartition()) {
137-
return $destination->getPartition();
138-
}
139-
140-
return \RD_KAFKA_PARTITION_UA;
141-
}
142125
}

0 commit comments

Comments
 (0)