@@ -63,6 +63,51 @@ class BotManager
6363 */
6464 public $ selfcrt ;
6565
66+ /**
67+ * @var array Array of logger files to set
68+ */
69+ public $ logging ;
70+
71+ /**
72+ * @var array List of admins to enable
73+ */
74+ public $ admins ;
75+
76+ /**
77+ * @var array MySQL credentials to use
78+ */
79+ public $ mysql ;
80+
81+ /**
82+ * @var string Custom download path to set
83+ */
84+ public $ download_path ;
85+
86+ /**
87+ * @var string Custom upload path to set
88+ */
89+ public $ upload_path ;
90+
91+ /**
92+ * @var array Custom commands paths to set
93+ */
94+ public $ commands_paths ;
95+
96+ /**
97+ * @var array List of custom command configs
98+ */
99+ public $ command_configs ;
100+
101+ /**
102+ * @var string Botan token to enable botan.io support
103+ */
104+ public $ botan_token ;
105+
106+ /**
107+ * @var string Custom raw JSON string to use as input
108+ */
109+ public $ custom_input ;
110+
66111 /**
67112 * @var array List of valid actions that can be called
68113 */
@@ -182,7 +227,7 @@ public function makeCliFriendly()
182227 */
183228 public function initLogging ()
184229 {
185- if (isset ( $ this -> logging ) && is_array ($ this ->logging )) {
230+ if (is_array ($ this ->logging )) {
186231 foreach ($ this ->logging as $ logger => $ logfile ) {
187232 ('debug ' === $ logger ) && TelegramLog::initDebugLog ($ logfile );
188233 ('error ' === $ logger ) && TelegramLog::initErrorLog ($ logfile );
@@ -260,7 +305,7 @@ public function validateAndSetWebhook()
260305 /**
261306 * Check if the current action is one of the passed ones.
262307 *
263- * @param $actions
308+ * @param string|array $actions
264309 *
265310 * @return bool
266311 */
@@ -314,7 +359,7 @@ public function handleRequest()
314359 /**
315360 * Loop the getUpdates method for the passed amount of seconds.
316361 *
317- * @param $loop_time_in_seconds int
362+ * @param int $loop_time_in_seconds
318363 *
319364 * @return $this
320365 */
@@ -392,15 +437,15 @@ public function handleWebhook()
392437 */
393438 public function setBotExtras ()
394439 {
395- isset ( $ this ->admins ) && $ this ->telegram ->enableAdmins (( array ) $ this ->admins );
396- isset ( $ this ->mysql ) && $ this ->telegram ->enableMySql ($ this ->mysql );
397- isset ( $ this ->botan_token ) && $ this ->telegram ->enableBotan ($ this ->botan_token );
398- isset ( $ this ->commands_paths ) && $ this ->telegram ->addCommandsPaths (( array ) $ this ->commands_paths );
399- isset ( $ this ->custom_input ) && $ this ->telegram ->setCustomInput ($ this ->custom_input );
400- isset ( $ this ->download_path ) && $ this ->telegram ->setDownloadPath ($ this ->download_path );
401- isset ( $ this ->upload_path ) && $ this ->telegram ->setUploadPath ($ this ->upload_path );
402-
403- if (isset ( $ this -> command_configs ) && is_array ($ this ->command_configs )) {
440+ $ this ->admins && $ this ->telegram ->enableAdmins ($ this ->admins );
441+ $ this ->mysql && $ this ->telegram ->enableMySql ($ this ->mysql );
442+ $ this ->botan_token && $ this ->telegram ->enableBotan ($ this ->botan_token );
443+ $ this ->commands_paths && $ this ->telegram ->addCommandsPaths ($ this ->commands_paths );
444+ $ this ->custom_input && $ this ->telegram ->setCustomInput ($ this ->custom_input );
445+ $ this ->download_path && $ this ->telegram ->setDownloadPath ($ this ->download_path );
446+ $ this ->upload_path && $ this ->telegram ->setUploadPath ($ this ->upload_path );
447+
448+ if (is_array ($ this ->command_configs )) {
404449 foreach ($ this ->command_configs as $ command => $ config ) {
405450 $ this ->telegram ->setCommandConfig ($ command , $ config );
406451 }
0 commit comments