From 1a3ae0d2379b39e20fb37ec7cb2665595d554742 Mon Sep 17 00:00:00 2001 From: Gabriele Grillo Date: Mon, 2 Oct 2017 12:50:38 +0000 Subject: [PATCH] Apply fixes from StyleCI --- Telegram.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Telegram.php b/Telegram.php index b5519af..dc56140 100644 --- a/Telegram.php +++ b/Telegram.php @@ -256,7 +256,7 @@ public function forwardMessage(array $content) * Integer * Optional * If the message is a reply, ID of the original message - * + * * * disable_notification * Boolean @@ -1454,7 +1454,7 @@ public function Text() if ($type == self::CHANNEL_POST) { return @$this->data['channel_post']['text']; } - if ($type == self::EDITED_MESSAGE) { + if ($type == self::EDITED_MESSAGE) { return @$this->data['edited_message']['text']; } @@ -1480,9 +1480,10 @@ public function ChatID() if ($type == self::CHANNEL_POST) { return @$this->data['channel_post']['chat']['id']; } - if ($type == self::EDITED_MESSAGE) { + if ($type == self::EDITED_MESSAGE) { return @$this->data['edited_message']['chat']['id']; } + return $this->data['message']['chat']['id']; } @@ -1500,7 +1501,7 @@ public function MessageID() if ($type == self::CHANNEL_POST) { return @$this->data['channel_post']['message_id']; } - if ($type == self::EDITED_MESSAGE) { + if ($type == self::EDITED_MESSAGE) { return @$this->data['edited_message']['message_id']; } @@ -1609,7 +1610,7 @@ public function FirstName() if ($type == self::CHANNEL_POST) { return @$this->data['channel_post']['from']['first_name']; } - if ($type == self::EDITED_MESSAGE) { + if ($type == self::EDITED_MESSAGE) { return @$this->data['edited_message']['from']['first_name']; } @@ -1626,7 +1627,7 @@ public function LastName() if ($type == self::CHANNEL_POST) { return @$this->data['channel_post']['from']['last_name']; } - if ($type == self::EDITED_MESSAGE) { + if ($type == self::EDITED_MESSAGE) { return @$this->data['edited_message']['from']['last_name']; } @@ -1643,7 +1644,7 @@ public function Username() if ($type == self::CHANNEL_POST) { return @$this->data['channel_post']['from']['username']; } - if ($type == self::EDITED_MESSAGE) { + if ($type == self::EDITED_MESSAGE) { return @$this->data['edited_message']['from']['username']; } @@ -1678,7 +1679,7 @@ public function UserID() if ($type == self::CHANNEL_POST) { return $this->data['channel_post']['from']['id']; } - if ($type == self::EDITED_MESSAGE) { + if ($type == self::EDITED_MESSAGE) { return @$this->data['edited_message']['from']['id']; } @@ -2844,7 +2845,7 @@ private function sendAPIRequest($url, array $content, $post = true) } curl_close($ch); if (class_exists('TelegramErrorLogger')) { - $loggerArray = ($this->getData() == null) ? [$content] : [$this->getData(), $content]; + $loggerArray = ($this->getData() == null) ? [$content] : [$this->getData(), $content]; TelegramErrorLogger::log(json_decode($result, true), $loggerArray); }