Skip to content

Commit d684094

Browse files
committed
fix function signatures for parity with native functions in PHP 8
1 parent c0fee7a commit d684094

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Iconv/bootstrap80.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,22 @@ function iconv_mime_decode($string, $mode = 0, $encoding = null) { $currentMbEnc
5959
} else {
6060
if (!function_exists('iconv_strlen')) {
6161
if (extension_loaded('xml')) {
62-
function iconv_strlen(?string $string, ?string $encoding = null): int|false { return p\Iconv::strlen1((string) $string, $encoding); }
62+
function iconv_strlen(string $string, ?string $encoding = null): int|false { return p\Iconv::strlen1((string) $string, $encoding); }
6363
} else {
64-
function iconv_strlen(?string $string, ?string $encoding = null): int|false { return p\Iconv::strlen2((string) $string, $encoding); }
64+
function iconv_strlen(string $string, ?string $encoding = null): int|false { return p\Iconv::strlen2((string) $string, $encoding); }
6565
}
6666
}
6767

6868
if (!function_exists('iconv_strpos')) {
69-
function iconv_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Iconv::iconv_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
69+
function iconv_strpos(string $haystack, string $needle, int $offset = 0, ?string $encoding = null): int|false { return p\Iconv::iconv_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
7070
}
7171
if (!function_exists('iconv_strrpos')) {
72-
function iconv_strrpos(?string $haystack, ?string $needle, ?string $encoding = null): int|false { return p\Iconv::iconv_strrpos((string) $haystack, (string) $needle, $encoding); }
72+
function iconv_strrpos(string $haystack, string $needle, ?string $encoding = null): int|false { return p\Iconv::iconv_strrpos((string) $haystack, (string) $needle, $encoding); }
7373
}
7474
if (!function_exists('iconv_substr')) {
75-
function iconv_substr(?string $string, ?int $offset, ?int $length = null, ?string $encoding = null): string|false { return p\Iconv::iconv_substr((string) $string, (string) $offset, $length, $encoding); }
75+
function iconv_substr(string $string, int $offset, ?int $length = null, ?string $encoding = null): string|false { return p\Iconv::iconv_substr((string) $string, (string) $offset, $length, $encoding); }
7676
}
7777
if (!function_exists('iconv_mime_decode')) {
78-
function iconv_mime_decode(?string $string, ?int $mode = 0, ?string $encoding = null): string|false { return p\Iconv::iconv_mime_decode((string) $string, (int) $mode, $encoding); }
78+
function iconv_mime_decode(string $string, int $mode = 0, ?string $encoding = null): string|false { return p\Iconv::iconv_mime_decode((string) $string, (int) $mode, $encoding); }
7979
}
8080
}

0 commit comments

Comments
 (0)