Skip to content

Commit

Permalink
chore: fix cs in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dirx committed Oct 28, 2024
1 parent 02821b0 commit 443ab7c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/consumer-lowlevel.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function (Consumer $consumer, int $level, string $facility, string $message): vo
}
);

$conf->set('statistics.interval.ms', (string)1000);
$conf->set('statistics.interval.ms', (string) 1000);
$conf->setStatsCb(
function (Consumer $consumer, string $json, int $jsonLength, $opaque): void {
echo "stats: ${json}" . PHP_EOL;
Expand All @@ -29,7 +29,7 @@ function (Consumer $consumer, string $json, int $jsonLength, $opaque): void {

$topicConf = new TopicConf();
$topicConf->set('enable.auto.commit', 'true');
$topicConf->set('auto.commit.interval.ms', (string)100);
$topicConf->set('auto.commit.interval.ms', (string) 100);
$topicConf->set('auto.offset.reset', 'earliest');
var_dump($topicConf->dump());

Expand Down
8 changes: 4 additions & 4 deletions examples/create-topic.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@
$conf = new Conf();
$conf->set('bootstrap.servers', $options['b']);
$client = Client::fromConf($conf);
$client->setWaitForResultEventTimeout((int)$options['w']);
$client->setWaitForResultEventTimeout((int) $options['w']);
$partitions = $options['p'];
$replicationFactor = $options['r'];

$results = $client->createTopics(
[
new NewTopic(
(string)$options['t'],
(int)$partitions,
(int)$replicationFactor
(string) $options['t'],
(int) $partitions,
(int) $replicationFactor
),
]
);
Expand Down
4 changes: 2 additions & 2 deletions examples/delete-topic.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
$conf = new Conf();
$conf->set('bootstrap.servers', $options['b']);
$client = Client::fromConf($conf);
$client->setWaitForResultEventTimeout((int)$options['w']);
$client->setWaitForResultEventTimeout((int) $options['w']);

$results = $client->deleteTopics(
[
new DeleteTopic(
(string)$options['t']
(string) $options['t']
),
]
);
Expand Down
2 changes: 1 addition & 1 deletion examples/describe-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

$results = $client->describeConfigs(
[
new ConfigResource((int)$options['t'], (string)$options['v']),
new ConfigResource((int) $options['t'], (string) $options['v']),
]
);

Expand Down
1 change: 0 additions & 1 deletion examples/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
declare(strict_types=1);

use RdKafka\Conf;
use RdKafka\FFI\Library;
use RdKafka\Producer;

require_once dirname(__DIR__) . '/vendor/autoload.php';
Expand Down

0 comments on commit 443ab7c

Please sign in to comment.