Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit fa5cd05

Browse files
committed
set credentials from core builder
fix example
1 parent 6b6392b commit fa5cd05

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

examples/core/oauth-examp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static function (\Bitrix24\SDK\Events\AuthTokenRenewedEvent $event) {
4444
}
4545
);
4646

47-
$app = new \Bitrix24\SDK\Services\Main($apiClient, $ed, $log);
47+
$app = (new \Bitrix24\SDK\Core\CoreBuilder())->withCredentials($credentials)->withApiClient($apiClient)->build();
4848

4949
$log->debug('================================');
5050

src/Core/CoreBuilder.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ public function __construct()
5050
$this->apiLevelErrorHandler = new ApiLevelErrorHandler($this->logger);
5151
}
5252

53+
/**
54+
* @param Credentials $credentials
55+
*
56+
* @return $this
57+
*/
58+
public function withCredentials(Credentials $credentials): self
59+
{
60+
$this->credentials = $credentials;
61+
return $this;
62+
}
63+
5364
/**
5465
* @param string $webhookUrl
5566
*

0 commit comments

Comments
 (0)