Is there a good way to remove duplication in this code:
if ($design->unit_system=="English")
{
define('LIMIT_AF', '200');
define('LIMIT_BF', '0');
define('LIMIT_CM', '50');
define('LIMIT_DB', '50');
define('LIMIT_FB', '100');
}
else if ($design->unit_system=="Metric")
{
define('LIMIT_AF', convert(200, 'gpm', 'm3h'));
define('LIMIT_BF', convert(0, 'gpm', 'm3h'));
define('LIMIT_CM', convert(50, 'gpm', 'm3h'));
define('LIMIT_DB', convert(50, 'psi', 'bar'));
define('LIMIT_FB', convert(100, 'psi', 'bar'));
}
I am struggling as to if any effort will be more complicated than what I have now.
What about this - updated according to OP edits: