Skip to content

Commit 0d569e8

Browse files
committed
Fix return type
1 parent 8248247 commit 0d569e8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

examples/dns.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
while ($nameserver === "" && ($key = array_shift($keys))) {
1818
try {
19-
$nameserver = WindowsRegistry::read($key) ?? '';
19+
$nameserver = WindowsRegistry::read($key);
2020
} catch (KeyNotFoundException $e) {
2121
}
2222
}
@@ -27,7 +27,7 @@
2727
foreach ($subKeys as $key) {
2828
foreach (["NameServer", "DhcpNameServer"] as $property) {
2929
try {
30-
$nameserver = WindowsRegistry::read("{$key}\\{$property}") ?? '';
30+
$nameserver = WindowsRegistry::read("{$key}\\{$property}");
3131

3232
if ($nameserver !== "") {
3333
break 2;

src/WindowsRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ private function __construct()
1717
// forbid instances
1818
}
1919

20-
public static function read(string $key): ?string
20+
public static function read(string $key): string
2121
{
2222
$key = \str_replace('/', "\\", $key);
2323
$parts = \explode("\\", $key);

0 commit comments

Comments
 (0)