-
Notifications
You must be signed in to change notification settings - Fork 19
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
Create Convert plugin #229
base: master
Are you sure you want to change the base?
Conversation
Converts different units of measurements as well as currencies.
I have added more code styling changes, however I have not tested the functionality of the plugin with Jeeves.
src/Plugins/Convert.php
Outdated
if (in_array($needle, $item)) { | ||
|
||
return $key; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove newlines inside simple if statements <3
src/Plugins/Convert.php
Outdated
$message | ||
); | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if the body of the case
is moved to a method. So you only have a method call in here.
src/Plugins/Convert.php
Outdated
$toRate = $this->getRate($to, $xpath); | ||
|
||
return (($amount / $fromRate) * ($toRate)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No newline before }
src/Plugins/Convert.php
Outdated
] | ||
]; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra newline
"try", | ||
"turkish lira", | ||
"turkish liras", | ||
"turkish lire" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also support tofurkish
? Some users may be vegetarian.
Removed unnecessary newlines. Moved switch case to method getConvertedToAmount. Added additional check for Tofurkish in to or from unit.
Converts different units of measurements as well as currencies.