diff --git a/src/AmoCRM/Client/AmoCRMApiRequest.php b/src/AmoCRM/Client/AmoCRMApiRequest.php index 22996f9..7c6d037 100644 --- a/src/AmoCRM/Client/AmoCRMApiRequest.php +++ b/src/AmoCRM/Client/AmoCRMApiRequest.php @@ -136,11 +136,6 @@ public function __construct( }; } - public function getRefreshAccessTokenCallback(): callable - { - return $this->refreshAccessTokenCallback; - } - public function setRefreshAccessTokenCallback(callable $callback): void { $this->refreshAccessTokenCallback = $callback; @@ -156,7 +151,7 @@ private function refreshAccessToken(): void throw new AmoCRMoAuthApiException('Can not update LongLivedAccessToken'); } - $newAccessToken = $this->getRefreshAccessTokenCallback(); + $newAccessToken = ($this->refreshAccessTokenCallback)(); $this->accessToken = $newAccessToken; }