From 30e87023d985ed04ea9f98eaddedefa5690fa6ca Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 12 Feb 2017 18:56:11 +0000 Subject: [PATCH] Apply fixes from StyleCI --- bot.php | 14 +++++++------- src/danog/MadelineProto/API.php | 7 ++++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/bot.php b/bot.php index f613bbc65..4beb1e093 100755 --- a/bot.php +++ b/bot.php @@ -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) { diff --git a/src/danog/MadelineProto/API.php b/src/danog/MadelineProto/API.php index 6ac78ae26..42fbf82e1 100644 --- a/src/danog/MadelineProto/API.php +++ b/src/danog/MadelineProto/API.php @@ -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']);