Skip to content

Commit d29de8a

Browse files
authored
feat: create more ergonomic factory (#16)
feat: create more ergonomic factory docs: apply new factory to docs
1 parent b28f2b3 commit d29de8a

File tree

6 files changed

+357
-2514
lines changed

6 files changed

+357
-2514
lines changed

.github/README.template.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ composer require cedricziel/baserow
1212
use CedricZiel\Baserow\Client;
1313

1414
$token = 'my-token';
15-
$authRegistry = new AuthenticationRegistry([
16-
new DatabaseTokenAuthentication($token),
17-
]);
18-
19-
$client = Client::create(null, [
20-
new AddHostPlugin(new Uri('https://baserow.example.com')),
21-
$authRegistry,
22-
]);
15+
$client = Client::createForUrl('https://baserow.example.com', accessToken: $token);
2316

2417
// list all rows in table id 42
2518
$client->listDatabaseTableRows(42);

.regen-docs.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,7 @@ function underscoreToCamelCase($string, $capitalizeFirstCharacter = false)
3131
$doc .= '```php'."\n";
3232
$doc .= <<<EOF
3333
\$token = 'my-token';
34-
\$authRegistry = new AuthenticationRegistry([
35-
new DatabaseTokenAuthentication(\$token),
36-
]);
37-
38-
\$client = \CedricZiel\Baserow\Client::create(null, [
39-
new AddHostPlugin(new Uri('https://baserow.example.com')),
40-
\$authRegistry,
41-
]);
34+
\$client = Client::createForUrl('https://baserow.example.com', accessToken: \$token);
4235
4336
EOF;
4437
$doc .= '$client->'."{$methodName}();\n";

0 commit comments

Comments
 (0)