Skip to content

Commit

Permalink
Deprecate request callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorprogger committed Sep 15, 2024
1 parent 6cb1703 commit e7f71ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Telegram Client Change Log

## 1.0.0 under development
## 1.0.1

- Client request callbacks are now deprecated and will be removed in version 2.0

## 1.0.0

- Initial release.
8 changes: 8 additions & 0 deletions src/Request/TelegramRequestInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public function getData(): array;
public function getFiles(): array;

/**
* @deprecated Will be removed in 2.0
*
* Sets a callback which will be called when the request is successfully finished
* Callback must have a such signature: function(
* \Psr\Http\Message\ResponseInterface $response, // Telegram API response
Expand All @@ -44,6 +46,8 @@ public function getFiles(): array;
public function onSuccess(?callable $callback): self;

/**
* @deprecated Will be removed in 2.0
*
* Returns success callback if it was set
*
* @psalm-pure
Expand All @@ -53,6 +57,8 @@ public function onSuccess(?callable $callback): self;
public function getSuccessCallback(): ?callable;

/**
* @deprecated Will be removed in 2.0
*
* Sets a callback which will be called when the request is finished with an error
* Callback must have a such signature: function(
* \Psr\Http\Message\ResponseInterface $response, // Telegram API response
Expand All @@ -68,6 +74,8 @@ public function getSuccessCallback(): ?callable;
public function onError(?callable $callback): self;

/**
* @deprecated Will be removed in 2.0
*
* Returns error callback if it was set
*
* @psalm-pure
Expand Down

0 comments on commit e7f71ce

Please sign in to comment.