From aed44236d1569cbf47afaeb20276315a4c0da2a5 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 11 Oct 2016 15:30:11 +0000 Subject: [PATCH] Applied fixes from StyleCI --- src/danog/MadelineProto/Logging.php | 2 +- src/danog/MadelineProto/MTProtoTools/MsgIdHandler.php | 7 +++++-- src/danog/MadelineProto/PrimeModule.php | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/danog/MadelineProto/Logging.php b/src/danog/MadelineProto/Logging.php index c15c1e7c..ec021483 100644 --- a/src/danog/MadelineProto/Logging.php +++ b/src/danog/MadelineProto/Logging.php @@ -64,7 +64,7 @@ class Logging if (!is_string($param)) { $param = var_export($param, true); } - $param = basename(debug_backtrace()[0]["file"], '.php').': '.$param; + $param = basename(debug_backtrace()[0]['file'], '.php').': '.$param; switch ($mode) { case '1': error_log($param); diff --git a/src/danog/MadelineProto/MTProtoTools/MsgIdHandler.php b/src/danog/MadelineProto/MTProtoTools/MsgIdHandler.php index ba0c311d..64c0b949 100644 --- a/src/danog/MadelineProto/MTProtoTools/MsgIdHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/MsgIdHandler.php @@ -63,10 +63,12 @@ class MsgIdHandler extends MessageHandler ksort($this->incoming_messages); } } - public function generate_message_id() { + + public function generate_message_id() + { $ms_time = (time() + $this->timedelta) * 1000; $int_message_id = (int) ( - ((int)($ms_time / 1000) << 32) | + ((int) ($ms_time / 1000) << 32) | ($this->posmod($ms_time, 1000) << 22) | rand(0, 524288) << 2 ); @@ -76,6 +78,7 @@ class MsgIdHandler extends MessageHandler $int_message_id += 4; } $this->check_message_id($int_message_id, true); + return $int_message_id; } } diff --git a/src/danog/MadelineProto/PrimeModule.php b/src/danog/MadelineProto/PrimeModule.php index 8fae241b..2abb9018 100644 --- a/src/danog/MadelineProto/PrimeModule.php +++ b/src/danog/MadelineProto/PrimeModule.php @@ -80,7 +80,7 @@ class PrimeModule extends Tools { $pqstr = (string) $pq; - $this->log->log("Trying to use the python factorization module"); + $this->log->log('Trying to use the python factorization module'); if (function_exists('shell_exec')) { try { $res = json_decode(shell_exec('python '.__DIR__.'/getpq.py '.$pqstr)); @@ -91,7 +91,7 @@ class PrimeModule extends Tools } } - $this->log->log("Trying to use the wolfram alpha factorization module"); + $this->log->log('Trying to use the wolfram alpha factorization module'); $query = 'Do prime factorization of '.$pqstr; $params = [ 'async' => true, @@ -120,7 +120,7 @@ class PrimeModule extends Tools return $res; } - $this->log->log("Trying to use the native factorization module"); + $this->log->log('Trying to use the native factorization module'); $res = $this->find_small_multiplier_lopatin((int) $pqstr); $res = [$res, $pqstr / $res]; if ($res[1] != 1) {