Passed
Push — master ( 66f18e...deb202 )
by Mohammadreza
02:44 queued 19s
created
tgmethod.php 2 patches
Spacing   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 class tgmethod
8 8
 {
9 9
     // Telegram Token
10
-    protected $token=null;
10
+    protected $token = null;
11 11
 
12 12
     protected $ch;
13 13
 
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function  __construct($api_token)
20 20
     {
21
-        $this->token=$api_token;
22
-        if (strlen($this->token)==45 && count(explode(':',$this->token))==2){
21
+        $this->token = $api_token;
22
+        if (strlen($this->token) == 45 && count(explode(':', $this->token)) == 2) {
23 23
             $this->ch = curl_init();
24 24
             return true;
25 25
         }
@@ -41,23 +41,23 @@  discard block
 block discarded – undo
41 41
      * @param object $datas  Datas for Send to Telegram
42 42
      * @return object
43 43
      */
44
-    private function make_http_request($method,$datas=null){
44
+    private function make_http_request($method, $datas = null) {
45 45
         $url = "https://api.telegram.org/bot".$this->token."/".$method;
46
-        curl_setopt($this->ch,CURLOPT_RETURNTRANSFER,true);
47
-        curl_setopt($this->ch,CURLOPT_POSTFIELDS,($datas));
48
-        curl_setopt($this->ch,CURLOPT_URL,$url);
46
+        curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
47
+        curl_setopt($this->ch, CURLOPT_POSTFIELDS, ($datas));
48
+        curl_setopt($this->ch, CURLOPT_URL, $url);
49 49
         $res = curl_exec($this->ch);
50
-        if(curl_error($this->ch)){
51
-            $r=new \stdClass();
52
-            $r->ok=false;
53
-            $r->description=curl_error($this->ch);
54
-            $r->errno=curl_errno($this->ch);
50
+        if (curl_error($this->ch)) {
51
+            $r = new \stdClass();
52
+            $r->ok = false;
53
+            $r->description = curl_error($this->ch);
54
+            $r->errno = curl_errno($this->ch);
55 55
             return $r;
56
-        }else{
57
-            $res=json_decode($res);
58
-            if ($res->ok){
59
-                $res=$res->result;
60
-                $res->ok=true;
56
+        } else {
57
+            $res = json_decode($res);
58
+            if ($res->ok) {
59
+                $res = $res->result;
60
+                $res->ok = true;
61 61
             }
62 62
 
63 63
             return $res;
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
      * @param file $certificate Upload your public key certificate so that the root certificate in use can be checked
89 89
      * @return object
90 90
      */
91
-    public function setWebhook($url,$allowed_updates=null,$max_connections=null,$certificate=null){
92
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
91
+    public function setWebhook($url, $allowed_updates = null, $max_connections = null, $certificate = null) {
92
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
93 93
     }
94 94
 
95 95
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      * Use this method to remove webhook integration if you decide to switch back to getUpdates
99 99
      * @return object
100 100
      */
101
-    public function deleteWebhook(){
101
+    public function deleteWebhook() {
102 102
         return $this->make_http_request(__FUNCTION__);
103 103
     }
104 104
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      * Use this method to get current webhook status. Requires no parameters
109 109
      * @return object
110 110
      */
111
-    public function getWebhookInfo(){
111
+    public function getWebhookInfo() {
112 112
         return $this->make_http_request(__FUNCTION__);
113 113
     }
114 114
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      * A simple method for testing your bot's auth token
119 119
      * @return object
120 120
      */
121
-    public function getme(){
121
+    public function getme() {
122 122
         return $this->make_http_request(__FUNCTION__);
123 123
     }
124 124
 
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
136 136
      * @return object
137 137
      */
138
-    public function sendMessage($chat_id,$text,$reply_to_message_id=null,$parse_mode=null,$disable_web_page_preview=null,$reply_markup=null,$disable_notification=null){
139
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
138
+    public function sendMessage($chat_id, $text, $reply_to_message_id = null, $parse_mode = null, $disable_web_page_preview = null, $reply_markup = null, $disable_notification = null) {
139
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
140 140
     }
141 141
 
142 142
 
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
150 150
      * @return object
151 151
      */
152
-    public function forwardMessage($chat_id,$from_chat_id,$message_id,$disable_notification=null){
153
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
152
+    public function forwardMessage($chat_id, $from_chat_id, $message_id, $disable_notification = null) {
153
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
154 154
     }
155 155
 
156 156
 
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
166 166
      * @return object
167 167
      */
168
-    public function sendPhoto($chat_id,$photo,$caption=null,$reply_to_message_id=null,$reply_markup=null,$disable_notification=null){
169
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
168
+    public function sendPhoto($chat_id, $photo, $caption = null, $reply_to_message_id = null, $reply_markup = null, $disable_notification = null) {
169
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
170 170
     }
171 171
 
172 172
 
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
185 185
      * @return object
186 186
      */
187
-    public function sendAudio($chat_id,$audio,$caption=null,$reply_to_message_id=null,$reply_markup=null,$title=null,$duration=null,$performer=null,$disable_notification=null){
188
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
187
+    public function sendAudio($chat_id, $audio, $caption = null, $reply_to_message_id = null, $reply_markup = null, $title = null, $duration = null, $performer = null, $disable_notification = null) {
188
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
189 189
     }
190 190
 
191 191
 
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
201 201
      * @return object
202 202
      */
203
-    public function sendDocument($chat_id,$document,$caption=null,$reply_to_message_id=null,$reply_markup=null,$disable_notification=null){
204
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
203
+    public function sendDocument($chat_id, $document, $caption = null, $reply_to_message_id = null, $reply_markup = null, $disable_notification = null) {
204
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
205 205
     }
206 206
 
207 207
 
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
220 220
      * @return object
221 221
      */
222
-    public function sendVideo($chat_id,$video,$caption=null,$reply_to_message_id=null,$reply_markup=null,$duration=null,$width=null,$height=null,$disable_notification=null){
223
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
222
+    public function sendVideo($chat_id, $video, $caption = null, $reply_to_message_id = null, $reply_markup = null, $duration = null, $width = null, $height = null, $disable_notification = null) {
223
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
224 224
     }
225 225
 
226 226
 
@@ -236,8 +236,8 @@  discard block
 block discarded – undo
236 236
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
237 237
      * @return object
238 238
      */
239
-    public function sendVoice($chat_id,$voice,$caption=null,$reply_to_message_id=null,$reply_markup=null,$duration=null,$disable_notification=null){
240
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
239
+    public function sendVoice($chat_id, $voice, $caption = null, $reply_to_message_id = null, $reply_markup = null, $duration = null, $disable_notification = null) {
240
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
241 241
     }
242 242
 
243 243
 
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
254 254
      * @return object
255 255
      */
256
-    public function sendVideoNote($chat_id,$video_note,$reply_to_message_id=null,$reply_markup=null,$duration=null,$length=null,$disable_notification=null){
257
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
256
+    public function sendVideoNote($chat_id, $video_note, $reply_to_message_id = null, $reply_markup = null, $duration = null, $length = null, $disable_notification = null) {
257
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
258 258
     }
259 259
 
260 260
 
@@ -267,8 +267,8 @@  discard block
 block discarded – undo
267 267
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
268 268
      * @return object
269 269
      */
270
-    public function sendMediaGroup($chat_id,$media,$reply_to_message_id=null,$disable_notification=null){
271
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
270
+    public function sendMediaGroup($chat_id, $media, $reply_to_message_id = null, $disable_notification = null) {
271
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
272 272
     }
273 273
 
274 274
 
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
285 285
      * @return object
286 286
      */
287
-    public function sendLocation($chat_id,$latitude,$longitude,$reply_to_message_id=null,$reply_markup=null,$live_period=null,$disable_notification=null){
288
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
287
+    public function sendLocation($chat_id, $latitude, $longitude, $reply_to_message_id = null, $reply_markup = null, $live_period = null, $disable_notification = null) {
288
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
289 289
     }
290 290
 
291 291
 
@@ -300,8 +300,8 @@  discard block
 block discarded – undo
300 300
      * @param json $reply_markup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
301 301
      * @return object
302 302
      */
303
-    public function editMessageLiveLocation($chat_id=null,$message_id=null,$inline_message_id=null,$latitude,$longitude,$reply_markup=null){
304
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
303
+    public function editMessageLiveLocation($chat_id = null, $message_id = null, $inline_message_id = null, $latitude, $longitude, $reply_markup = null) {
304
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
305 305
     }
306 306
 
307 307
 
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
      * @param json $reply_markup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
315 315
      * @return object
316 316
      */
317
-    public function stopMessageLiveLocation($chat_id=null,$message_id=null,$inline_message_id=null,$reply_markup=null)
317
+    public function stopMessageLiveLocation($chat_id = null, $message_id = null, $inline_message_id = null, $reply_markup = null)
318 318
     {
319
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
319
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
320 320
     }
321 321
 
322 322
 
@@ -334,9 +334,9 @@  discard block
 block discarded – undo
334 334
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
335 335
      * @return object
336 336
      */
337
-    public function sendVenue($chat_id,$latitude,$longitude,$title,$address,$reply_to_message_id=null,$reply_markup=null,$foursquare_id=null,$disable_notification=null)
337
+    public function sendVenue($chat_id, $latitude, $longitude, $title, $address, $reply_to_message_id = null, $reply_markup = null, $foursquare_id = null, $disable_notification = null)
338 338
     {
339
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
339
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
340 340
     }
341 341
 
342 342
 
@@ -352,9 +352,9 @@  discard block
 block discarded – undo
352 352
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
353 353
      * @return object
354 354
      */
355
-    public function sendContact($chat_id,$phone_number,$first_name,$last_name=null,$reply_to_message_id=null,$reply_markup=null,$disable_notification=null)
355
+    public function sendContact($chat_id, $phone_number, $first_name, $last_name = null, $reply_to_message_id = null, $reply_markup = null, $disable_notification = null)
356 356
     {
357
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
357
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
358 358
     }
359 359
 
360 360
 
@@ -365,9 +365,9 @@  discard block
 block discarded – undo
365 365
      * @param string $action
366 366
      * @return object
367 367
      */
368
-    public function sendChatAction($chat_id,$action)
368
+    public function sendChatAction($chat_id, $action)
369 369
     {
370
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
370
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
371 371
     }
372 372
 
373 373
 
@@ -379,9 +379,9 @@  discard block
 block discarded – undo
379 379
      * @param int $offset Sequential number of the first photo to be returned. By default, all photos are returned.
380 380
      * @return object
381 381
      */
382
-    public function getUserProfilePhotos($user_id,$limit=null,$offset=null)
382
+    public function getUserProfilePhotos($user_id, $limit = null, $offset = null)
383 383
     {
384
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
384
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
385 385
     }
386 386
 
387 387
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
      */
394 394
     public function getFile($file_id)
395 395
     {
396
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
396
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
397 397
     }
398 398
 
399 399
 
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
     public function getFileLink($file_path)
406 406
     {
407 407
         if (is_object($file_path))
408
-            $file_path=$file_path->file_path;
408
+            $file_path = $file_path->file_path;
409 409
         return 'https://api.telegram.org/file/bot'.$this->token.'/'.$file_path;
410 410
     }
411 411
 
@@ -418,9 +418,9 @@  discard block
 block discarded – undo
418 418
      * @param int $until_date Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
419 419
      * @return object
420 420
      */
421
-    public function kickChatMember($chat_id,$user_id,$until_date=null)
421
+    public function kickChatMember($chat_id, $user_id, $until_date = null)
422 422
     {
423
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
423
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
424 424
     }
425 425
 
426 426
 
@@ -431,9 +431,9 @@  discard block
 block discarded – undo
431 431
      * @param int $user_id Unique identifier of the target user
432 432
      * @return object
433 433
      */
434
-    public function unbanChatMember($chat_id,$user_id)
434
+    public function unbanChatMember($chat_id, $user_id)
435 435
     {
436
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
436
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
437 437
     }
438 438
 
439 439
 
@@ -449,9 +449,9 @@  discard block
 block discarded – undo
449 449
      * @param int $until_date Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever
450 450
      * @return object
451 451
      */
452
-    public function restrictChatMember($chat_id,$user_id,$can_send_messages=null,$can_send_media_messages=null,$can_send_other_messages=null,$can_add_web_page_previews=null,$until_date=null)
452
+    public function restrictChatMember($chat_id, $user_id, $can_send_messages = null, $can_send_media_messages = null, $can_send_other_messages = null, $can_add_web_page_previews = null, $until_date = null)
453 453
     {
454
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
454
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
455 455
     }
456 456
 
457 457
 
@@ -470,9 +470,9 @@  discard block
 block discarded – undo
470 470
      * @param bool $can_restrict_members Pass True, if the administrator can restrict, ban or unban chat members
471 471
      * @return object
472 472
      */
473
-    public function promoteChatMember($chat_id,$user_id,$can_post_messages=null,$can_edit_messages=null,$can_delete_messages=null,$can_change_info=null,$can_pin_messages=null,$can_invite_users=null,$can_promote_members=null,$can_restrict_members=null)
473
+    public function promoteChatMember($chat_id, $user_id, $can_post_messages = null, $can_edit_messages = null, $can_delete_messages = null, $can_change_info = null, $can_pin_messages = null, $can_invite_users = null, $can_promote_members = null, $can_restrict_members = null)
474 474
     {
475
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
475
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
476 476
     }
477 477
 
478 478
 
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
      */
485 485
     public function exportChatInviteLink($chat_id)
486 486
     {
487
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
487
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
488 488
     }
489 489
 
490 490
 
@@ -495,9 +495,9 @@  discard block
 block discarded – undo
495 495
      * @param file $photo New chat photo, uploaded using multipart/form-data
496 496
      * @return object
497 497
      */
498
-    public function setChatPhoto($chat_id,$photo)
498
+    public function setChatPhoto($chat_id, $photo)
499 499
     {
500
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
500
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
501 501
     }
502 502
 
503 503
 
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
      */
510 510
     public function deleteChatPhoto($chat_id)
511 511
     {
512
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
512
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
513 513
     }
514 514
 
515 515
 
@@ -520,9 +520,9 @@  discard block
 block discarded – undo
520 520
      * @param string $title New chat title, 1-255 characters
521 521
      * @return object
522 522
      */
523
-    public function setChatTitle($chat_id,$title)
523
+    public function setChatTitle($chat_id, $title)
524 524
     {
525
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
525
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
526 526
     }
527 527
 
528 528
 
@@ -533,9 +533,9 @@  discard block
 block discarded – undo
533 533
      * @param string $description New chat description, 0-255 characters
534 534
      * @return object
535 535
      */
536
-    public function setChatDescription($chat_id,$description)
536
+    public function setChatDescription($chat_id, $description)
537 537
     {
538
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
538
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
539 539
     }
540 540
 
541 541
 
@@ -547,9 +547,9 @@  discard block
 block discarded – undo
547 547
      * @param bool $disable_notification Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels
548 548
      * @return object
549 549
      */
550
-    public function pinChatMessage($chat_id,$message_id,$disable_notification=null)
550
+    public function pinChatMessage($chat_id, $message_id, $disable_notification = null)
551 551
     {
552
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
552
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
553 553
     }
554 554
 
555 555
 
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
      */
562 562
     public function unpinChatMessage($chat_id)
563 563
     {
564
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
564
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
565 565
     }
566 566
 
567 567
 
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
      */
574 574
     public function leaveChat($chat_id)
575 575
     {
576
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
576
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
577 577
     }
578 578
 
579 579
 
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
      */
586 586
     public function getChat($chat_id)
587 587
     {
588
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
588
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
589 589
     }
590 590
 
591 591
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
      */
598 598
     public function getChatAdministrators($chat_id)
599 599
     {
600
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
600
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
601 601
     }
602 602
 
603 603
 
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
      */
610 610
     public function getChatMembersCount($chat_id)
611 611
     {
612
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
612
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
613 613
     }
614 614
 
615 615
 
@@ -620,9 +620,9 @@  discard block
 block discarded – undo
620 620
      * @param int $user_id Unique identifier of the target user
621 621
      * @return object
622 622
      */
623
-    public function getChatMember($chat_id,$user_id)
623
+    public function getChatMember($chat_id, $user_id)
624 624
     {
625
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
625
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
626 626
     }
627 627
 
628 628
 
@@ -633,9 +633,9 @@  discard block
 block discarded – undo
633 633
      * @param int $sticker_set_name Name of the sticker set to be set as the group sticker set
634 634
      * @return object
635 635
      */
636
-    public function setChatStickerSet($chat_id,$sticker_set_name)
636
+    public function setChatStickerSet($chat_id, $sticker_set_name)
637 637
     {
638
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
638
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
639 639
     }
640 640
 
641 641
 
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
      */
648 648
     public function deleteChatStickerSet($chat_id)
649 649
     {
650
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
650
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
651 651
     }
652 652
 
653 653
 
@@ -661,9 +661,9 @@  discard block
 block discarded – undo
661 661
      * @param int $cache_time The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.
662 662
      * @return object
663 663
      */
664
-    public function answerCallbackQuery($callback_query_id,$text=null,$show_alert=null,$url=null,$cache_time=null)
664
+    public function answerCallbackQuery($callback_query_id, $text = null, $show_alert = null, $url = null, $cache_time = null)
665 665
     {
666
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
666
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
667 667
     }
668 668
 
669 669
 
@@ -679,9 +679,9 @@  discard block
 block discarded – undo
679 679
      * @param string $switch_pm_parameter Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.
680 680
      * @return object
681 681
      */
682
-    public function answerInlineQuery($inline_query_id,$results,$cache_time=null,$is_personal=null,$next_offset=null,$switch_pm_text=null,$switch_pm_parameter=null)
682
+    public function answerInlineQuery($inline_query_id, $results, $cache_time = null, $is_personal = null, $next_offset = null, $switch_pm_text = null, $switch_pm_parameter = null)
683 683
     {
684
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
684
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
685 685
     }
686 686
 
687 687
 
@@ -697,9 +697,9 @@  discard block
 block discarded – undo
697 697
      * @param bool $disable_web_page_preview Disables link previews for links in this message
698 698
      * @return object
699 699
      */
700
-    public function editMessageText($chat_id,$message_id,$text,$inline_message_id=null,$reply_markup=null,$parse_mode=null,$disable_web_page_preview=null)
700
+    public function editMessageText($chat_id, $message_id, $text, $inline_message_id = null, $reply_markup = null, $parse_mode = null, $disable_web_page_preview = null)
701 701
     {
702
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
702
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
703 703
     }
704 704
 
705 705
 
@@ -713,9 +713,9 @@  discard block
 block discarded – undo
713 713
      * @param json $reply_markup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
714 714
      * @return object
715 715
      */
716
-    public function editMessageCaption($chat_id,$message_id,$caption,$inline_message_id=null,$reply_markup=null)
716
+    public function editMessageCaption($chat_id, $message_id, $caption, $inline_message_id = null, $reply_markup = null)
717 717
     {
718
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
718
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
719 719
     }
720 720
 
721 721
 
@@ -728,9 +728,9 @@  discard block
 block discarded – undo
728 728
      * @param string $inline_message_id Required if chat_id and message_id are not specified. Identifier of the inline message
729 729
      * @return object
730 730
      */
731
-    public function editMessageReplyMarkup($chat_id,$message_id,$reply_markup,$inline_message_id=null)
731
+    public function editMessageReplyMarkup($chat_id, $message_id, $reply_markup, $inline_message_id = null)
732 732
     {
733
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
733
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
734 734
     }
735 735
 
736 736
 
@@ -741,9 +741,9 @@  discard block
 block discarded – undo
741 741
      * @param int $message_id Identifier of the message to delete
742 742
      * @return object
743 743
      */
744
-    public function deleteMessage($chat_id,$message_id)
744
+    public function deleteMessage($chat_id, $message_id)
745 745
     {
746
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
746
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
747 747
     }
748 748
 
749 749
 
@@ -757,8 +757,8 @@  discard block
 block discarded – undo
757 757
      * @param bool $disable_notification Sends the message silently. Users will receive a notification with no sound.
758 758
      * @return object
759 759
      */
760
-    public function sendSticker($chat_id,$sticker,$reply_to_message_id=null,$reply_markup=null,$disable_notification=null){
761
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
760
+    public function sendSticker($chat_id, $sticker, $reply_to_message_id = null, $reply_markup = null, $disable_notification = null) {
761
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
762 762
     }
763 763
 
764 764
 
@@ -768,8 +768,8 @@  discard block
 block discarded – undo
768 768
      * @param string $name Name of the sticker set
769 769
      * @return object
770 770
      */
771
-    public function getStickerSet($name){
772
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
771
+    public function getStickerSet($name) {
772
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
773 773
     }
774 774
 
775 775
 
@@ -780,8 +780,8 @@  discard block
 block discarded – undo
780 780
      * @param file $png_sticker Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px
781 781
      * @return object
782 782
      */
783
-    public function uploadStickerFile($user_id,$png_sticker){
784
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
783
+    public function uploadStickerFile($user_id, $png_sticker) {
784
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
785 785
     }
786 786
 
787 787
 
@@ -797,8 +797,8 @@  discard block
 block discarded – undo
797 797
      * @param json $mask_position A JSON-serialized object for position where the mask should be placed on faces
798 798
      * @return object
799 799
      */
800
-    public function createNewStickerSet($user_id,$name,$title,$png_sticker,$emojis,$contains_masks=null,$mask_position=null){
801
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
800
+    public function createNewStickerSet($user_id, $name, $title, $png_sticker, $emojis, $contains_masks = null, $mask_position = null) {
801
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
802 802
     }
803 803
 
804 804
 
@@ -812,8 +812,8 @@  discard block
 block discarded – undo
812 812
      * @param json $mask_position A JSON-serialized object for position where the mask should be placed on faces
813 813
      * @return object
814 814
      */
815
-    public function addStickerToSet($user_id,$name,$png_sticker,$emojis,$mask_position=null){
816
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
815
+    public function addStickerToSet($user_id, $name, $png_sticker, $emojis, $mask_position = null) {
816
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
817 817
     }
818 818
 
819 819
 
@@ -824,8 +824,8 @@  discard block
 block discarded – undo
824 824
      * @param int $position New sticker position in the set, zero-based
825 825
      * @return object
826 826
      */
827
-    public function setStickerPositionInSet($sticker,$position){
828
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
827
+    public function setStickerPositionInSet($sticker, $position) {
828
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
829 829
     }
830 830
 
831 831
 
@@ -835,8 +835,8 @@  discard block
 block discarded – undo
835 835
      * @param string $sticker File identifier of the sticker
836 836
      * @return object
837 837
      */
838
-    public function deleteStickerFromSet($sticker){
839
-        return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());
838
+    public function deleteStickerFromSet($sticker) {
839
+        return $this->make_http_request(__FUNCTION__, (object) get_defined_vars());
840 840
     }
841 841
 
842 842
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
         if (strlen($this->token)==45 && count(explode(':',$this->token))==2){
23 23
             $this->ch = curl_init();
24 24
             return true;
25
+        } else {
26
+                    return false;
25 27
         }
26
-        else
27
-            return false;
28 28
     }
29 29
 
30 30
     /**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             $r->description=curl_error($this->ch);
54 54
             $r->errno=curl_errno($this->ch);
55 55
             return $r;
56
-        }else{
56
+        } else{
57 57
             $res=json_decode($res);
58 58
             if ($res->ok){
59 59
                 $res=$res->result;
@@ -404,8 +404,9 @@  discard block
 block discarded – undo
404 404
      */
405 405
     public function getFileLink($file_path)
406 406
     {
407
-        if (is_object($file_path))
408
-            $file_path=$file_path->file_path;
407
+        if (is_object($file_path)) {
408
+                    $file_path=$file_path->file_path;
409
+        }
409 410
         return 'https://api.telegram.org/file/bot'.$this->token.'/'.$file_path;
410 411
     }
411 412
 
Please login to merge, or discard this patch.