Applied fixes from StyleCI

This commit is contained in:
Daniil Gentili 2016-10-11 15:30:11 +00:00 committed by StyleCI Bot
parent a540b0a4cf
commit aed44236d1
3 changed files with 9 additions and 6 deletions

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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) {