Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-06-01 01:26:49 +00:00 committed by StyleCI Bot
parent af4f6d37b8
commit 1c616b8e99
2 changed files with 5 additions and 2 deletions

View File

@ -24,6 +24,7 @@ class DataCenter extends \Volatile
public $curdc = 0; public $curdc = 0;
public $dclist = []; public $dclist = [];
public $settings = []; public $settings = [];
/* /*
public $i = []; public $i = [];
public function __get($name) { public function __get($name) {

View File

@ -243,7 +243,7 @@ class MTProto extends \Volatile
if ($nearest_dc['nearest_dc'] != $nearest_dc['this_dc']) { if ($nearest_dc['nearest_dc'] != $nearest_dc['this_dc']) {
$this->datacenter->curdc = (int) $nearest_dc['nearest_dc']; $this->datacenter->curdc = (int) $nearest_dc['nearest_dc'];
$this->settings['connection_settings']['default_dc'] = (int)$nearest_dc['nearest_dc']; $this->settings['connection_settings']['default_dc'] = (int) $nearest_dc['nearest_dc'];
$this->should_serialize = true; $this->should_serialize = true;
} }
} catch (RPCErrorException $e) { } catch (RPCErrorException $e) {
@ -706,7 +706,9 @@ class MTProto extends \Volatile
$id .= $dc['media_only'] ? '_media' : ''; $id .= $dc['media_only'] ? '_media' : '';
$ipv6 = ($dc['ipv6'] ? 'ipv6' : 'ipv4'); $ipv6 = ($dc['ipv6'] ? 'ipv6' : 'ipv4');
$id .= (isset($this->settings['connection'][$test][$ipv6][$id]) && $this->settings['connection'][$test][$ipv6][$id]['ip_address'] != $dc['ip_address']) ? '_bk' : ''; $id .= (isset($this->settings['connection'][$test][$ipv6][$id]) && $this->settings['connection'][$test][$ipv6][$id]['ip_address'] != $dc['ip_address']) ? '_bk' : '';
if (is_numeric($id)) $id = (int)$id; if (is_numeric($id)) {
$id = (int) $id;
}
$this->settings['connection'][$test][$ipv6][$id] = $dc; $this->settings['connection'][$test][$ipv6][$id] = $dc;
} }
$this->datacenter->__construct($this->settings['connection'], $this->settings['connection_settings']); $this->datacenter->__construct($this->settings['connection'], $this->settings['connection_settings']);