Remove unused/dead code
This commit is contained in:
parent
c5007f2928
commit
fcc6295a77
@ -6,8 +6,6 @@ use App\Contracts\Model;
|
||||
use App\Models\Traits\HashIdTrait;
|
||||
use App\Support\Units\Distance;
|
||||
use App\Support\Units\Fuel;
|
||||
use PhpUnitsOfMeasure\Exception\NonNumericValue;
|
||||
use PhpUnitsOfMeasure\Exception\NonStringUnitName;
|
||||
|
||||
/**
|
||||
* Class Acars
|
||||
@ -71,42 +69,11 @@ class Acars extends Model
|
||||
'fuel' => 'float',
|
||||
'fuel_flow' => 'float',
|
||||
];
|
||||
/*public static $sanitize = [
|
||||
'sim_time' => 'carbon',
|
||||
'created_at' => '',
|
||||
];*/
|
||||
|
||||
public static $rules = [
|
||||
'pirep_id' => 'required',
|
||||
];
|
||||
|
||||
/**
|
||||
* Return a new Length unit so conversions can be made
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return int|Distance
|
||||
*/
|
||||
/*public function getDistanceAttribute()
|
||||
{
|
||||
if (!array_key_exists('distance', $this->attributes)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
$distance = (float) $this->attributes['distance'];
|
||||
if ($this->skip_mutator) {
|
||||
return $distance;
|
||||
}
|
||||
|
||||
return new Distance($distance, config('phpvms.internal_units.distance'));
|
||||
} catch (NonNumericValue $e) {
|
||||
return 0;
|
||||
} catch (NonStringUnitName $e) {
|
||||
return 0;
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Set the distance unit, convert to our internal default unit
|
||||
*
|
||||
@ -123,29 +90,6 @@ class Acars extends Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new Fuel unit so conversions can be made
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return int|Fuel
|
||||
*/
|
||||
/*public function getFuelAttribute()
|
||||
{
|
||||
if (!array_key_exists('fuel', $this->attributes)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
$fuel = (float) $this->attributes['fuel'];
|
||||
return new Fuel($fuel, config('phpvms.internal_units.fuel'));
|
||||
} catch (NonNumericValue $e) {
|
||||
return 0;
|
||||
} catch (NonStringUnitName $e) {
|
||||
return 0;
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Set the amount of fuel
|
||||
*
|
||||
|
@ -8,8 +8,6 @@ use App\Models\Traits\HashIdTrait;
|
||||
use App\Support\Units\Distance;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use PhpUnitsOfMeasure\Exception\NonNumericValue;
|
||||
use PhpUnitsOfMeasure\Exception\NonStringUnitName;
|
||||
|
||||
/**
|
||||
* @property string id
|
||||
@ -132,30 +130,6 @@ class Flight extends Model
|
||||
return $flight_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new Distance unit so conversions can be made
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return Distance
|
||||
*/
|
||||
/*public function getDistanceAttribute()
|
||||
{
|
||||
if (!array_key_exists('distance', $this->attributes)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
$distance = (float) $this->attributes['distance'];
|
||||
|
||||
return new Distance($distance, config('phpvms.internal_units.distance'));
|
||||
} catch (NonNumericValue $e) {
|
||||
return new Distance(0, config('phpvms.internal_units.distance', 'nmi'));
|
||||
} catch (NonStringUnitName $e) {
|
||||
return new Distance(0, config('phpvms.internal_units.distance', 'nmi'));
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Set the distance unit, convert to our internal default unit
|
||||
*
|
||||
|
@ -17,10 +17,12 @@ class GeoJson
|
||||
* @var int
|
||||
*/
|
||||
protected $counter;
|
||||
|
||||
/**
|
||||
* @var array [lon, lat] pairs
|
||||
*/
|
||||
protected $line_coords = [];
|
||||
|
||||
/**
|
||||
* @var Feature[]
|
||||
*/
|
||||
|
@ -11,7 +11,7 @@ use App\Support\Money;
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Class Journal
|
||||
* Class Ledger
|
||||
*
|
||||
* @property Money $balance
|
||||
* @property string $currency
|
||||
|
@ -11,8 +11,6 @@ use App\Support\Units\Distance;
|
||||
use App\Support\Units\Fuel;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use PhpUnitsOfMeasure\Exception\NonNumericValue;
|
||||
use PhpUnitsOfMeasure\Exception\NonStringUnitName;
|
||||
|
||||
/**
|
||||
* Class Pirep
|
||||
@ -198,33 +196,6 @@ class Pirep extends Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new Length unit so conversions can be made
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return int|Distance
|
||||
*/
|
||||
/*public function getDistanceAttribute()
|
||||
{
|
||||
if (!array_key_exists('distance', $this->attributes)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
$distance = (float) $this->attributes['distance'];
|
||||
if ($this->skip_mutator) {
|
||||
return $distance;
|
||||
}
|
||||
|
||||
return new Distance($distance, config('phpvms.internal_units.distance'));
|
||||
} catch (NonNumericValue $e) {
|
||||
return 0;
|
||||
} catch (NonStringUnitName $e) {
|
||||
return 0;
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Set the distance unit, convert to our internal default unit
|
||||
*
|
||||
@ -249,52 +220,6 @@ class Pirep extends Model
|
||||
return \in_array($this->state, static::$read_only_states, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new Fuel unit so conversions can be made
|
||||
*
|
||||
* @return int|Fuel
|
||||
*/
|
||||
/*public function getFuelUsedAttribute()
|
||||
{
|
||||
if (!array_key_exists('fuel_used', $this->attributes)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
$fuel_used = (float) $this->attributes['fuel_used'];
|
||||
|
||||
return new Fuel($fuel_used, config('phpvms.internal_units.fuel'));
|
||||
} catch (NonNumericValue $e) {
|
||||
return 0;
|
||||
} catch (NonStringUnitName $e) {
|
||||
return 0;
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Return the planned_distance in a converter class
|
||||
*
|
||||
* @return int|Distance
|
||||
*/
|
||||
/*public function getPlannedDistanceAttribute()
|
||||
{
|
||||
if (!array_key_exists('planned_distance', $this->attributes)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
$distance = (float) $this->attributes['planned_distance'];
|
||||
if ($this->skip_mutator) {
|
||||
return $distance;
|
||||
}
|
||||
|
||||
return new Distance($distance, config('phpvms.internal_units.distance'));
|
||||
} catch (NonNumericValue $e) {
|
||||
return 0;
|
||||
} catch (NonStringUnitName $e) {
|
||||
return 0;
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Return the flight progress in a percent.
|
||||
|
@ -5,7 +5,7 @@ namespace App\Models;
|
||||
use App\Contracts\Model;
|
||||
|
||||
/**
|
||||
* Class PirepEvent
|
||||
* Class PirepComment
|
||||
*
|
||||
* @property string pirep_id
|
||||
* @property int user_id
|
||||
|
Loading…
Reference in New Issue
Block a user