Applied fixes from StyleCI

This commit is contained in:
Daniil Gentili 2016-09-12 20:28:44 +00:00 committed by StyleCI Bot
parent 8366d2c3b6
commit 0489abba48
9 changed files with 9 additions and 17 deletions

View File

@ -110,5 +110,4 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB
{ {
unset($this->sock); unset($this->sock);
} }
} }

View File

@ -44,5 +44,4 @@ class AckHandler extends \danog\MadelineProto\Tools
array_shift($this->ack_incoming_message_ids); array_shift($this->ack_incoming_message_ids);
} }
} }
} }

View File

@ -64,5 +64,4 @@ class CallHandler extends AuthKeyHandler
} }
throw new Exception('An error occurred while calling object '.$object.'.'); throw new Exception('An error occurred while calling object '.$object.'.');
} }
} }

View File

@ -13,11 +13,10 @@ If not, see <http://www.gnu.org/licenses/>.
namespace danog\MadelineProto\MTProtoTools; namespace danog\MadelineProto\MTProtoTools;
/** /**
* Manages packing and unpacking of messages * Manages packing and unpacking of messages.
*/ */
class MessageHandler extends Crypt class MessageHandler extends Crypt
{ {
/** /**
* Forming the message frame and sending message to server * Forming the message frame and sending message to server
* :param message: byte string to send. * :param message: byte string to send.
@ -108,5 +107,4 @@ class MessageHandler extends Crypt
return $message_data; return $message_data;
} }
} }

View File

@ -17,7 +17,6 @@ namespace danog\MadelineProto\MTProtoTools;
*/ */
class MsgIdHandler extends MessageHandler class MsgIdHandler extends MessageHandler
{ {
public function check_message_id($new_message_id, $outgoing) public function check_message_id($new_message_id, $outgoing)
{ {
if (((int) ((time() + $this->timedelta - 300) * pow(2, 30)) * 4) > $new_message_id) { if (((int) ((time() + $this->timedelta - 300) * pow(2, 30)) * 4) > $new_message_id) {
@ -49,5 +48,4 @@ class MsgIdHandler extends MessageHandler
} }
} }
} }
} }

View File

@ -103,5 +103,4 @@ class ResponseHandler extends MsgIdHandler
break; break;
} }
} }
} }

View File

@ -17,7 +17,6 @@ namespace danog\MadelineProto\MTProtoTools;
*/ */
class SeqNoHandler extends ResponseHandler class SeqNoHandler extends ResponseHandler
{ {
public function generate_seq_no($content_related = true) public function generate_seq_no($content_related = true)
{ {
$in = $content_related ? 1 : 0; $in = $content_related ? 1 : 0;
@ -26,5 +25,4 @@ class SeqNoHandler extends ResponseHandler
return ($value * 2) + $in; return ($value * 2) + $in;
} }
} }

View File

@ -263,8 +263,10 @@ class TL
'msg_resend_ans_req', 'msg_resend_ans_req',
]); ]);
} }
public function get_opts($method) {
$opts = ["requires_answer" => !in_array($method, [ public function get_opts($method)
{
$opts = ['requires_answer' => !in_array($method, [
'msgs_ack', 'msgs_ack',
])]; ])];
} }

View File

@ -8,8 +8,8 @@ if (!$config) {
exit(-1); exit(-1);
} }
function base64url_decode($data) { function base64url_decode($data)
{
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT)); return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
} }
$MadelineProto = new \danog\MadelineProto\API($config); $MadelineProto = new \danog\MadelineProto\API($config);