1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 07:58:58 +01:00

Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-01-29 21:42:53 +00:00 committed by StyleCI Bot
parent aadd278c5a
commit 7f5b798427
2 changed files with 20 additions and 9 deletions

View File

@ -116,7 +116,10 @@ trait UpdateHandler
public function set_channel_state($channel, $data)
{
if (isset($data['pts']) && $data['pts'] !== 0) { $this->should_serialize = true; $this->get_channel_state($channel)['pts'] = $data['pts']; };
if (isset($data['pts']) && $data['pts'] !== 0) {
$this->should_serialize = true;
$this->get_channel_state($channel)['pts'] = $data['pts'];
}
}
public function get_channel_difference($channel)
@ -165,9 +168,18 @@ trait UpdateHandler
public function set_update_state($data)
{
if (isset($data['pts']) && $data['pts'] !== 0) { $this->should_serialize = true; $this->get_update_state()['pts'] = $data['pts']; };
if (isset($data['seq']) && $data['seq'] !== 0) { $this->should_serialize = true; $this->get_update_state()['seq'] = $data['seq']; };
if (isset($data['date']) && $data['date'] > $this->get_update_state()['date']) { $this->should_serialize = true; $this->get_update_state()['date'] = $data['date']; };
if (isset($data['pts']) && $data['pts'] !== 0) {
$this->should_serialize = true;
$this->get_update_state()['pts'] = $data['pts'];
}
if (isset($data['seq']) && $data['seq'] !== 0) {
$this->should_serialize = true;
$this->get_update_state()['seq'] = $data['seq'];
}
if (isset($data['date']) && $data['date'] > $this->get_update_state()['date']) {
$this->should_serialize = true;
$this->get_update_state()['date'] = $data['date'];
}
}
public function &get_update_state()
@ -334,7 +346,6 @@ trait UpdateHandler
if ($channel_id !== false && isset($options['date']) && $this->get_update_state()['date'] < $options['date']) {
$this->get_update_state()['date'] = $options['date'];
$this->should_serialize = true;
}
} elseif ($channel_id === false && isset($options['seq']) && $options['seq'] > 0) {
$seq = $options['seq'];