Update composer dependencies

This commit is contained in:
Chris
2019-06-11 12:29:32 +01:00
parent 7d6df3843b
commit 1f608b1c21
1835 changed files with 74500 additions and 27482 deletions

View File

@@ -29,7 +29,7 @@ class Connection
* @param string $host The server host
* @param ContextProviderInterface[] $contextProviders Context providers indexed by context name
*/
public function __construct(string $host, array $contextProviders = array())
public function __construct(string $host, array $contextProviders = [])
{
if (false === strpos($host, '://')) {
$host = 'tcp://'.$host;
@@ -51,14 +51,14 @@ class Connection
return false;
}
$context = array('timestamp' => microtime(true));
$context = ['timestamp' => microtime(true)];
foreach ($this->contextProviders as $name => $provider) {
$context[$name] = $provider->getContext();
}
$context = array_filter($context);
$encodedPayload = base64_encode(serialize(array($data, $context)))."\n";
$encodedPayload = base64_encode(serialize([$data, $context]))."\n";
set_error_handler(array(self::class, 'nullErrorHandler'));
set_error_handler([self::class, 'nullErrorHandler']);
try {
if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) {
return true;
@@ -85,13 +85,11 @@ class Connection
private function createSocket()
{
set_error_handler(array(self::class, 'nullErrorHandler'));
set_error_handler([self::class, 'nullErrorHandler']);
try {
return stream_socket_client($this->host, $errno, $errstr, 3, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT);
} finally {
restore_error_handler();
}
return $socket;
}
}