Skip to content
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

[11.x] Simplify hasNotFailedPreviousRuleIfPresenceRule , getDateTimestamp methods #53034

Closed
wants to merge 4 commits into from

Conversation

saMahmoudzadeh
Copy link
Contributor

First Change:

Refactored the getDateTimestamp method to use the nullsafe operator (?->) directly on the result of getDateTime($value). This change eliminates the need for an explicit null check and simplifies the code.

  • Removed is_null check and redundant null assignment.
  • Directly returned the timestamp using the null-safe operator for clarity and conciseness.

Second Change:

Refactored the hasNotFailedPreviousRuleIfPresenceRule method to simplify the condition by replacing the ternary operator with a direct logical OR (||) expression. This change makes the code more readable and reduces unnecessary complexity.

  • Removed the ternary operator and replaced it with a logical OR.
  • Improved readability and performance by avoiding redundant conditions.

@saMahmoudzadeh saMahmoudzadeh marked this pull request as draft October 4, 2024 17:19
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.

1 participant