diff --git a/composer.json b/composer.json index 5bbba89..dbfc88d 100644 --- a/composer.json +++ b/composer.json @@ -39,15 +39,15 @@ "php": ">=8", "ext-json": "*", "ext-filter": "*", - "amphp/amp": "v3.x-dev", - "amphp/byte-stream": "v2.x-dev", - "amphp/cache": "v2.x-dev", + "amphp/amp": "^3", + "amphp/byte-stream": "^2", + "amphp/cache": "^2", "amphp/parser": "^1", - "amphp/windows-registry": "v1.x-dev", - "daverandom/libdns": "^2.0.1" + "amphp/windows-registry": "^1", + "daverandom/libdns": "^2.0.2" }, "require-dev": { - "amphp/phpunit-util": "v2.x-dev", + "amphp/phpunit-util": "^3", "phpunit/phpunit": "^9", "amphp/php-cs-fixer-config": "dev-master" }, diff --git a/lib/Internal/Socket.php b/lib/Internal/Socket.php index df1d8a5..284afd5 100644 --- a/lib/Internal/Socket.php +++ b/lib/Internal/Socket.php @@ -3,8 +3,8 @@ namespace Amp\Dns\Internal; use Amp\ByteStream\ReadableResourceStream; -use Amp\ByteStream\WritableResourceStream; use Amp\ByteStream\StreamException; +use Amp\ByteStream\WritableResourceStream; use Amp\CancelledException; use Amp\DeferredFuture; use Amp\Dns\DnsException; diff --git a/lib/Internal/TcpSocket.php b/lib/Internal/TcpSocket.php index 304292a..2aa2103 100644 --- a/lib/Internal/TcpSocket.php +++ b/lib/Internal/TcpSocket.php @@ -45,7 +45,7 @@ final class TcpSocket extends Socket } } - public static function parser(callable $callback): \Generator + private static function parser(callable $callback): \Generator { $decoder = (new DecoderFactory)->create(); diff --git a/lib/Rfc1035StubResolver.php b/lib/Rfc1035StubResolver.php index 0645a91..b0714bc 100644 --- a/lib/Rfc1035StubResolver.php +++ b/lib/Rfc1035StubResolver.php @@ -2,8 +2,8 @@ namespace Amp\Dns; -use Amp\Cache\ArrayCache; use Amp\Cache\Cache; +use Amp\Cache\LocalCache; use Amp\CompositeException; use Amp\Dns\Internal\Socket; use Amp\Dns\Internal\TcpSocket; @@ -51,7 +51,7 @@ final class Rfc1035StubResolver implements Resolver public function __construct(Cache $cache = null, ConfigLoader $configLoader = null) { - $this->cache = $cache ?? new ArrayCache(maxSize: 256); + $this->cache = $cache ?? new LocalCache(sizeLimit: 256); $this->configLoader = $configLoader ?? (\stripos(PHP_OS, "win") === 0 ? new WindowsConfigLoader : new UnixConfigLoader);