Skip to content

Commit

Permalink
Fix PHP8.4 implicit nullable deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasnetau committed Nov 27, 2024
1 parent 58cbbc7 commit 340c347
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/DohExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class DohExecutor implements ExecutorInterface {
* @param string $method
* @param ?LoopInterface $loop
*/
public function __construct(string $nameserver, string $method = self::METHOD_GET, LoopInterface $loop = null)
public function __construct(string $nameserver, string $method = self::METHOD_GET, ?LoopInterface $loop = null)
{
if (!class_exists('\React\Http\Browser')) {
throw new RuntimeException('DNS over HTTPS support requires reactphp/http library'); //@codeCoverageIgnore
Expand Down Expand Up @@ -150,18 +150,19 @@ private function getBrowser() : Promise\PromiseInterface {
if ($this->ipv6address && self::NEED_GH9356_IPV6_WORKAROUND) {
$this->initialiseIPv6Workaround($deferred);
} else {
$browser = (new Browser(new Connector([
$browser = new Browser(new Connector([
'tcp' => [
'tcp_nodelay' => true,
],
]
), $this->loop));
), $this->loop);
$deferred->resolve($browser);
}
}
return $this->browserResolution;
}

/** @codeCoverageIgnore */
protected function initialiseIPv6Workaround(Deferred $deferred) : void {
// Some versions of PHP do not validate IPv6 addresses contained in the SAN fields of a certificate
// To support IPv6 we download the certificate on the first connect and manually verify our nameserver IPv6 IP
Expand Down

0 comments on commit 340c347

Please sign in to comment.