diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 225a4bfb..76cd14fe 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,14 +13,6 @@ jobs: os: - ubuntu-latest php: - - "5.5" - - "5.6" - - "7.0" - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - "8.0" - "8.1" - "8.2" steps: diff --git a/psalm.xml b/psalm.xml index d0e78e7a..4cfcea27 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,7 +1,7 @@ token = $token; $this->endpoint = ($endpoint ?: self::URL_PREFIX) . $token; $this->fileEndpoint = $endpoint ? null : (self::FILE_URL_PREFIX . $token); $this->httpClient = $httpClient ?: new CurlHttpClient(); - - if ($trackerToken) { - @trigger_error(sprintf('Passing $trackerToken to %s is deprecated', self::class), \E_USER_DEPRECATED); - $this->tracker = new Botan($trackerToken); - } } /** @@ -643,12 +619,6 @@ public function getUpdates($offset = 0, $limit = 100, $timeout = 0) 'timeout' => $timeout, ])); - if ($this->tracker instanceof Botan) { - foreach ($updates as $update) { - $this->trackUpdate($update); - } - } - return $updates; } @@ -1804,56 +1774,6 @@ public function deleteMessage($chatId, $messageId) ]); } - /** - * @deprecated - * - * @param Update $update - * @param string $eventName - * - * @throws Exception - * - * @return void - */ - public function trackUpdate(Update $update, $eventName = 'Message') - { - @trigger_error(sprintf('Method "%s::%s" is deprecated', __CLASS__, __METHOD__), \E_USER_DEPRECATED); - - if (!in_array($update->getUpdateId(), $this->trackedEvents)) { - $message = $update->getMessage(); - if (!$message) { - return; - } - $this->trackedEvents[] = $update->getUpdateId(); - - $this->track($message, $eventName); - - if (count($this->trackedEvents) > self::MAX_TRACKED_EVENTS) { - $this->trackedEvents = array_slice($this->trackedEvents, (int) round(self::MAX_TRACKED_EVENTS / 4)); - } - } - } - - /** - * @deprecated - * - * Wrapper for tracker - * - * @param Message $message - * @param string $eventName - * - * @throws Exception - * - * @return void - */ - public function track(Message $message, $eventName = 'Message') - { - @trigger_error(sprintf('Method "%s::%s" is deprecated', __CLASS__, __METHOD__), \E_USER_DEPRECATED); - - if ($this->tracker instanceof Botan) { - $this->tracker->track($message, $eventName); - } - } - /** * Use this method to send invoices. On success, the sent Message is returned. * diff --git a/src/Client.php b/src/Client.php index c81abd68..64522f1d 100644 --- a/src/Client.php +++ b/src/Client.php @@ -40,17 +40,13 @@ class Client * Client constructor * * @param string $token Telegram Bot API token - * @param string|null $trackerToken Yandex AppMetrica application api_key * @param HttpClientInterface|null $httpClient * @param string|null $endpoint */ - public function __construct($token, $trackerToken = null, HttpClientInterface $httpClient = null, $endpoint = null) + public function __construct($token, HttpClientInterface $httpClient = null, $endpoint = null) { - if ($trackerToken) { - @trigger_error(sprintf('Passing $trackerToken to %s is deprecated', self::class), \E_USER_DEPRECATED); - } - $this->api = new BotApi($token, $trackerToken, $httpClient, $endpoint); - $this->events = new EventCollection($trackerToken); + $this->api = new BotApi($token , $httpClient, $endpoint); + $this->events = new EventCollection(); } /** diff --git a/src/Types/UserChatBoosts.php b/src/Types/UserChatBoosts.php index 776fc757..5543b587 100644 --- a/src/Types/UserChatBoosts.php +++ b/src/Types/UserChatBoosts.php @@ -47,7 +47,7 @@ public function getBoosts() /** * @param ArrayOfChatBoost $boosts */ - public function setBoosts($boosts) + public function setBoosts($boosts): void { $this->boosts = $boosts; }