mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 01:34:40 +01:00
Apply fixes from StyleCI
This commit is contained in:
parent
88c9e18517
commit
6604623188
@ -18,16 +18,18 @@ namespace danog\MadelineProto\MTProtoTools;
|
||||
*/
|
||||
trait PeerHandler
|
||||
{
|
||||
|
||||
public function to_supergroup($id)
|
||||
{
|
||||
return -($id + pow(10, (int) floor(log($id, 10) + 3)));
|
||||
}
|
||||
|
||||
public function is_supergroup($id)
|
||||
{
|
||||
$log = log(-$id, 10);
|
||||
return ($log-intval($log))*1000<10;
|
||||
|
||||
return ($log - intval($log)) * 1000 < 10;
|
||||
}
|
||||
|
||||
public function add_users($users)
|
||||
{
|
||||
foreach ($users as $key => $user) {
|
||||
@ -581,5 +583,4 @@ trait PeerHandler
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -358,37 +358,37 @@ trait BotAPI
|
||||
case 'b':
|
||||
case 'strong':
|
||||
$text = $this->html_entity_decode($node->textContent);
|
||||
|
||||
|
||||
$length = $this->mb_strlen($text);
|
||||
$entities[] = ['_' => 'messageEntityBold', 'offset' => $offset, 'length' => $length];
|
||||
|
||||
|
||||
$new_message .= $text;
|
||||
$offset += $length;
|
||||
break;
|
||||
case 'i':
|
||||
case 'em':
|
||||
$text = $this->html_entity_decode($node->textContent);
|
||||
|
||||
|
||||
$length = $this->mb_strlen($text);
|
||||
$entities[] = ['_' => 'messageEntityItalic', 'offset' => $offset, 'length' => $length];
|
||||
|
||||
|
||||
$new_message .= $text;
|
||||
$offset += $length;
|
||||
break;
|
||||
case 'code':
|
||||
$text = $this->html_entity_decode($node->textContent);
|
||||
|
||||
|
||||
$length = $this->mb_strlen($text);
|
||||
$entities[] = ['_' => 'messageEntityCode', 'offset' => $offset, 'length' => $length];
|
||||
|
||||
|
||||
$new_message .= $text;
|
||||
$offset += $length;
|
||||
break;
|
||||
case 'pre':
|
||||
$text = $this->html_entity_decode($node->textContent);
|
||||
|
||||
|
||||
$length = $this->mb_strlen($text);
|
||||
|
||||
|
||||
$language = $node->getAttribute('language');
|
||||
if ($language === null) {
|
||||
$language = '';
|
||||
|
@ -23,7 +23,7 @@ trait TLParams
|
||||
$param['type'] = $matches[2];
|
||||
}
|
||||
if (preg_match('/^(v|V)ector\<(.*)\>$/', $param['type'], $matches)) {
|
||||
$param['type'] = $matches[1] === 'v' ? 'vector': 'Vector t';
|
||||
$param['type'] = $matches[1] === 'v' ? 'vector' : 'Vector t';
|
||||
$param['subtype'] = $matches[2];
|
||||
$param['subtype'] = ($mtproto && $param['subtype'] === 'Message' ? 'MT' : '').$param['subtype'];
|
||||
$param['subtype'] = $mtproto && $param['subtype'] === '%Message' ? '%MTMessage' : $param['subtype'];
|
||||
|
Loading…
Reference in New Issue
Block a user