Skip to content

Commit a3ca78e

Browse files
authored
Fix Null Error in str_lower() (#12)
1 parent b9046ca commit a3ca78e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ObjectHelpers/str_helpers.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ function str_limit(?string $str = null, int $limit = 100): ?string
5858
}
5959

6060
if (!function_exists('str_lower')) {
61-
function str_lower(string $str): string
61+
function str_lower(?string $str = null): ?string
6262
{
63+
if ($str == null) {
64+
return null;
65+
}
66+
6367
return Str::lower($str);
6468
}
6569
}

0 commit comments

Comments
 (0)