Skip to content

Commit 0fab411

Browse files
committed
chore: fix incorrect examples
1 parent 93b3d93 commit 0fab411

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ use Http\Client\Curl\Client;
5151
use Nyholm\Psr7\Factory\Psr17Factory;
5252
use SimPod\ClickHouseClient\Client\PsrClickHouseClient;
5353
use SimPod\ClickHouseClient\Client\Http\RequestFactory;
54+
use SimPod\ClickHouseClient\Param\ParamValueConverterRegistry;
5455

5556
$psr17Factory = new Psr17Factory;
5657

5758
$clickHouseClient = new PsrClickHouseClient(
5859
new Client(),
5960
new RequestFactory(
61+
new ParamValueConverterRegistry(),
6062
$psr17Factory,
6163
$psr17Factory
6264
),
@@ -250,6 +252,7 @@ provide a converter for a type that the library does not (yet) support, pass the
250252
```php
251253
<?php
252254
255+
use SimPod\ClickHouseClient\Client\Http\RequestFactory;
253256
use SimPod\ClickHouseClient\Client\PsrClickHouseClient;
254257
use SimPod\ClickHouseClient\Exception\UnsupportedParamValue;
255258
use SimPod\ClickHouseClient\Param\ParamValueConverterRegistry;
@@ -258,7 +261,7 @@ $paramValueConverterRegistry = new ParamValueConverterRegistry([
258261
'datetime' => static fn (mixed $v) => $v instanceof DateTimeInterface ? $v->format('c') : throw UnsupportedParamValue::type($value)
259262
]);
260263
261-
$client = new PsrClickHouseClient($paramValueConverterRegistry, ...);
264+
$client = new PsrClickHouseClient(..., new RequestFactory($paramValueConverterRegistry, ...));
262265
```
263266

264267
Be aware that the library can not ensure that passed values have a certain type. They are passed as-is and closures must accept `mixed` values.

0 commit comments

Comments
 (0)