Merge pull request #13465 from snipe/fixes/parse_error_in_helper
Fixed unclosed brace
This commit is contained in:
commit
346f243bc0
1 changed files with 18 additions and 9 deletions
|
@ -1253,17 +1253,26 @@ class Helper
|
||||||
*/
|
*/
|
||||||
public static function getUnitConversionFactor($unit) {
|
public static function getUnitConversionFactor($unit) {
|
||||||
switch (strtolower($unit)) {
|
switch (strtolower($unit)) {
|
||||||
case 'mm': return 1.0;
|
case 'mm':
|
||||||
case 'cm': return 10.0;
|
return 1.0;
|
||||||
case 'm': return 1000.0;
|
case 'cm':
|
||||||
case 'in': return 25.4;
|
return 10.0;
|
||||||
case 'ft': return 12 * static::getUnitConversionFactor('in');
|
case 'm':
|
||||||
case 'yd': return 3 * static::getUnitConversionFactor('ft');
|
return 1000.0;
|
||||||
case 'pt': return (1/72) * static::getUnitConversionFactor('in');
|
case 'in':
|
||||||
default: throw new \InvalidArgumentException('Unit: \''.$unit.'\' is not supported');
|
return 25.4;
|
||||||
|
case 'ft':
|
||||||
|
return 12 * static::getUnitConversionFactor('in');
|
||||||
|
case 'yd':
|
||||||
|
return 3 * static::getUnitConversionFactor('ft');
|
||||||
|
case 'pt':
|
||||||
|
return (1 / 72) * static::getUnitConversionFactor('in');
|
||||||
|
default:
|
||||||
|
throw new \InvalidArgumentException('Unit: \'' . $unit . '\' is not supported');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue