Skip to content

Update JalaliValidator.php#180

Open
itashia wants to merge 1 commit into
hekmatinasser:masterfrom
itashia:patch-2
Open

Update JalaliValidator.php#180
itashia wants to merge 1 commit into
hekmatinasser:masterfrom
itashia:patch-2

Conversation

@itashia

@itashia itashia commented Jun 8, 2025

Copy link
Copy Markdown

Refactored outdated logic for compatibility and maintainability

  • Introduced class constants for default formats
  • Removed code duplication via helper methods
  • Improved type hinting for better static analysis
  • Used arrow functions for cleaner syntax (PHP 7.4+)
  • Separated concerns by extracting common tasks into dedicated methods
  • Leveraged callable for flexible comparisons
  • Enhanced method docblocks for better understanding

This code had not been updated for a long time and was incompatible with newer PHP versions. This refactor preserves all original behavior while modernizing the implementation.

Refactored outdated logic for compatibility and maintainability

- Introduced class constants for default formats  
- Removed code duplication via helper methods  
- Improved type hinting for better static analysis  
- Used arrow functions for cleaner syntax (PHP 7.4+)  
- Separated concerns by extracting common tasks into dedicated methods  
- Leveraged `callable` for flexible comparisons  
- Enhanced method docblocks for better understanding  

This code had not been updated for a long time and was incompatible with newer PHP versions. This refactor preserves all original behavior while modernizing the implementation.
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