Apply fixes from StyleCI
This commit is contained in:
parent
fa1183b25e
commit
9fd4b22c42
@ -51,7 +51,6 @@ mkdir('methods');
|
||||
|
||||
$methods = [];
|
||||
|
||||
|
||||
$types = [];
|
||||
\danog\MadelineProto\Logger::log('Generating methods documentation...');
|
||||
|
||||
@ -59,10 +58,11 @@ foreach ($TL->methods->method as $key => $method) {
|
||||
$type = str_replace(['.', '<', '>'], ['_', '_of_', ''], $TL->methods->type[$key]);
|
||||
$real_type = preg_replace('/.*_of_/', '', $type);
|
||||
|
||||
|
||||
$params = '';
|
||||
foreach ($TL->methods->params[$key] as $param) {
|
||||
if ($param['name'] == 'flags') continue;
|
||||
if ($param['name'] == 'flags') {
|
||||
continue;
|
||||
}
|
||||
$stype = 'type';
|
||||
$link_type = 'types';
|
||||
if (isset($param['subtype'])) {
|
||||
@ -84,13 +84,14 @@ foreach ($TL->methods->method as $key => $method) {
|
||||
|
||||
');
|
||||
|
||||
|
||||
$params = '';
|
||||
$table = '| Name | Type | Required |
|
||||
|----------|:-------------:|---------:|
|
||||
';
|
||||
foreach ($TL->methods->params[$key] as $param) {
|
||||
if ($param['name'] == 'flags') continue;
|
||||
if ($param['name'] == 'flags') {
|
||||
continue;
|
||||
}
|
||||
$ptype = str_replace('.', '_', $param[isset($param['subtype']) ? 'subtype' : 'type']);
|
||||
switch ($ptype) {
|
||||
case 'true':
|
||||
@ -102,7 +103,6 @@ foreach ($TL->methods->method as $key => $method) {
|
||||
|
||||
$params .= "'".$param['name']."' => ";
|
||||
$params .= (isset($param['subtype']) ? '['.$ptype.']' : $ptype).', ';
|
||||
|
||||
}
|
||||
$example = str_replace('[]', '', '
|
||||
```
|
||||
@ -151,9 +151,7 @@ file_put_contents('methods/index.md', '# Methods
|
||||
}
|
||||
</style>
|
||||
<div class="container">
|
||||
'.join('', $methods).'</div>');
|
||||
|
||||
|
||||
'.implode('', $methods).'</div>');
|
||||
|
||||
foreach (glob('constructors/*') as $unlink) {
|
||||
unlink($unlink);
|
||||
@ -177,7 +175,9 @@ foreach ($TL->constructors->predicate as $key => $constructor) {
|
||||
|
||||
$params = '';
|
||||
foreach ($TL->constructors->params[$key] as $param) {
|
||||
if ($param['name'] == 'flags') continue;
|
||||
if ($param['name'] == 'flags') {
|
||||
continue;
|
||||
}
|
||||
$stype = 'type';
|
||||
$link_type = 'types';
|
||||
if (isset($param['subtype'])) {
|
||||
@ -187,7 +187,6 @@ foreach ($TL->constructors->predicate as $key => $constructor) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$ptype = str_replace('.', '_', $param[$stype]);
|
||||
switch ($ptype) {
|
||||
case 'true':
|
||||
@ -202,7 +201,6 @@ foreach ($TL->constructors->predicate as $key => $constructor) {
|
||||
|
||||
');
|
||||
|
||||
|
||||
if (!isset($types[$real_type])) {
|
||||
$types[$real_type] = [];
|
||||
}
|
||||
@ -215,7 +213,9 @@ foreach ($TL->constructors->predicate as $key => $constructor) {
|
||||
|----------|:-------------:|---------:|
|
||||
';
|
||||
foreach ($TL->constructors->params[$key] as $param) {
|
||||
if ($param['name'] == 'flags') continue;
|
||||
if ($param['name'] == 'flags') {
|
||||
continue;
|
||||
}
|
||||
$ptype = str_replace('.', '_', $param[isset($param['subtype']) ? 'subtype' : 'type']);
|
||||
|
||||
$link_type = 'types';
|
||||
@ -234,7 +234,6 @@ foreach ($TL->constructors->predicate as $key => $constructor) {
|
||||
|
||||
$params .= "'".$param['name']."' => ";
|
||||
$params .= (isset($param['subtype']) ? '['.$ptype.']' : $ptype).', ';
|
||||
|
||||
}
|
||||
$example = str_replace('[]', '', '
|
||||
```
|
||||
@ -254,7 +253,6 @@ $'.$constructor.' = ['.$params.'];
|
||||
file_put_contents('constructors/'.$constructor.'.md', $header.$example);
|
||||
}
|
||||
|
||||
|
||||
\danog\MadelineProto\Logger::log('Generating constructors index...');
|
||||
|
||||
ksort($constructors);
|
||||
@ -270,8 +268,7 @@ file_put_contents('constructors/index.md', '# Constructors
|
||||
}
|
||||
</style>
|
||||
<div class="container">
|
||||
'.join('', $constructors).'</div>');
|
||||
|
||||
'.implode('', $constructors).'</div>');
|
||||
|
||||
foreach (glob('types/*') as $unlink) {
|
||||
unlink($unlink);
|
||||
@ -316,7 +313,6 @@ foreach ($types as $type => $keys) {
|
||||
file_put_contents('types/'.$type.'.md', $header);
|
||||
}
|
||||
|
||||
|
||||
\danog\MadelineProto\Logger::log('Generating additional types...');
|
||||
|
||||
file_put_contents('types/string.md', '## Type: string
|
||||
|
@ -27,7 +27,6 @@ class MTProto extends PrimeModule
|
||||
use \danog\MadelineProto\MTProtoTools\SaltHandler;
|
||||
use \danog\MadelineProto\MTProtoTools\SeqNoHandler;
|
||||
|
||||
|
||||
public $settings = [];
|
||||
public $authorized = false;
|
||||
public $waiting_code = false;
|
||||
@ -284,7 +283,6 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB
|
||||
\danog\MadelineProto\Logger::log('Generating temporary authorization key...');
|
||||
$this->datacenter->temp_auth_key = $this->create_auth_key($this->settings['authorization']['default_temp_auth_key_expires_in']);
|
||||
$this->bind_temp_auth_key($this->settings['authorization']['default_temp_auth_key_expires_in']);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,6 @@ trait MessageHandler
|
||||
$this->parse_config();
|
||||
throw new \danog\MadelineProto\Exception('I had to recreate the temporary authorization key');
|
||||
}
|
||||
|
||||
}
|
||||
throw new \danog\MadelineProto\RPCErrorException($error, $error);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user