-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor: update the Currency Rule to match ISO-4217 standards #19
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
Conversation
…d ability to override the list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the Currency validation rule to align with the ISO-4217 list as of 2024, adds the ability to inject a custom currency list via the constructor, and updates unit tests accordingly.
- Updated the internal currency codes list (removed obsolete, added 74+ new codes, retained select non-ISO codes).
- Introduced a constructor parameter to override default currency codes.
- Expanded and reorganized unit tests to cover overrides, obsolete codes, new codes, and case insensitivity.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/unit/Rules/CurrencyTest.php | Fixed and expanded tests: custom override, providers for obsolete/new codes, case sensitivity |
| src/Rules/Currency.php | Added constructor override, switched validation to use instance codes, updated currencyCodes list |
Comments suppressed due to low confidence (2)
src/Rules/Currency.php:82
- The
currencyCodes()method was updated in version 1.1.0, so the@sincetag should be updated from1.0.0to1.1.0to reflect the latest changes.
* @since 1.0.0
tests/unit/Rules/CurrencyTest.php:1
- The leading "git " on the opening PHP tag looks like a typo and will cause a syntax error. Please remove it so the file starts with
<?php.
git <?php
JasonTheAdams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update! One recommendation.
e2abb67 to
0619820
Compare
|
@jonwaldstein I merged |
Updated to match current ISO 4217 standards as of 2024.
Major changes include:
LTL (→EUR), TRL (→TRY), VEF (→VES), ZWD (→ZWL)