Skip to content

Create Convert plugin#229

Open
scorgn wants to merge 6 commits into
Room-11:masterfrom
scorgn:patch-1
Open

Create Convert plugin#229
scorgn wants to merge 6 commits into
Room-11:masterfrom
scorgn:patch-1

Conversation

@scorgn

@scorgn scorgn commented Jul 29, 2017

Copy link
Copy Markdown

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.
Comment thread src/Plugins/Convert.php Outdated
if (in_array($needle, $item)) {

return $key;

Copy link
Copy Markdown
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

Comment thread src/Plugins/Convert.php Outdated
$message
);

}

Copy link
Copy Markdown
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.

Comment thread src/Plugins/Convert.php Outdated
$toRate = $this->getRate($to, $xpath);

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No newline before }

Comment thread src/Plugins/Convert.php Outdated
]
];


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove extra newline

Comment thread src/Plugins/Convert.php
"try",
"turkish lira",
"turkish liras",
"turkish lire"

Copy link
Copy Markdown
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