Skip to content

Commit

Permalink
Merge pull request #83 from jawira/arrow-function
Browse files Browse the repository at this point in the history
refactor: Use arrow function in Gluer::changeWordsCase
  • Loading branch information
jawira committed Aug 14, 2022
2 parents f11ac9b + 016ddd7 commit 2be05b9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Glue/Gluer.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,9 @@ protected function changeWordsCase(array $words, int $caseMode): array
return $words;
}

$closure = static function (string $word) use ($caseMode): string {
return mb_convert_case($word, $caseMode, self::ENCODING);
};
$convertCase = static fn(string $word): string => mb_convert_case($word, $caseMode, self::ENCODING);

return array_map($closure, $words);
return array_map($convertCase, $words);
}

/**
Expand Down

0 comments on commit 2be05b9

Please sign in to comment.