arslanimamutdinov / iso-standard-4217
Installs: 1 862
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
Requires (Dev)
- phpstan/phpstan: ^0.12.90
- phpunit/phpunit: ^8.5
- squizlabs/php_codesniffer: 3.6.2
README
This component provides features for ISO 4217 standard - get currency codes according to standard.
Installation
composer require arslanimamutdinov/iso-standard-4217
Terms and designations
- alpha3 - three-letter currency code e.g. RUB;
- numericCodes - numeric currency code e.g. 643;
- name - string currency name e.g. Russian ruble.
Component parts description
Currency - ISO 4217 standard model, contains properties:
- name - currency name;
- alpha3 - currency alpha3 code;
- numericCode - currency numeric code.
ISO4217 - abstract class provides set of static function for working with ISO 4217 standard.
ISO4217Utility - service class wrapper over ISO4217 (need instantiate class object).
Base component features
ISO4217 features
Provides access to currency standard by alpha3-named static function.
For example:
// returns instance of Currency class // includes currency data for United Arab Emirates dirham ISO4217::AED();
Provides access to currency raw data.
For example:
ISO4217::getRawStandardsData();
Provides search standards by given currency alpha3 codes.
For example:
// returns Currency[] ISO4217::getAllByAlpha3Codes(['AED', 'GBP']);
Provides search standards by given currency numeric codes.
For example:
// returns Currency[] ISO4217::getAllByNumericCodes(['784', '826']);
Provides search standards by given currency alpha3 code.
For example:
// returns Currency or null if not found ISO4217::getByAlpha3('AED');
Provides search standards by given currency numeric code.
For example:
// returns Currency or null if not found ISO4217::getByNumericCode('784');
Provides access to all currency standards represented in array of Currency objects.
For example:
// returns Currency[] ISO4217::getAll();
ISO4217Utility features
Provides all features from ISO4217 but with utility instance creation.
For example:
$currencyUtility = new ISO4217Utility(); $currencyUtility->AED();
Contributing
Welcome to pull requests. If there is a major changes, first please open an issue for discussion.
Please make sure to update tests as appropriate.
Source(s)
- ISO 4217 by Wikipedia licensed under CC BY-SA 3.0 Unported License
- www.iso.org