Skip to content

Commit

Permalink
Add nullable to Preg::replaceCallbackStrictGroups (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN authored May 27, 2024
1 parent 5b16e25 commit 04229f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Preg.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public static function replaceCallback($pattern, callable $replacement, $subject
*
* @param-out int<0, max> $count
*/
public static function replaceCallbackStrictGroups(string $pattern, callable $replacement, $subject, int $limit = -1, int &$count = null, int $flags = 0): string
public static function replaceCallbackStrictGroups(string $pattern, callable $replacement, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string
{
return self::replaceCallback($pattern, function (array $matches) use ($pattern, $replacement) {
return $replacement(self::enforceNonNullMatches($pattern, $matches, 'replaceCallback'));
Expand Down

0 comments on commit 04229f1

Please sign in to comment.