Skip to content

Updated library to use new API #1

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

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Conversation

stefan1144
Copy link
Collaborator

No description provided.

@stefan1144 stefan1144 requested a review from TheCelavi February 14, 2024 08:02

private function getApiRateTypes(): array
{
return [
Copy link
Member

Choose a reason for hiding this comment

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

On every call of this function - you are building a new array, allocating more memory. We know that there are going to be dozens of these calls.

Make it private constant of this class.

return Api::NAME;
}

private function buildRate($value, $currencyCode, $rateType, $date): RateInterface
Copy link
Member

Choose a reason for hiding this comment

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

Do you need this private function? It is used once, and it is one liner.

Seams that you can just move construction to place where is needed, without using function, makes no sense to have it.

@stefan1144 stefan1144 force-pushed the feature/switch-to-new-api branch from abf4c40 to 6424041 Compare February 14, 2024 09:58
@TheCelavi TheCelavi merged commit 0f85dbd into master Feb 19, 2024
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