From 04df3f7e9a4b2685fdbe76d50c02ac6aef28393e Mon Sep 17 00:00:00 2001 From: Ped Date: Sat, 8 Jul 2023 20:37:13 +0200 Subject: [PATCH] Fix erroneous typehint Fixes the error `{closure}(): Argument #1 ($match) must be of type Illuminate\Support\Stringable, array given` --- helpers.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/helpers.md b/helpers.md index 97ad81f047e..61ea66402bf 100644 --- a/helpers.md +++ b/helpers.md @@ -3003,10 +3003,9 @@ The `replaceMatches` method replaces all portions of a string matching a pattern The `replaceMatches` method also accepts a closure that will be invoked with each portion of the string matching the given pattern, allowing you to perform the replacement logic within the closure and return the replaced value: use Illuminate\Support\Str; - use Illuminate\Support\Stringable; - $replaced = Str::of('123')->replaceMatches('/\d/', function (Stringable $match) { - return '['.$match[0].']'; + $replaced = Str::of('123')->replaceMatches('/\d/', function (array $matches) { + return '['.$matches[0].']'; }); // '[1][2][3]'