Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2018-07-13 15:21:08 +00:00 committed by StyleCI Bot
parent 94f20292c3
commit 90896a46df
3 changed files with 7 additions and 6 deletions

View File

@ -65,7 +65,6 @@ class CombinedAPI
foreach ($paths as $path => $settings) { foreach ($paths as $path => $settings) {
$this->addInstance($path, $settings); $this->addInstance($path, $settings);
} }
} }
public function addInstance($path, $settings = []) public function addInstance($path, $settings = [])
@ -74,6 +73,7 @@ class CombinedAPI
if (isset($this->event_handler_instance)) { if (isset($this->event_handler_instance)) {
$this->event_handler_instance->referenceInstance($path); $this->event_handler_instance->referenceInstance($path);
} }
return; return;
} }
@ -172,7 +172,7 @@ class CombinedAPI
public function event_update_handler($update, $instance) public function event_update_handler($update, $instance)
{ {
$method_name = 'on' . ucfirst($update['_']); $method_name = 'on'.ucfirst($update['_']);
if (method_exists($this->event_handler_instance, $method_name)) { if (method_exists($this->event_handler_instance, $method_name)) {
$this->event_handler_instance->$method_name($update, $instance); $this->event_handler_instance->$method_name($update, $instance);
} elseif (method_exists($this->event_handler_instance, 'onAny')) { } elseif (method_exists($this->event_handler_instance, 'onAny')) {
@ -199,8 +199,8 @@ class CombinedAPI
} catch (\danog\MadelineProto\Exception $e) { } catch (\danog\MadelineProto\Exception $e) {
register_shutdown_function(function () { register_shutdown_function(function () {
\danog\MadelineProto\Logger::log(['Restarting script...']); \danog\MadelineProto\Logger::log(['Restarting script...']);
$a = fsockopen((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'tls' : 'tcp') . '://' . $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT']); $a = fsockopen((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'tls' : 'tcp').'://'.$_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT']);
fwrite($a, $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . ' ' . $_SERVER['SERVER_PROTOCOL'] . "\r\n" . 'Host: ' . $_SERVER['SERVER_NAME'] . "\r\n\r\n"); fwrite($a, $_SERVER['REQUEST_METHOD'].' '.$_SERVER['REQUEST_URI'].' '.$_SERVER['SERVER_PROTOCOL']."\r\n".'Host: '.$_SERVER['SERVER_NAME']."\r\n\r\n");
}); });
} }
} }
@ -236,7 +236,7 @@ class CombinedAPI
} }
foreach ($instance->API->datacenter->sockets as $id => $connection) { foreach ($instance->API->datacenter->sockets as $id => $connection) {
$read[$id . '-' . $path] = $connection->getSocket(); $read[$id.'-'.$path] = $connection->getSocket();
} }
} }
if (time() - $this->serialized > $this->serialization_interval) { if (time() - $this->serialized > $this->serialization_interval) {

View File

@ -478,6 +478,7 @@ trait PeerHandler
$this->full_chats[$partial['bot_api_id']] = $res; $this->full_chats[$partial['bot_api_id']] = $res;
$partial = $this->get_info($id); $partial = $this->get_info($id);
return array_merge($partial, $res); return array_merge($partial, $res);
} }

View File

@ -315,7 +315,7 @@ trait ResponseHandler
if (isset($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['chat'])) { if (isset($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['chat'])) {
$this->add_chats([$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['chat']]); $this->add_chats([$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['chat']]);
} }
if (isset($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['result']['users'])) { if (isset($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['result']['users'])) {
$this->add_users($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['result']['users']); $this->add_users($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['result']['users']);
} }