arslanimamutdinov/iso-standard-4217

v1.0.0 2022-03-21 21:36 UTC

This package is auto-updated.

Last update: 2024-10-23 13:30:18 UTC


README

Code Coverage Badge

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)