Refactor: update the Currency Rule to match ISO-4217 standards #19
Merged
JasonTheAdams merged 4 commits intodevelopfrom Jun 16, 2025
Merged
Refactor: update the Currency Rule to match ISO-4217 standards #19JasonTheAdams merged 4 commits intodevelopfrom
JasonTheAdams merged 4 commits intodevelopfrom
Conversation
…d ability to override the list
There was a problem hiding this comment.
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
suggested changes
Jun 13, 2025
Contributor
JasonTheAdams
left a comment
There was a problem hiding this comment.
Thanks for the update! One recommendation.
e2abb67 to
0619820
Compare
Contributor
|
@jonwaldstein I merged |
JasonTheAdams
approved these changes
Jun 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated to match current ISO 4217 standards as of 2024.
Major changes include:
LTL (→EUR), TRL (→TRY), VEF (→VES), ZWD (→ZWL)