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

Create Convert plugin #229

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Create Convert plugin #229

wants to merge 6 commits into from

Conversation

scorgn
Copy link

@scorgn scorgn commented Jul 29, 2017

Converts different units of measurements as well as currencies.

Shawn Corrigan added 5 commits July 29, 2017 14:54
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.
if (in_array($needle, $item)) {

return $key;

Copy link
Member

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

$message
);

}
Copy link
Member

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.

$toRate = $this->getRate($to, $xpath);

return (($amount / $fromRate) * ($toRate));

Copy link
Member

Choose a reason for hiding this comment

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

No newline before }

]
];


Copy link
Member

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"
Copy link
Member

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.
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.

4 participants