Skip to content

Commit

Permalink
Remove unnecessary if statement in Str::length. (#46184)
Browse files Browse the repository at this point in the history
  • Loading branch information
choowx authored Feb 21, 2023
1 parent d91e03a commit a15d8d3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,7 @@ public static function kebab($value)
*/
public static function length($value, $encoding = null)
{
if ($encoding) {
return mb_strlen($value, $encoding);
}

return mb_strlen($value);
return mb_strlen($value, $encoding);
}

/**
Expand Down

0 comments on commit a15d8d3

Please sign in to comment.