Skip to content

Conversation

@hkdobrev
Copy link

This allows to find the common code given a popular symbol.
This is useful for user-generated unit codes like kg for example.

This allows to find the common code given a popular symbol.
This is useful for user-generated unit codes like kg for example.
@Xerkus
Copy link
Contributor

Xerkus commented Mar 25, 2016

There are multiple codes with same symbol, you should return array.

Iterating over the whole list might be expensive if done often, consider building index of [$symbol] = [$commoncode, $commoncode, ...]

* @return Uom|null
*/
public function findBySymbol($symbol)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

parameter must be sanitized outside of the function

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.

2 participants