Skip to content

Commit 3662eae

Browse files
committed
fix function signature tests
1 parent c0fee7a commit 3662eae

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Mbstring/bootstrap80.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?strin
9393
function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
9494
}
9595
if (!function_exists('mb_get_info')) {
96-
function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); }
96+
function mb_get_info(?string $type = 'all'): array|string|int|false|null { return p\Mbstring::mb_get_info((string) $type); }
9797
}
9898
if (!function_exists('mb_http_output')) {
9999
function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); }

src/Util/TestListenerTrait.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,17 @@ function {$f['name']}{$f['signature']}
129129
'array|string|null $string' => 'array|string $string',
130130
'array|string|null $from_encoding = null' => 'array|string|null $from_encoding = null',
131131
'array|string|null $from_encoding' => 'array|string $from_encoding',
132+
'string $characters = null' => '?string $characters = null',
133+
'string $charset = null' => '?string $charset = null',
134+
'string $encoding = null' => '?string $encoding = null',
135+
'string $language = null' => '?string $language = null',
136+
'string $type = null' => '?string $type = null',
137+
'int $length = null' => '?int $length = null',
132138
];
133139

134140
if (strtr($polyfillSignature, $map) !== $originalSignature) {
135-
$warnings[] = TestListener::warning("Incompatible signature for PHP >= 8:\n- {$f['name']}$originalSignature\n+ {$f['name']}$polyfillSignature");
141+
$mapped = strtr($polyfillSignature, $map);
142+
$warnings[] = TestListener::warning("Incompatible signature for PHP >= 8:\n- {$f['name']}$originalSignature\n+ {$f['name']}$polyfillSignature\nmap: $mapped");
136143
}
137144
}
138145
}

0 commit comments

Comments
 (0)