Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create more ergonomic factory #16

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .github/README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@ composer require cedricziel/baserow
use CedricZiel\Baserow\Client;

$token = 'my-token';
$authRegistry = new AuthenticationRegistry([
new DatabaseTokenAuthentication($token),
]);

$client = Client::create(null, [
new AddHostPlugin(new Uri('https://baserow.example.com')),
$authRegistry,
]);
$client = Client::createForUrl('https://baserow.example.com', accessToken: $token);

// list all rows in table id 42
$client->listDatabaseTableRows(42);
Expand Down
9 changes: 1 addition & 8 deletions .regen-docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ function underscoreToCamelCase($string, $capitalizeFirstCharacter = false)
$doc .= '```php'."\n";
$doc .= <<<EOF
\$token = 'my-token';
\$authRegistry = new AuthenticationRegistry([
new DatabaseTokenAuthentication(\$token),
]);
\$client = \CedricZiel\Baserow\Client::create(null, [
new AddHostPlugin(new Uri('https://baserow.example.com')),
\$authRegistry,
]);
\$client = Client::createForUrl('https://baserow.example.com', accessToken: \$token);
EOF;
$doc .= '$client->'."{$methodName}();\n";
Expand Down
Loading