Commit a7498388 authored by MBoretto's avatar MBoretto

fix phpcs

parent e797f65a
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Entities; namespace Longman\TelegramBot\Entities;
use Longman\TelegramBot\Exception\TelegramException; use Longman\TelegramBot\Exception\TelegramException;
...@@ -103,7 +104,7 @@ class Message extends Entity ...@@ -103,7 +104,7 @@ class Message extends Entity
$this->reply_to_message = isset($data['reply_to_message']) ? $data['reply_to_message'] : null; $this->reply_to_message = isset($data['reply_to_message']) ? $data['reply_to_message'] : null;
if (!empty($this->reply_to_message)) { if (!empty($this->reply_to_message)) {
$this->reply_to_message = new Message($this->reply_to_message); $this->reply_to_message = new self($this->reply_to_message);
} }
$this->new_chat_participant = isset($data['new_chat_participant']) ? $data['new_chat_participant'] : null; $this->new_chat_participant = isset($data['new_chat_participant']) ? $data['new_chat_participant'] : null;
...@@ -132,9 +133,6 @@ class Message extends Entity ...@@ -132,9 +133,6 @@ class Message extends Entity
if ($this->group_chat_created) { if ($this->group_chat_created) {
$this->type = 'group_chat_created'; $this->type = 'group_chat_created';
} }
} }
//return the entire command like /echo or /echo@bot1 if specified //return the entire command like /echo or /echo@bot1 if specified
...@@ -142,8 +140,8 @@ class Message extends Entity ...@@ -142,8 +140,8 @@ class Message extends Entity
{ {
if (substr($this->text, 0, 1) === '/') { if (substr($this->text, 0, 1) === '/') {
return strtok($this->text, ' '); return strtok($this->text, ' ');
}else{ } else {
return null; return;
} }
} }
...@@ -176,73 +174,61 @@ class Message extends Entity ...@@ -176,73 +174,61 @@ class Message extends Entity
public function getMessageId() public function getMessageId()
{ {
return $this->message_id; return $this->message_id;
} }
public function getDate() public function getDate()
{ {
return $this->date; return $this->date;
} }
public function getFrom() public function getFrom()
{ {
return $this->from; return $this->from;
} }
public function getChat() public function getChat()
{ {
return $this->chat; return $this->chat;
} }
public function getForwardFrom() public function getForwardFrom()
{ {
return $this->forward_from; return $this->forward_from;
} }
public function getForwardDate() public function getForwardDate()
{ {
return $this->forward_date; return $this->forward_date;
} }
public function getReplyToMessage() public function getReplyToMessage()
{ {
return $this->reply_to_message; return $this->reply_to_message;
} }
public function getNewChatParticipant() public function getNewChatParticipant()
{ {
return $this->new_chat_participant; return $this->new_chat_participant;
} }
public function getLeftChatParticipant() public function getLeftChatParticipant()
{ {
return $this->left_chat_participant; return $this->left_chat_participant;
} }
public function getNewChatTitle() public function getNewChatTitle()
{ {
return $this->new_chat_title; return $this->new_chat_title;
} }
public function getDeleteChatPhoto() public function getDeleteChatPhoto()
{ {
return $this->delete_chat_photo; return $this->delete_chat_photo;
} }
public function getGroupChatCreated() public function getGroupChatCreated()
{ {
return $this->group_chat_created; return $this->group_chat_created;
} }
...@@ -251,15 +237,14 @@ class Message extends Entity ...@@ -251,15 +237,14 @@ class Message extends Entity
$text = $this->text; $text = $this->text;
if ($without_cmd) { if ($without_cmd) {
$command = $this->getFullCommand(); $command = $this->getFullCommand();
if(!empty($command)){ if (!empty($command)) {
$text = substr($text, strlen($command . ' '), strlen($text)); $text = substr($text, strlen($command.' '), strlen($text));
} }
} }
return $text; return $text;
} }
public function botAddedInChat() public function botAddedInChat()
{ {
if (!empty($this->new_chat_participant)) { if (!empty($this->new_chat_participant)) {
...@@ -267,12 +252,12 @@ class Message extends Entity ...@@ -267,12 +252,12 @@ class Message extends Entity
return true; return true;
} }
} }
return false; return false;
} }
public function getType() public function getType()
{ {
return $this->type; return $this->type;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment