Cleanup SI Unit classes and interface for REST responses; fixes to a few METAR parsing issues

This commit is contained in:
Nabeel Shahzad
2019-07-15 15:14:40 -04:00
parent 466d04caf7
commit 06d8f11ca3
33 changed files with 399 additions and 222 deletions

View File

@@ -133,9 +133,9 @@ class Flight extends Model
}
/**
* Return a new Length unit so conversions can be made
* Return a new Distance unit so conversions can be made
*
* @return int|Distance
* @return Distance
*/
public function getDistanceAttribute()
{
@@ -148,9 +148,9 @@ class Flight extends Model
return new Distance($distance, config('phpvms.internal_units.distance'));
} catch (NonNumericValue $e) {
return 0;
return new Distance(0, config('phpvms.internal_units.distance', 'nmi'));
} catch (NonStringUnitName $e) {
return 0;
return new Distance(0, config('phpvms.internal_units.distance', 'nmi'));
}
}