Completed
Branch feature/improve-code (2bc325)
by Avtandil
04:25
created
src/Commands/AdminCommands/ChatsCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
             $text_back .= "\n" . 'Total: ' . ($user_chats + $group_chats + $super_group_chats);
103 103
 
104 104
             if ($text === '') {
105
-                $text_back .= "\n\n" . 'List all chats: /' . $this->name .' *' . "\n" . 'Search for chats: /' . $this->name .' <search string>';
105
+                $text_back .= "\n\n" . 'List all chats: /' . $this->name . ' *' . "\n" . 'Search for chats: /' . $this->name . ' <search string>';
106 106
             }
107 107
         }
108 108
 
Please login to merge, or discard this patch.
src/Commands/AdminCommands/SendtochannelCommand.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                     }
97 97
                     $reply_keyboard_markup = new ReplyKeyboardMarkup(
98 98
                         [
99
-                            'keyboard' => $keyboard ,
99
+                            'keyboard' => $keyboard,
100 100
                             'resize_keyboard' => true,
101 101
                             'one_time_keyboard' => true,
102 102
                             'selective' => true
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                         $keyboard = [['Yes', 'No']];
140 140
                         $reply_keyboard_markup = new ReplyKeyboardMarkup(
141 141
                             [
142
-                                'keyboard' => $keyboard ,
142
+                                'keyboard' => $keyboard,
143 143
                                 'resize_keyboard' => true,
144 144
                                 'one_time_keyboard' => true,
145 145
                                 'selective' => true
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                 $this->conversation->notes['last_message_id'] = $message->getMessageId();
163 163
                 // no break
164 164
             case 3:
165
-                if (($this->conversation->notes['last_message_id'] == $message->getMessageId() || $type != 'Message' ) && $this->conversation->notes['set_caption']) {
165
+                if (($this->conversation->notes['last_message_id'] == $message->getMessageId() || $type != 'Message') && $this->conversation->notes['set_caption']) {
166 166
                     $this->conversation->notes['state'] = 3;
167 167
                     $this->conversation->update();
168 168
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
                         $keyboard = [['Yes', 'No']];
196 196
                         $reply_keyboard_markup = new ReplyKeyboardMarkup(
197 197
                             [
198
-                                'keyboard' => $keyboard ,
198
+                                'keyboard' => $keyboard,
199 199
                                 'resize_keyboard' => true,
200 200
                                 'one_time_keyboard' => true,
201 201
                                 'selective' => true
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
         if ($this->sendBack($message, $data)->isOk()) {
274 274
             $response = 'Message sent successfully to: ' . $channel;
275 275
         } else {
276
-            $response = 'Message not sent to: ' .  $channel . "\n" .
276
+            $response = 'Message not sent to: ' . $channel . "\n" .
277 277
                     '- Does the channel exist?' . "\n" .
278 278
                     '- Is the bot an admin of the channel?';
279 279
         }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         }
324 324
         $callback_path = 'Longman\TelegramBot\Request';
325 325
         $callback_function = 'send' . $type;
326
-        if (! method_exists($callback_path, $callback_function)) {
326
+        if (!method_exists($callback_path, $callback_function)) {
327 327
             throw new TelegramException('Methods: ' . $callback_function . ' not found in class Request.');
328 328
         }
329 329
 
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,6 @@
 block discarded – undo
14 14
 use Longman\TelegramBot\Conversation;
15 15
 use Longman\TelegramBot\Commands\UserCommand;
16 16
 use Longman\TelegramBot\Entities\ForceReply;
17
-use Longman\TelegramBot\Entities\ReplyKeyboardHide;
18 17
 use Longman\TelegramBot\Entities\ReplyKeyboardMarkup;
19 18
 
20 19
 /**
Please login to merge, or discard this patch.
src/ConversationDB.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
         //Where
161 161
         $a = 0;
162
-        $where  = '';
162
+        $where = '';
163 163
         foreach ($where_fields_values as $field => $value) {
164 164
             if ($a) {
165 165
                 $where .= ' AND ';
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                 $where .= 'WHERE ';
169 169
             }
170 170
             ++$tokens_counter;
171
-            $where .= '`' . $field .'`= :' . $tokens_counter;
171
+            $where .= '`' . $field . '`= :' . $tokens_counter;
172 172
             $tokens[':' . $tokens_counter] = $value;
173 173
         }
174 174
 
Please login to merge, or discard this patch.
src/Entities/Chat.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,11 +118,11 @@
 block discarded – undo
118 118
         if ($this->isPrivateChat()) {
119 119
             if (is_null($this->username)) {
120 120
                 if (!is_null($this->last_name)) {
121
-                    return $this->first_name.' '.$this->last_name;
121
+                    return $this->first_name . ' ' . $this->last_name;
122 122
                 }
123 123
                 return $this->first_name;
124 124
             }
125
-            return '@'.$this->username;
125
+            return '@' . $this->username;
126 126
         }
127 127
         return $this->getTitle();
128 128
     }
Please login to merge, or discard this patch.
src/Entities/Sticker.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,26 +62,26 @@
 block discarded – undo
62 62
 
63 63
     public function getWidth()
64 64
     {
65
-         return $this->width;
65
+            return $this->width;
66 66
     }
67 67
 
68 68
     public function getHeight()
69 69
     {
70
-         return $this->height;
70
+            return $this->height;
71 71
     }
72 72
 
73 73
     public function getThumb()
74 74
     {
75
-         return $this->thumb;
75
+            return $this->thumb;
76 76
     }
77 77
 
78 78
     public function getEmoji()
79 79
     {
80
-         return $this->emoji;
80
+            return $this->emoji;
81 81
     }
82 82
 
83 83
     public function getFileSize()
84 84
     {
85
-         return $this->file_size;
85
+            return $this->file_size;
86 86
     }
87 87
 }
Please login to merge, or discard this patch.
src/Entities/ServerResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,6 +134,6 @@
 block discarded – undo
134 134
     }
135 135
     public function printError()
136 136
     {
137
-        return 'Error N: '.$this->getErrorCode().' Description: '.$this->getDescription();
137
+        return 'Error N: ' . $this->getErrorCode() . ' Description: ' . $this->getDescription();
138 138
     }
139 139
 }
Please login to merge, or discard this patch.
src/Entities/Video.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,27 +65,27 @@
 block discarded – undo
65 65
 
66 66
     public function getWidth()
67 67
     {
68
-         return $this->width;
68
+            return $this->width;
69 69
     }
70 70
 
71 71
     public function getHeight()
72 72
     {
73
-         return $this->height;
73
+            return $this->height;
74 74
     }
75 75
     public function getDuration()
76 76
     {
77
-         return $this->duration;
77
+            return $this->duration;
78 78
     }
79 79
     public function getThumb()
80 80
     {
81
-         return $this->thumb;
81
+            return $this->thumb;
82 82
     }
83 83
     public function getMimeType()
84 84
     {
85
-         return $this->mime_type;
85
+            return $this->mime_type;
86 86
     }
87 87
     public function getFileSize()
88 88
     {
89
-         return $this->file_size;
89
+            return $this->file_size;
90 90
     }
91 91
 }
Please login to merge, or discard this patch.
src/Entities/Voice.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,16 +47,16 @@
 block discarded – undo
47 47
 
48 48
     public function getDuration()
49 49
     {
50
-         return $this->duration;
50
+            return $this->duration;
51 51
     }
52 52
 
53 53
     public function getMimeType()
54 54
     {
55
-         return $this->mime_type;
55
+            return $this->mime_type;
56 56
     }
57 57
 
58 58
     public function getFileSize()
59 59
     {
60
-         return $this->file_size;
60
+            return $this->file_size;
61 61
     }
62 62
 }
Please login to merge, or discard this patch.
src/Entities/PhotoSize.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,16 +53,16 @@
 block discarded – undo
53 53
 
54 54
     public function getWidth()
55 55
     {
56
-         return $this->width;
56
+            return $this->width;
57 57
     }
58 58
 
59 59
     public function getHeight()
60 60
     {
61
-         return $this->height;
61
+            return $this->height;
62 62
     }
63 63
 
64 64
     public function getFileSize()
65 65
     {
66
-         return $this->file_size;
66
+            return $this->file_size;
67 67
     }
68 68
 }
Please login to merge, or discard this patch.