Skip to content

Commit a15d8d3

Browse files
authored
Remove unnecessary if statement in Str::length. (#46184)
1 parent d91e03a commit a15d8d3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Illuminate/Support/Str.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,7 @@ public static function kebab($value)
473473
*/
474474
public static function length($value, $encoding = null)
475475
{
476-
if ($encoding) {
477-
return mb_strlen($value, $encoding);
478-
}
479-
480-
return mb_strlen($value);
476+
return mb_strlen($value, $encoding);
481477
}
482478

483479
/**

0 commit comments

Comments
 (0)