Completed
Push — master ( a95f7d...eaa6fe )
by Danilo
02:55
created
src/BasicBot.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,6 @@
 block discarded – undo
19 19
 namespace PhpBotFramework;
20 20
 
21 21
 use PhpBotFramework\Exceptions\BotException;
22
-
23 22
 use PhpBotFramework\Entities\Message;
24 23
 use PhpBotFramework\Entities\CallbackQuery;
25 24
 use PhpBotFramework\Entities\ChosenInlineResult;
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
     use \PhpBotFramework\Commands\CommandHandler;
38 38
 
39 39
     /** @internal
40
-      * \brief True if the bot is using webhook? */
40
+     * \brief True if the bot is using webhook? */
41 41
     protected $_is_webhook;
42 42
 
43 43
     /**
Please login to merge, or discard this patch.
src/Bot.php 1 patch
Unused Use Statements   -6 removed lines patch added patch discarded remove patch
@@ -18,18 +18,12 @@
 block discarded – undo
18 18
 
19 19
 namespace PhpBotFramework;
20 20
 
21
-use PhpBotFramework\Exceptions\BotException;
22
-
23 21
 // Use localized inline keyboard: this means you can display it in various languages.
24 22
 use PhpBotFramework\Localization\Button;
25
-
26 23
 use PhpBotFramework\Utilities\BotState;
27
-
28 24
 use PhpBotFramework\Database\Database;
29
-
30 25
 use PhpBotFramework\Database\Getter;
31 26
 use PhpBotFramework\Database\LongPolling;
32
-
33 27
 use PhpBotFramework\Localization\Localization;
34 28
 
35 29
 /**
Please login to merge, or discard this patch.
src/Core/CoreBot.php 2 patches
Doc Comments   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     /**
392 392
      * \brief Set current chat ID.
393 393
      * \details Change the chat ID on which the bot acts.
394
-     * @param $chat_id The new chat ID to set.
394
+     * @param string $chat_id The new chat ID to set.
395 395
      */
396 396
     public function setChatID($chat_id)
397 397
     {
@@ -447,7 +447,6 @@  discard block
 block discarded – undo
447 447
      * brief Process an API method by taking method and parameter.
448 448
      * \details optionally create a object of $class class name with the response as constructor param.
449 449
      * @param string $method Method to call.
450
-     * @param array $param Parameter for the method.
451 450
      * @param string $class Class name of the object to create using response.
452 451
      * @return mixed Response or object of $class class name.
453 452
      */
@@ -525,6 +524,9 @@  discard block
 block discarded – undo
525 524
         return $this->checkRequestError($response);
526 525
     }
527 526
 
527
+    /**
528
+     * @param \Psr\Http\Message\ResponseInterface $response
529
+     */
528 530
     public function checkRequestError($response)
529 531
     {
530 532
         $http_code = $response->getStatusCode();
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -324,27 +324,27 @@
 block discarded – undo
324 324
         Chat;
325 325
 
326 326
     /** @internal
327
-      * \brief Chat_id of the user that interacted with the bot. */
327
+     * \brief Chat_id of the user that interacted with the bot. */
328 328
     protected $_chat_id;
329 329
 
330 330
     /** @internal
331
-      * \brief Bot id. */
331
+     * \brief Bot id. */
332 332
     protected $_bot_id;
333 333
 
334 334
     /** @internal
335
-      * \brief API endpoint (containing $token). */
335
+     * \brief API endpoint (containing $token). */
336 336
     protected $_api_url;
337 337
 
338 338
     /** @internal
339
-      * \brief Implements interface for execute HTTP requests. */
339
+     * \brief Implements interface for execute HTTP requests. */
340 340
     protected $_http;
341 341
 
342 342
     /** @internal
343
-      * \brief Object of class PhpBotFramework\Entities\File that contain a path or resource to a file that has to be sent using Telegram API Methods. */
343
+     * \brief Object of class PhpBotFramework\Entities\File that contain a path or resource to a file that has to be sent using Telegram API Methods. */
344 344
     protected $_file;
345 345
 
346 346
     /** \@internal
347
-      * brief Contains parameters of the next request. */
347
+     * brief Contains parameters of the next request. */
348 348
     protected $parameters;
349 349
 
350 350
     /**
Please login to merge, or discard this patch.
src/Core/Send.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,6 @@
 block discarded – undo
19 19
 namespace PhpBotFramework\Core;
20 20
 
21 21
 use PhpBotFramework\Entities\Message;
22
-
23 22
 use PhpBotFramework\Entities\File as TelegramFile;
24 23
 
25 24
 /**
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     abstract protected function checkCurrentFile(TelegramFile $file);
36 36
 
37 37
     /** @internal
38
-      * \brief Contains parameters of the next request. */
38
+     * \brief Contains parameters of the next request. */
39 39
     protected $parameters;
40 40
 
41 41
     /**
Please login to merge, or discard this patch.
src/Database/Database.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,6 @@
 block discarded – undo
19 19
 namespace PhpBotFramework\Database;
20 20
 
21 21
 use PhpBotFramework\BasicBot;
22
-use PhpBotFramework\Exceptions\BotException;
23 22
 
24 23
 define('PDO_DEFAULT_ADAPTER', 'mysql');
25 24
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      * \brief Create a Database handler object.
48 48
      * @param BasicBot $bot Reference to the bot that use this object.
49 49
      */
50
-    public function __construct(BasicBot &$bot)
50
+    public function __construct(BasicBot & $bot)
51 51
     {
52 52
         $this->bot = $bot;
53 53
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     protected function addDefaultValue(array $params) : array
94 94
     {
95
-        static $defaults = [ 'adapter' => PDO_DEFAULT_ADAPTER, 'host' => 'localhost', 'options' => [] ];
95
+        static $defaults = ['adapter' => PDO_DEFAULT_ADAPTER, 'host' => 'localhost', 'options' => []];
96 96
         return array_merge($defaults, $params);
97 97
     }
98 98
 
Please login to merge, or discard this patch.
src/Utilities/BotState.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,6 @@
 block discarded – undo
22 22
  * \addtogroup Modules
23 23
  * @{
24 24
  */
25
-use PhpBotFramework\Exceptions\BotException;
26
-
27 25
 use PhpBotFramework\BasicBot;
28 26
 
29 27
 /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
      * @{
87 87
      */
88 88
 
89
-    public function __construct(BasicBot &$bot)
89
+    public function __construct(BasicBot & $bot)
90 90
     {
91 91
         $this->bot = $bot;
92 92
     }
Please login to merge, or discard this patch.
src/Localization/LocalizedString.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,15 +38,15 @@
 block discarded – undo
38 38
      */
39 39
 
40 40
     /** @internal
41
-      * \brief Reference to the bot. */
41
+     * \brief Reference to the bot. */
42 42
     protected $bot;
43 43
 
44 44
     /** @internal
45
-      * \brief Current user/group language. */
45
+     * \brief Current user/group language. */
46 46
     public $language;
47 47
 
48 48
     /** @internal
49
-      * \brief Store the localizated strings. */
49
+     * \brief Store the localizated strings. */
50 50
     protected $local;
51 51
 
52 52
     /**
Please login to merge, or discard this patch.
src/Localization/File.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
      */
47 47
 
48 48
     /** @internal
49
-      * \brief Store the localized strings. */
49
+     * \brief Store the localized strings. */
50 50
     protected $local;
51 51
 
52 52
     /** \brief Source for localization files. */
Please login to merge, or discard this patch.
src/Localization/Localization.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
         // Get the language from the bot
64 64
         $sth = $pdo->prepare('SELECT language FROM ' . $this->user_table . ' WHERE '
65
-                                                           . $this->id_column . ' = :chat_id');
65
+                                                            . $this->id_column . ' = :chat_id');
66 66
 
67 67
         $chat_id = $this->bot->getChatID();
68 68
         $sth->bindParam(':chat_id', $chat_id);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
         // Update the language in the database
97 97
         $sth = $pdo->prepare('UPDATE ' . $this->user_table . ' SET language = :language WHERE '
98
-                                             . $this->id_column . ' = :id');
98
+                                                . $this->id_column . ' = :id');
99 99
         $sth->bindParam(':language', $language);
100 100
 
101 101
         $chat_id = $this->bot->getChatID();
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
     /** \brief Current user/group language. */
48 48
     public $language;
49 49
 
50
-    public function __construct(BasicBot &$bot)
50
+    public function __construct(BasicBot & $bot)
51 51
     {
52 52
         $this->bot = $bot;
53 53
     }
Please login to merge, or discard this patch.