Fixes (#435)
* Add flight level field to PIREP field closes #401 * Default value for distance 0 closes #400 * Block airline deletion if assets exist #367 * Formatting * Move some of the base exception classes * Fix skin references to use settings table * Set default for theme name if setting is wrong
This commit is contained in:
@@ -22,15 +22,13 @@ class Acars extends Response
|
||||
$res = parent::toArray($request);
|
||||
|
||||
// Set these to the response units
|
||||
if (!empty($res['distance'])) {
|
||||
$distance = new Distance($res['distance'], config('phpvms.internal_units.distance'));
|
||||
$res['distance'] = $distance->getResponseUnits();
|
||||
}
|
||||
$distance = !empty($res['distance']) ? $res['distance'] : 0;
|
||||
$distance = new Distance($distance, config('phpvms.internal_units.distance'));
|
||||
$res['distance'] = $distance->getResponseUnits();
|
||||
|
||||
if (!empty($res['fuel'])) {
|
||||
$fuel = new Fuel($res['fuel'], config('phpvms.internal_units.fuel'));
|
||||
$res['fuel'] = $fuel->getResponseUnits();
|
||||
}
|
||||
$fuel = !empty($res['fuel']) ? $res['fuel'] : 0;
|
||||
$fuel = new Fuel($fuel, config('phpvms.internal_units.fuel'));
|
||||
$res['fuel'] = $fuel->getResponseUnits();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user