Apply fixes from StyleCI
This commit is contained in:
parent
cf974a2d0a
commit
a5246e782d
@ -192,6 +192,7 @@ class CustomHTTPProxy implements \danog\MadelineProto\Proxy
|
||||
{
|
||||
$this->options = $extra;
|
||||
}
|
||||
|
||||
public function getResource()
|
||||
{
|
||||
return $this->sock->getResource();
|
||||
|
@ -185,6 +185,7 @@ class HttpProxy implements \danog\MadelineProto\Proxy
|
||||
public function getProxyHeaders()
|
||||
{
|
||||
}
|
||||
|
||||
public function getResource()
|
||||
{
|
||||
return $this->sock->getResource();
|
||||
|
@ -97,14 +97,21 @@ If not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
$res = stream_select($actual_read, $actual_write, $actual_except, $tv_sec, $tv_usec);
|
||||
foreach ($read as $key => $resource) {
|
||||
if (!isset($actual_read[$key])) unset($read[$key]);
|
||||
if (!isset($actual_read[$key])) {
|
||||
unset($read[$key]);
|
||||
}
|
||||
}
|
||||
foreach ($write as $key => $resource) {
|
||||
if (!isset($actual_write[$key])) unset($write[$key]);
|
||||
if (!isset($actual_write[$key])) {
|
||||
unset($write[$key]);
|
||||
}
|
||||
}
|
||||
foreach ($except as $key => $resource) {
|
||||
if (!isset($actual_except[$key])) unset($except[$key]);
|
||||
if (!isset($actual_except[$key])) {
|
||||
unset($except[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -147,6 +154,7 @@ If not, see <http://www.gnu.org/licenses/>.
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getResource()
|
||||
{
|
||||
return $this->sock;
|
||||
@ -233,17 +241,23 @@ if (!extension_loaded('pthreads')) {
|
||||
}
|
||||
$res = socket_select($actual_read, $actual_write, $actual_except, $tv_sec, $tv_usec);
|
||||
foreach ($read as $key => $resource) {
|
||||
if (!isset($actual_read[$key])) unset($read[$key]);
|
||||
if (!isset($actual_read[$key])) {
|
||||
unset($read[$key]);
|
||||
}
|
||||
}
|
||||
foreach ($write as $key => $resource) {
|
||||
if (!isset($actual_write[$key])) unset($write[$key]);
|
||||
if (!isset($actual_write[$key])) {
|
||||
unset($write[$key]);
|
||||
}
|
||||
}
|
||||
foreach ($except as $key => $resource) {
|
||||
if (!isset($actual_except[$key])) unset($except[$key]);
|
||||
if (!isset($actual_except[$key])) {
|
||||
unset($except[$key]);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function read(int $length, int $flags = 0)
|
||||
{
|
||||
@ -288,6 +302,7 @@ if (!extension_loaded('pthreads')) {
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getResource()
|
||||
{
|
||||
return $this->sock;
|
||||
|
@ -413,6 +413,7 @@ class Connection
|
||||
|
||||
return ['protocol' => $protocol, 'code' => $code, 'description' => $description, 'body' => $read, 'headers' => $headers];
|
||||
}
|
||||
|
||||
public function getSocket()
|
||||
{
|
||||
return $this->sock;
|
||||
|
@ -144,15 +144,17 @@ class DataCenter
|
||||
|
||||
return $all ? array_keys((array) $this->dclist[$test][$ipv6]) : array_keys((array) $this->sockets);
|
||||
}
|
||||
|
||||
public function select()
|
||||
{
|
||||
$read = [];
|
||||
$write = [];
|
||||
$except = [];
|
||||
foreach ($this->sockets as $dc_id => $socket) {
|
||||
$read [$dc_id] = $socket->getSocket();
|
||||
$read[$dc_id] = $socket->getSocket();
|
||||
}
|
||||
\Socket::select($read, $write, $except, 0);
|
||||
|
||||
return array_keys($read);
|
||||
}
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ if (!extension_loaded('php-libtgvoip') && false) {
|
||||
private function init_all()
|
||||
{
|
||||
foreach ($this->datacenter->sockets as $dc_id => $socket) {
|
||||
if ($socket->auth_key === NULL) {
|
||||
if ($socket->auth_key === null) {
|
||||
$socket->auth_key = ['id' => $this->configuration['auth_key_id'], 'auth_key' => $this->configuration['auth_key']];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user