1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 20:35:23 +01:00

Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-02-12 18:56:11 +00:00 committed by StyleCI Bot
parent 08a3a00c13
commit 30e87023d9
2 changed files with 13 additions and 8 deletions

14
bot.php
View File

@ -15,14 +15,14 @@ require 'vendor/autoload.php';
$settings = [];
try {
$MadelineProto = \danog\MadelineProto\Serialization::deserialize('bot.madeline');
$MadelineProto = \danog\MadelineProto\Serialization::deserialize('bot.madeline');
} catch (\danog\MadelineProto\Exception $e) {
if (file_exists('token.php')) {
include_once 'token.php';
$MadelineProto = new \danog\MadelineProto\API($settings);
$authorization = $MadelineProto->bot_login($token);
\danog\MadelineProto\Logger::log([$authorization], \danog\MadelineProto\Logger::NOTICE);
}
if (file_exists('token.php')) {
include_once 'token.php';
$MadelineProto = new \danog\MadelineProto\API($settings);
$authorization = $MadelineProto->bot_login($token);
\danog\MadelineProto\Logger::log([$authorization], \danog\MadelineProto\Logger::NOTICE);
}
}
$offset = 0;
while (true) {

View File

@ -51,7 +51,12 @@ class API extends APIFactory
return ['API', 'v'];
}
public function getV() { return 1; }
public function getV()
{
return 1;
}
public function __wakeup()
{
set_error_handler(['\danog\MadelineProto\Exception', 'ExceptionErrorHandler']);