Skip to content

Commit

Permalink
docs: apply new factory to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricziel committed Aug 5, 2024
1 parent 55c5abf commit d18dc58
Show file tree
Hide file tree
Showing 6 changed files with 330 additions and 2,519 deletions.
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

0 comments on commit d18dc58

Please sign in to comment.