Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-01-01 16:13:19 +00:00 committed by StyleCI Bot
parent 96efd18e13
commit 2f8149c4d9
4 changed files with 7 additions and 7 deletions

5
id.php
View File

@ -12,7 +12,7 @@ If not, see <http://www.gnu.org/licenses/>.
require 'vendor/autoload.php';
$id = ['AgADBAADcKoxG4_aCgYKET2oLMua7pxRaRkABKoeLWY9bpazGdcCAAEC', "BQADBAADhQEAAo_aCgZOb3LWhOazMQI"];
$id = ['AgADBAADcKoxG4_aCgYKET2oLMua7pxRaRkABKoeLWY9bpazGdcCAAEC', 'BQADBAADhQEAAo_aCgZOb3LWhOazMQI'];
function foreach_offset_length($string)
{
@ -22,9 +22,10 @@ function foreach_offset_length($string)
for ($length = $strlen - $offset; $length > 0; $length--) {
$s = substr($string, $offset, $length);
$number = (string) (new \phpseclib\Math\BigInteger(strrev($s), 256));
$res []= ['number' => $number, 'offset' => $offset, 'length' => $length];
$res[] = ['number' => $number, 'offset' => $offset, 'length' => $length];
}
}
return $res;
}
$res = [];

View File

@ -35,14 +35,13 @@ trait CallHandler
while ($server_answer === null && $res_count++ < $this->settings['max_tries']['response']) { // Loop until we get a response, loop for a max of $this->settings['max_tries']['response'] times
try {
\danog\MadelineProto\Logger::log('Getting response (try number '.$res_count.' for '.$method.')...');
$this->recv_message(); // This method receives data from the socket, and parses stuff
$this->recv_message(); // This method receives data from the socket, and parses stuff
if (!isset($this->datacenter->outgoing_messages[$int_message_id]['response']) || !isset($this->datacenter->incoming_messages[$this->datacenter->outgoing_messages[$int_message_id]['response']]['content'])) { // Checks if I have received the response to the called method, if not continue looping
continue;
}
$server_answer = $this->datacenter->incoming_messages[$this->datacenter->outgoing_messages[$int_message_id]['response']]['content']; // continue was not called, so I got a response
} catch (\danog\MadelineProto\Exception $e) {
\danog\MadelineProto\Logger::log('An error getting response of method '.$method.': '.$e->getMessage().' in '.basename($e->getFile(), '.php').' on line '.$e->getLine().'. Retrying...');
continue;

View File

@ -194,6 +194,7 @@ trait UpdateHandler
\danog\MadelineProto\Logger::log('Got channel too long update, getting difference...');
if (!isset($this->channels_state[$channel_id]) && !isset($update['pts'])) {
\danog\MadelineProto\Logger::log('I do not have the channel in the states and the pts is not set.');
return;
}
break;

View File

@ -79,6 +79,5 @@ sleep(5);
var_dump($MadelineProto->API->get_updates());
while (true) {
$sentMessage = $MadelineProto->messages->sendMessage(['peer' => '@pwrtelegramgroupita', 'message' => $message, 'entities' => [['_' => 'inputMessageEntityMentionName', 'offset' => 0, 'length' => strlen($message), 'user_id' => $mention]]]);
}
$sentMessage = $MadelineProto->messages->sendMessage(['peer' => '@pwrtelegramgroupita', 'message' => $message, 'entities' => [['_' => 'inputMessageEntityMentionName', 'offset' => 0, 'length' => strlen($message), 'user_id' => $mention]]]);
}