mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 10:59:02 +01:00
Applied fixes from StyleCI
This commit is contained in:
parent
545b5629f6
commit
c39c6a8511
@ -74,7 +74,7 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB
|
||||
'tl_schema' => [
|
||||
'layer' => 55,
|
||||
'src' => [
|
||||
'mtproto' => __DIR__.'/TL_mtproto_v1.json',
|
||||
'mtproto' => __DIR__.'/TL_mtproto_v1.json',
|
||||
'telegram' => __DIR__.'/TL_telegram_v55.json',
|
||||
],
|
||||
],
|
||||
|
@ -82,6 +82,7 @@ class MsgIdHandler extends MessageHandler
|
||||
$int_message_id = $keys + 4;
|
||||
}
|
||||
$this->check_message_id($int_message_id, true);
|
||||
|
||||
return $int_message_id;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class TL extends \danog\MadelineProto\Tools
|
||||
$this->constructors = new \danog\MadelineProto\TL\TLConstructor();
|
||||
$this->methods = new \danog\MadelineProto\TL\TLMethod();
|
||||
foreach ($filename as $type => $file) {
|
||||
$type = $type === "mtproto";
|
||||
$type = $type === 'mtproto';
|
||||
$TL_dict = json_decode(file_get_contents($file), true);
|
||||
|
||||
\danog\MadelineProto\Logger::log('Translating objects...');
|
||||
|
@ -23,7 +23,7 @@ class TLConstructor
|
||||
public function add($json_dict, $mtproto)
|
||||
{
|
||||
$this->id[$this->key] = (int) $json_dict['id'];
|
||||
$this->predicate[$this->key] = (($mtproto && $json_dict['predicate'] == "message") ? "MT" : "").$json_dict['predicate'];
|
||||
$this->predicate[$this->key] = (($mtproto && $json_dict['predicate'] == 'message') ? 'MT' : '').$json_dict['predicate'];
|
||||
$this->type[$this->key] = $json_dict['type'];
|
||||
$this->params[$this->key] = $json_dict['params'];
|
||||
foreach ($this->params[$this->key] as &$param) {
|
||||
@ -46,7 +46,7 @@ class TLConstructor
|
||||
if (preg_match('/^\%/', $param['subtype'])) {
|
||||
$param['subtype'] = lcfirst(preg_replace('/^\%/', '', $param['subtype']));
|
||||
}
|
||||
$param['subtype'] = (($mtproto && $param['subtype'] == "message") ? "MT" : "").$param['subtype'];
|
||||
$param['subtype'] = (($mtproto && $param['subtype'] == 'message') ? 'MT' : '').$param['subtype'];
|
||||
}
|
||||
}
|
||||
$this->key++;
|
||||
@ -55,6 +55,7 @@ class TLConstructor
|
||||
public function find_by_predicate($predicate)
|
||||
{
|
||||
$key = array_search($predicate, $this->predicate);
|
||||
|
||||
return ($key === false) ? false : [
|
||||
'id' => $this->id[$key],
|
||||
'predicate' => $this->predicate[$key],
|
||||
|
Loading…
Reference in New Issue
Block a user