Completed
Pull Request — master (#5)
by
unknown
01:16
created
src/Smoqadam/Keyboard/Inline.php 1 patch
Braces   +13 added lines, -12 removed lines patch added patch discarded remove patch
@@ -34,18 +34,19 @@
 block discarded – undo
34 34
   */
35 35
   public function addButton(string $text, string $url = '', string $callback_data = '', string $switch_inline_query = '', string $switch_inline_query_current_chat = '', string $callback_game = ''){
36 36
     $btn['text'] = $text;
37
-    if($url != '')
38
-      $btn['url'] = $url;
39
-    elseif($callback_data != '')
40
-      $btn['callback_data'] = $callback_data;
41
-    elseif($switch_inline_query != '')
42
-     $btn['switch_inline_query'] = $switch_inline_query;
43
-    elseif($switch_inline_query_current_chat != '')
44
-      $btn['switch_inline_query_current_chat'] = $switch_inline_query_current_chat;
45
-    elseif($callback_game != '')
46
-      $btn['callback_game'] = $callback_game;
47
-    else
48
-      $btn['callback_data'] = $text;
37
+    if($url != '') {
38
+          $btn['url'] = $url;
39
+    } elseif($callback_data != '') {
40
+          $btn['callback_data'] = $callback_data;
41
+    } elseif($switch_inline_query != '') {
42
+         $btn['switch_inline_query'] = $switch_inline_query;
43
+    } elseif($switch_inline_query_current_chat != '') {
44
+          $btn['switch_inline_query_current_chat'] = $switch_inline_query_current_chat;
45
+    } elseif($callback_game != '') {
46
+          $btn['callback_game'] = $callback_game;
47
+    } else {
48
+          $btn['callback_data'] = $text;
49
+    }
49 50
       
50 51
     $this->inline_keyboard[$this->current_row][] = $btn;
51 52
     
Please login to merge, or discard this patch.
src/Smoqadam/Telegram.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -127,8 +127,9 @@  discard block
 block discarded – undo
127 127
 
128 128
             $this->processPayload($result);
129 129
 
130
-            if ($sleep !== false)
131
-                sleep($sleep);
130
+            if ($sleep !== false) {
131
+                            sleep($sleep);
132
+            }
132 133
         }
133 134
     }
134 135
 
@@ -282,8 +283,9 @@  discard block
 block discarded – undo
282 283
      */
283 284
     public function getChatId($chat_id = null) {
284 285
       try {
285
-        if ($chat_id)
286
-          return $chat_id;
286
+        if ($chat_id) {
287
+                  return $chat_id;
288
+        }
287 289
 
288 290
         if( isset($this->result->message) ) {
289 291
           return $this->result->message->chat->id;
Please login to merge, or discard this patch.