Skip to content

Commit c8f8f0c

Browse files
Andrii Korotkovfacebook-github-bot
authored andcommitted
Add coeffects to preg_replace_callback (typechecker)
Summary: Add types and coeffects to `preg_replace_callback` and `preg_replace_callback_error`. Reviewed By: prasad223 Differential Revision: D32448943 fbshipit-source-id: 40fffc0aaa6b1a80def750d9e51654578e0f85df
1 parent 7e8ce48 commit c8f8f0c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

hphp/hack/hhi/stdlib/builtins_preg.hhi

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,22 @@ function preg_replace_with_count_and_error(
9595
inout ?int $error,
9696
)[];
9797
<<__PHPStdLib>>
98-
function preg_replace_callback($pattern, $callback, $subject, int $limit,
99-
inout ?int $count)[defaults];
98+
function preg_replace_callback(
99+
mixed $pattern,
100+
(function(darray<arraykey, string>)[_]: string) $callback,
101+
mixed $subject,
102+
int $limit,
103+
inout ?int $count,
104+
)[ctx $callback];
100105
<<__PHPStdLib>>
101106
function preg_replace_callback_with_error(
102-
$pattern,
103-
$callback,
104-
$subject,
107+
mixed $pattern,
108+
(function(darray<arraykey, string>)[_]: string) $callback,
109+
mixed $subject,
105110
int $limit,
106111
inout ?int $count,
107112
inout ?int $error,
108-
)[defaults];
113+
)[ctx $callback];
109114
<<__PHPStdLib>>
110115
function preg_replace_callback_array($patterns_and_callbacks, $subject,
111116
int $limit, inout ?int $count)[defaults];

0 commit comments

Comments
 (0)