Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-09-26 12:42:22 +00:00 committed by StyleCI Bot
parent 801934775c
commit 6e368f42be
2 changed files with 4 additions and 2 deletions

View File

@ -77,7 +77,7 @@ trait CallHandler
$l = strlen($serialized); $l = strlen($serialized);
$g = strlen($gzipped = gzencode($serialized)); $g = strlen($gzipped = gzencode($serialized));
if ($l > 500 && $g < $l) { if ($l > 500 && $g < $l) {
\danog\MadelineProto\Logger::log(['Using GZIP compression for '.$method.', saved '.($l-$g).' bytes of data, reduced call size by '.($g*100/$l).'%'], \danog\MadelineProto\Logger::VERBOSE); \danog\MadelineProto\Logger::log(['Using GZIP compression for '.$method.', saved '.($l - $g).' bytes of data, reduced call size by '.($g * 100 / $l).'%'], \danog\MadelineProto\Logger::VERBOSE);
$serialized = $this->serialize_object(['type' => 'gzip_packed'], ['packed_data' => $gzipped], 'gzipped data'); $serialized = $this->serialize_object(['type' => 'gzip_packed'], ['packed_data' => $gzipped], 'gzipped data');
} }
$last_recv = $this->last_recv; $last_recv = $this->last_recv;

View File

@ -76,7 +76,9 @@ class Serialization
} catch (\danog\MadelineProto\Bug74586Exception $e) { } catch (\danog\MadelineProto\Bug74586Exception $e) {
$unserialized = \danog\Serialization::unserialize($tounserialize); $unserialized = \danog\Serialization::unserialize($tounserialize);
} catch (\danog\MadelineProto\Exception $e) { } catch (\danog\MadelineProto\Exception $e) {
if (Logger::$constructed) Logger::log([(string) $e], Logger::ERROR); if (Logger::$constructed) {
Logger::log([(string) $e], Logger::ERROR);
}
$unserialized = \danog\Serialization::unserialize($tounserialize); $unserialized = \danog\Serialization::unserialize($tounserialize);
} }
if ($unserialized instanceof \danog\PlaceHolder) { if ($unserialized instanceof \danog\PlaceHolder) {