Skip to content

Convert closures to arrow functions in the Model class#54599

Merged
taylorotwell merged 1 commit into
laravel:11.xfrom
alikhosravidev:Model
Feb 14, 2025
Merged

Convert closures to arrow functions in the Model class#54599
taylorotwell merged 1 commit into
laravel:11.xfrom
alikhosravidev:Model

Conversation

@alikhosravidev
Copy link
Copy Markdown
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
Copy link
Copy Markdown

@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
Copy Markdown

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.

4 participants