Skip to content
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

Add deprecated currencies (GWY-14291) #7

Merged
merged 5 commits into from
Dec 5, 2019
Merged

Add deprecated currencies (GWY-14291) #7

merged 5 commits into from
Dec 5, 2019

Conversation

agalstian
Copy link
Contributor

Details

Returning deprecated currencies back to the library.

  • Added a deprecated property
  • Added a method to check if a currency is deprecated
  • Fixed existing getCurrencies() method to return only active currencies
  • Added getCurrenciesIncludingDeprecated() method to get all the currencies

Links

https://jira.ilabsinc.com/browse/GWY-14291

@agalstian agalstian requested a review from a team December 5, 2019 11:29
@agalstian agalstian self-assigned this Dec 5, 2019
src/Currency.php Outdated Show resolved Hide resolved
src/Currency.php Outdated Show resolved Hide resolved
src/Currency.php Outdated Show resolved Hide resolved
src/Currency.php Outdated Show resolved Hide resolved
src/Currency.php Outdated Show resolved Hide resolved
src/Currency.php Outdated Show resolved Hide resolved
src/Currency.php Outdated Show resolved Hide resolved
src/Currency.php Outdated
{
return array_filter(
self::$currencies,
function ($currencyCode) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function ($currencyCode) {
static function (array $currency): bool {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why static?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it static?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

micro-optimization 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meaningful code :)

Copy link
Contributor Author

@agalstian agalstian Dec 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it doesn't make much difference in this case, since i'm not using self::$currencies anymore

src/Currency.php Outdated Show resolved Hide resolved
src/Currency.php Outdated Show resolved Hide resolved
src/Currency.php Outdated Show resolved Hide resolved
Co-Authored-By: Veaceslav Medvedev <slavcopost@gmail.com>
@slavcodev slavcodev requested a review from a team December 5, 2019 13:08
@agalstian agalstian merged commit 877fa68 into master Dec 5, 2019
@agalstian agalstian deleted the GWY-14291 branch December 5, 2019 16:11
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.

3 participants