More style improvements
This commit is contained in:
parent
8ea90f796b
commit
40496d374e
@ -31,7 +31,7 @@ class Exception extends \Exception
|
||||
|
||||
public function __construct($message = null, $code = 0, self $previous = null, $file = null, $line = null)
|
||||
{
|
||||
$this->prettifyTl();
|
||||
$this->prettifyTL();
|
||||
if ($file !== null) {
|
||||
$this->file = $file;
|
||||
}
|
||||
|
@ -4740,7 +4740,7 @@ class InternalDoc extends APIFactory
|
||||
return $this->__call(__FUNCTION__, [$chat, $extra]);
|
||||
}
|
||||
|
||||
public function constructTl($files, $objects = [
|
||||
public function constructTL($files, $objects = [
|
||||
], array $extra = [])
|
||||
{
|
||||
return $this->__call(__FUNCTION__, [$files, $objects, $extra]);
|
||||
|
@ -31,6 +31,6 @@ class PTSException extends \Exception
|
||||
public function __construct($message, $file = '')
|
||||
{
|
||||
parent::__construct($message);
|
||||
$this->prettifyTl($file);
|
||||
$this->prettifyTL($file);
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ class RPCErrorException extends \Exception
|
||||
{
|
||||
$this->rpc = $message;
|
||||
parent::__construct($message, $code, $previous);
|
||||
$this->prettifyTl($caller);
|
||||
$this->prettifyTL($caller);
|
||||
$this->caller = $caller;
|
||||
|
||||
$additional = [];
|
||||
|
@ -36,6 +36,6 @@ class Exception extends \Exception
|
||||
public function __construct($message, $file = '')
|
||||
{
|
||||
parent::__construct($message);
|
||||
$this->prettifyTl($file);
|
||||
$this->prettifyTL($file);
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,6 @@ class Exception extends \Exception
|
||||
public function __construct($message, $file = '')
|
||||
{
|
||||
parent::__construct($message);
|
||||
$this->prettifyTl($file);
|
||||
$this->prettifyTL($file);
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ trait PrettyException
|
||||
{
|
||||
if (!$this->updated) {
|
||||
$this->updated = true;
|
||||
$this->prettifyTl($this->method, $trace);
|
||||
$this->prettifyTL($this->method, $trace);
|
||||
}
|
||||
}
|
||||
/**
|
||||
@ -76,7 +76,7 @@ trait PrettyException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function prettifyTl(string $init = '', array $trace = null)
|
||||
public function prettifyTL(string $init = '', array $trace = null)
|
||||
{
|
||||
$this->method = $init;
|
||||
$previous_trace = $this->tl_trace;
|
||||
|
@ -29,7 +29,7 @@ trait TL
|
||||
public $td_descriptions;
|
||||
public $tl_callbacks = [];
|
||||
|
||||
public function constructTl($files, $objects = [])
|
||||
public function constructTL($files, $objects = [])
|
||||
{
|
||||
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['TL_loading'], \danog\MadelineProto\Logger::VERBOSE);
|
||||
$this->updateCallbacks($objects);
|
||||
|
@ -29,9 +29,10 @@ foreach ($methods as $methodObj) {
|
||||
if (\strpos($method, '__') === 0 || $method === 'async') {
|
||||
continue;
|
||||
}
|
||||
$new = Tools::from_snake_case($method);
|
||||
$new = Tools::fromSnakeCase($method);
|
||||
$new = \str_ireplace(['mtproto', 'api'], ['MTProto', 'API'], $new);
|
||||
if (!\in_array($method, ['discard_call_async', 'accept_call_async', 'request_call_async'])) {
|
||||
$new = \preg_replace('/TL$/i', 'TL', $new);
|
||||
if (!\in_array($method, ['discardCallAsync', 'acceptCallAsync', 'requestCallAsync'])) {
|
||||
$new = \preg_replace('/async$/i', '', $new);
|
||||
}
|
||||
|
||||
@ -55,7 +56,7 @@ foreach ($methods as $methodObj) {
|
||||
$replace[] = "function $new(";
|
||||
}
|
||||
|
||||
foreach (new RegexIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(\realpath('src'))), '/\.php$/') as $filename) {
|
||||
foreach (new RegexIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(\realpath('.'))), '/\.php$/') as $filename) {
|
||||
$filename = (string) $filename;
|
||||
$new = \str_replace($find, $replace, $old = \file_get_contents($filename));
|
||||
do {
|
||||
|
Loading…
Reference in New Issue
Block a user