Skip to content

Commit

Permalink
remove useless if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
hAz5 committed Mar 19, 2022
1 parent 6094c42 commit c7e1fe5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
6 changes: 1 addition & 5 deletions src/Illuminate/Support/Pluralizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ public static function inflector()
{
static $inflector;

if (is_null($inflector)) {
$inflector = InflectorFactory::createForLanguage('english')->build();
}

return $inflector;
return $inflector ?? InflectorFactory::createForLanguage('english')->build();
}
}
4 changes: 0 additions & 4 deletions src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,6 @@ public static function mask($string, $character, $index, $length = null, $encodi
return $string;
}

if (is_null($length) && PHP_MAJOR_VERSION < 8) {
$length = mb_strlen($string, $encoding);
}

$segment = mb_substr($string, $index, $length, $encoding);

if ($segment === '') {
Expand Down

0 comments on commit c7e1fe5

Please sign in to comment.