Skip to content

Conversation

@valzargaming
Copy link
Member

This pull request refactors several parts of the codebase to use short arrow functions (fn) instead of anonymous functions (function) for simple callbacks and closures. This change improves code readability and conciseness without altering functionality.

General refactoring to use short arrow functions:

  • Updated timer and deferred callbacks to use short arrow functions in src/Discord/Discord.php and src/Discord/Helpers/Buffer.php, improving readability in event and timeout handling. [1] [2] [3] [4]
  • Replaced anonymous functions with short arrow functions in collection and filtering operations across various classes, such as Guild, Emoji, Sticker, AuditLog, and repositories. [1] [2] [3] [4] [5] [6] [7] [8]
  • Simplified promise and event handler callbacks in voice and websocket related code to use short arrow functions, enhancing clarity in asynchronous flows. [1] [2] [3] [4] [5]
  • Updated the deferred cancellation callback in deferFind to use a short arrow function for brevity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants