Fixes to DocsBuilder

This commit is contained in:
Daniil Gentili 2017-09-28 19:38:43 +02:00
parent 209cedb6d1
commit 7a21c25e35
3 changed files with 18 additions and 8 deletions

View File

@ -422,6 +422,16 @@ description: A 32 bit signed integer ranging from -2147483648 to 2147483647
[Back to constructor index](index.md) [Back to constructor index](index.md)
A 32 bit signed integer ranging from `-2147483648` to `2147483647`. A 32 bit signed integer ranging from `-2147483648` to `2147483647`.
');
file_put_contents('types/int53.md', '---
title: integer
description: A 53 bit signed integer
---
## Type: int53
[Back to constructor index](index.md)
A 53 bit signed integer.
'); ');
file_put_contents('types/long.md', '--- file_put_contents('types/long.md', '---

View File

@ -54,12 +54,12 @@ trait Constructors
if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) { if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) {
continue; continue;
} }
if ($type === 'EncryptedMessage' && $param['name'] === 'bytes') { if ($type === 'EncryptedMessage' && $param['name'] === 'bytes' && !isset($this->settings['td'])) {
$param['name'] = 'decrypted_message'; $param['name'] = 'decrypted_message';
$param['type'] = 'DecryptedMessage'; $param['type'] = 'DecryptedMessage';
} }
$type_or_subtype = isset($param['subtype']) ? 'subtype' : 'type'; $type_or_subtype = isset($param['subtype']) ? 'subtype' : 'type';
$type_or_bare_type = (ctype_upper($this->end(explode('.', $param[$type_or_subtype]))[0]) || in_array($param[$type_or_subtype], ['!X', 'X', 'bytes', 'true', 'false', 'double', 'string', 'Bool', 'int', 'long', 'int128', 'int256', 'int512'])) ? 'types' : 'constructors'; $type_or_bare_type = (ctype_upper($this->end(explode('.', $param[$type_or_subtype]))[0]) || in_array($param[$type_or_subtype], ['!X', 'X', 'bytes', 'true', 'false', 'double', 'string', 'Bool', 'int53', 'int', 'long', 'int128', 'int256', 'int512'])) ? 'types' : 'constructors';
$param[$type_or_subtype] = str_replace(['.', 'true', 'false'], ['_', 'Bool', 'Bool'], $param[$type_or_subtype]); $param[$type_or_subtype] = str_replace(['.', 'true', 'false'], ['_', 'Bool', 'Bool'], $param[$type_or_subtype]);
@ -95,7 +95,7 @@ trait Constructors
if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) { if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) {
continue; continue;
} }
if ($type === 'EncryptedMessage' && $param['name'] === 'bytes') { if ($type === 'EncryptedMessage' && $param['name'] === 'bytes' && !isset($this->settings['td'])) {
$param['name'] = 'decrypted_message'; $param['name'] = 'decrypted_message';
$param['type'] = 'DecryptedMessage'; $param['type'] = 'DecryptedMessage';
} }

View File

@ -48,15 +48,15 @@ trait Methods
if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) { if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) {
continue; continue;
} }
if ($param['name'] === 'data' && $type === 'messages_SentEncryptedMessage') { if ($param['name'] === 'data' && $type === 'messages_SentEncryptedMessage' && !isset($this->settings['td'])) {
$param['name'] = 'message'; $param['name'] = 'message';
$param['type'] = 'DecryptedMessage'; $param['type'] = 'DecryptedMessage';
} }
if ($param['name'] === 'chat_id' && $data['method'] !== 'messages.discardEncryption') { if ($param['name'] === 'chat_id' && $data['method'] !== 'messages.discardEncryption' && !isset($this->settings['td'])) {
$param['type'] = 'InputPeer'; $param['type'] = 'InputPeer';
} }
$type_or_subtype = isset($param['subtype']) ? 'subtype' : 'type'; $type_or_subtype = isset($param['subtype']) ? 'subtype' : 'type';
$type_or_bare_type = (ctype_upper($this->end(explode('.', $param[$type_or_subtype]))[0]) || in_array($param[$type_or_subtype], ['!X', 'X', 'bytes', 'true', 'false', 'double', 'string', 'Bool', 'int', 'long', 'int128', 'int256', 'int512'])) ? 'types' : 'constructors'; $type_or_bare_type = (ctype_upper($this->end(explode('.', $param[$type_or_subtype]))[0]) || in_array($param[$type_or_subtype], ['!X', 'X', 'bytes', 'true', 'false', 'double', 'string', 'Bool', 'int', 'long', 'int128', 'int256', 'int512', 'int53'])) ? 'types' : 'constructors';
$param[$type_or_subtype] = str_replace(['.', 'true', 'false'], ['_', 'Bool', 'Bool'], $param[$type_or_subtype]); $param[$type_or_subtype] = str_replace(['.', 'true', 'false'], ['_', 'Bool', 'Bool'], $param[$type_or_subtype]);
$param[$type_or_subtype] = '['.$this->escape($param[$type_or_subtype]).'](../'.$type_or_bare_type.'/'.$param[$type_or_subtype].'.md)'; $param[$type_or_subtype] = '['.$this->escape($param[$type_or_subtype]).'](../'.$type_or_bare_type.'/'.$param[$type_or_subtype].'.md)';
@ -93,11 +93,11 @@ trait Methods
if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) { if (in_array($param['name'], ['flags', 'random_id', 'random_bytes'])) {
continue; continue;
} }
if ($param['name'] === 'data' && $type === 'messages_SentEncryptedMessage') { if ($param['name'] === 'data' && $type === 'messages_SentEncryptedMessage' && !isset($this->settings['td'])) {
$param['name'] = 'message'; $param['name'] = 'message';
$param['type'] = 'DecryptedMessage'; $param['type'] = 'DecryptedMessage';
} }
if ($param['name'] === 'chat_id' && $data['method'] !== 'messages.discardEncryption') { if ($param['name'] === 'chat_id' && $data['method'] !== 'messages.discardEncryption' && !isset($this->settings['td'])) {
$param['type'] = 'InputPeer'; $param['type'] = 'InputPeer';
} }