diff --git a/composer.json b/composer.json index ac612ef5..f1bc5281 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "krakjoe/pthreads-polyfill": "*" }, "require": { - "php": ">=5.6.0", + "php": ">=7.1.0", "danog/primemodule": "^1.0.3", "danog/magicalserializer": "^1.0", "phpseclib/phpseclib": "dev-master#27370df as 2.0.15", @@ -25,11 +25,11 @@ "amphp/log": "^1.0", "amphp/parser": "^1.0", "amphp/dns": "dev-master#861cc857b1ba6e02e8a7439c30403682785fce96 as 0.9.9", - "amphp/file": "dev-master#5a69fca406ac5fd220de0aa68c887bc8046eb93c as 0.3.3", - "amphp/uri": "dev-master#f3195b163275383909ded7770a11d8eb865cbc86 as 0.1.3", "amphp/websocket": "dev-master", "amphp/websocket-client": "dev-master", - "amphp/artax": "^3.0" + "amphp/artax": "^3.0", + "amphp/file": "^0.3.5", + "amphp/uri": "dev-master as 0.1.4" }, "require-dev": { "phpdocumentor/reflection-docblock": "^3.1", @@ -37,8 +37,7 @@ "phpunit/phpunit": "^8" }, "suggest": { - "ext-libtgvoip": "Install the php-libtgvoip extension to make phone calls (https://github.com/danog/php-libtgvoip)", - "ext-sockets": "Install the socket extension to speed up MadelineProto" + "ext-libtgvoip": "Install the php-libtgvoip extension to make phone calls (https://github.com/danog/php-libtgvoip)" }, "authors": [ { diff --git a/src/danog/MadelineProto/Connection.php b/src/danog/MadelineProto/Connection.php index eb19071d..445e05ad 100644 --- a/src/danog/MadelineProto/Connection.php +++ b/src/danog/MadelineProto/Connection.php @@ -158,7 +158,7 @@ class Connection } - public function sendMessage($message, $flush = true): \Generator + public function sendMessage($message, $flush = true) { $deferred = new Deferred(); @@ -191,7 +191,7 @@ class Connection $this->writer->resume(); } - return yield $deferred->promise(); + return $deferred->promise(); } public function setExtra($extra) diff --git a/src/danog/MadelineProto/DataCenter.php b/src/danog/MadelineProto/DataCenter.php index c716851b..d67e4708 100644 --- a/src/danog/MadelineProto/DataCenter.php +++ b/src/danog/MadelineProto/DataCenter.php @@ -257,7 +257,7 @@ class DataCenter list($first, $second) = [array_slice($orig, 0, 2), array_slice($orig, 2)]; $first[] = [$proxy, $extra]; $combo = array_merge($first, $second); - } elseif ($orig[1][0] === WssStream::getName()) { + } elseif (in_array($orig[1][0], [WsStream::getName(), WssStream::getName()])) { list($first, $second) = [array_slice($orig, 0, 1), array_slice($orig, 1)]; $first[] = [BufferedRawStream::getName(), []]; $first[] = [$proxy, $extra];