Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-07-23 15:44:47 +00:00 committed by StyleCI Bot
parent 9b58979ed0
commit 2d6f6369dd
2 changed files with 15 additions and 9 deletions

View File

@ -76,12 +76,12 @@ class MTProto extends \Volatile
'updates.getDifference' => 'You cannot use this method directly, see https://daniil.it/MadelineProto for more info on handling updates',
'updates.getState' => 'You cannot use this method directly, see https://daniil.it/MadelineProto for more info on handling updates',
'upload.getCdnFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://daniil.it/MadelineProto for more info',
'upload.getCdnFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://daniil.it/MadelineProto for more info',
'upload.getCdnFileHashes' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://daniil.it/MadelineProto for more info',
'upload.reuploadCdnFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://daniil.it/MadelineProto for more info',
'upload.getFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://daniil.it/MadelineProto for more info',
'upload.saveFilePart' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://daniil.it/MadelineProto for more info',
'upload.saveBigFilePart' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://daniil.it/MadelineProto for more info',
'upload.reuploadCdnFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://daniil.it/MadelineProto for more info',
'upload.getFile' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://daniil.it/MadelineProto for more info',
'upload.saveFilePart' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://daniil.it/MadelineProto for more info',
'upload.saveBigFilePart' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://daniil.it/MadelineProto for more info',
];
const BAD_MSG_ERROR_CODES = [

View File

@ -353,8 +353,11 @@ trait Files
return true;
}
private $cdn_hashes = [];
private function add_cdn_hashes($file, $hashes) {
private function add_cdn_hashes($file, $hashes)
{
if (!isset($this->cdn_hashes[$file])) {
$this->cdn_hashes = [];
}
@ -362,7 +365,9 @@ trait Files
$this->cdn_hashes[$file][$hash['offset']] = ['limit' => $hash['limit'], 'hash' => $hash['hash']];
}
}
private function check_cdn_hashes($file, $offset, $data, &$datacenter) {
private function check_cdn_hashes($file, $offset, $data, &$datacenter)
{
if (!isset($this->cdn_hashes[$file][$offset])) {
$this->add_cdn_hashes($this->method_call('upload.getCdnFileHashes', ['file_token' => $file, 'offset' => $offset], ['datacenter' => &$datacenter]));
}
@ -373,7 +378,8 @@ trait Files
throw new \danog\MadelineProto\SecurityException('CDN hashe mismatch for offset '.$offset);
}
}
private function clear_cdn_hashes($file) {
private function clear_cdn_hashes($file)
{
}
}