Skip to content

Commit

Permalink
Add coeffects to preg_replace_callback (typechecker)
Browse files Browse the repository at this point in the history
Summary: Add types and coeffects to `preg_replace_callback` and `preg_replace_callback_error`.

Reviewed By: prasad223

Differential Revision: D32448943

fbshipit-source-id: 40fffc0aaa6b1a80def750d9e51654578e0f85df
  • Loading branch information
Andrii Korotkov authored and facebook-github-bot committed Dec 9, 2021
1 parent 7e8ce48 commit c8f8f0c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions hphp/hack/hhi/stdlib/builtins_preg.hhi
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,22 @@ function preg_replace_with_count_and_error(
inout ?int $error,
)[];
<<__PHPStdLib>>
function preg_replace_callback($pattern, $callback, $subject, int $limit,
inout ?int $count)[defaults];
function preg_replace_callback(
mixed $pattern,
(function(darray<arraykey, string>)[_]: string) $callback,
mixed $subject,
int $limit,
inout ?int $count,
)[ctx $callback];
<<__PHPStdLib>>
function preg_replace_callback_with_error(
$pattern,
$callback,
$subject,
mixed $pattern,
(function(darray<arraykey, string>)[_]: string) $callback,
mixed $subject,
int $limit,
inout ?int $count,
inout ?int $error,
)[defaults];
)[ctx $callback];
<<__PHPStdLib>>
function preg_replace_callback_array($patterns_and_callbacks, $subject,
int $limit, inout ?int $count)[defaults];
Expand Down

0 comments on commit c8f8f0c

Please sign in to comment.