Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2018-03-04 00:00:18 +00:00 committed by StyleCI Bot
parent 88c9e18517
commit 6604623188
3 changed files with 13 additions and 12 deletions

View File

@ -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;
}
}

View File

@ -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'];