Skip to content

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