Skip to content

Convert closures to arrow functions in the Model class #54599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

alikhosravidev
Copy link
Contributor

This PR refactors the Model class by converting closures to arrow functions in the following methods:

incrementQuietly
decrementQuietly
refresh (specifically within the BaseCollection::reject call).

Motivation:
Improved Readability: Arrow functions make the code more concise and readable, reducing the need for the use keyword to pass variables into closures.

Changes

  • Replaced closures with arrow functions in the aforementioned methods.
  • No changes to the logic or behavior of the code were made.

@taylorotwell taylorotwell merged commit 3cf9805 into laravel:11.x Feb 14, 2025
46 checks passed
Copy link

@shayan041ir shayan041ir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's really wonderful, well done.

@milladka
Copy link

You implemented a good method.

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.

None yet

4 participants