From 193b3ccc9098b4e1d68459ffc4c8a20136ae5c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 4 Dec 2021 15:45:54 +0100 Subject: [PATCH] Support PHP 8.1 --- composer.json | 2 +- phpunit.xml.dist | 3 ++- src/DnsConnector.php | 4 +++- src/HappyEyeBallsConnector.php | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 9ff445f3..44805eac 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "react/dns": "^1.8", "react/event-loop": "^1.2", "react/promise": "^2.6.0 || ^1.2.1", - "react/promise-timer": "^1.4.0", + "react/promise-timer": "^1.8", "react/stream": "^1.2" }, "require-dev": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index fa88e7e0..93a36f6b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,8 +4,9 @@ + convertDeprecationsToExceptions="true"> ./tests/ diff --git a/src/DnsConnector.php b/src/DnsConnector.php index 0b51a52c..4f91bcb7 100644 --- a/src/DnsConnector.php +++ b/src/DnsConnector.php @@ -23,7 +23,9 @@ public function connect($uri) if (\strpos($uri, '://') === false) { $uri = 'tcp://' . $uri; $parts = \parse_url($uri); - unset($parts['scheme']); + if (isset($parts['scheme'])) { + unset($parts['scheme']); + } } else { $parts = \parse_url($uri); } diff --git a/src/HappyEyeBallsConnector.php b/src/HappyEyeBallsConnector.php index 0a7c6ecb..19af2607 100644 --- a/src/HappyEyeBallsConnector.php +++ b/src/HappyEyeBallsConnector.php @@ -35,7 +35,9 @@ public function connect($uri) if (\strpos($uri, '://') === false) { $uri = 'tcp://' . $uri; $parts = \parse_url($uri); - unset($parts['scheme']); + if (isset($parts['scheme'])) { + unset($parts['scheme']); + } } else { $parts = \parse_url($uri); }