Remove unused/dead code

This commit is contained in:
Nabeel Shahzad 2019-07-23 09:00:39 -04:00
parent c5007f2928
commit fcc6295a77
6 changed files with 4 additions and 159 deletions

View File

@ -6,8 +6,6 @@ use App\Contracts\Model;
use App\Models\Traits\HashIdTrait; use App\Models\Traits\HashIdTrait;
use App\Support\Units\Distance; use App\Support\Units\Distance;
use App\Support\Units\Fuel; use App\Support\Units\Fuel;
use PhpUnitsOfMeasure\Exception\NonNumericValue;
use PhpUnitsOfMeasure\Exception\NonStringUnitName;
/** /**
* Class Acars * Class Acars
@ -71,42 +69,11 @@ class Acars extends Model
'fuel' => 'float', 'fuel' => 'float',
'fuel_flow' => 'float', 'fuel_flow' => 'float',
]; ];
/*public static $sanitize = [
'sim_time' => 'carbon',
'created_at' => '',
];*/
public static $rules = [ public static $rules = [
'pirep_id' => 'required', '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 * 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 * Set the amount of fuel
* *

View File

@ -8,8 +8,6 @@ use App\Models\Traits\HashIdTrait;
use App\Support\Units\Distance; use App\Support\Units\Distance;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use PhpUnitsOfMeasure\Exception\NonNumericValue;
use PhpUnitsOfMeasure\Exception\NonStringUnitName;
/** /**
* @property string id * @property string id
@ -132,30 +130,6 @@ class Flight extends Model
return $flight_id; 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 * Set the distance unit, convert to our internal default unit
* *

View File

@ -17,10 +17,12 @@ class GeoJson
* @var int * @var int
*/ */
protected $counter; protected $counter;
/** /**
* @var array [lon, lat] pairs * @var array [lon, lat] pairs
*/ */
protected $line_coords = []; protected $line_coords = [];
/** /**
* @var Feature[] * @var Feature[]
*/ */

View File

@ -11,7 +11,7 @@ use App\Support\Money;
use Carbon\Carbon; use Carbon\Carbon;
/** /**
* Class Journal * Class Ledger
* *
* @property Money $balance * @property Money $balance
* @property string $currency * @property string $currency

View File

@ -11,8 +11,6 @@ use App\Support\Units\Distance;
use App\Support\Units\Fuel; use App\Support\Units\Fuel;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use PhpUnitsOfMeasure\Exception\NonNumericValue;
use PhpUnitsOfMeasure\Exception\NonStringUnitName;
/** /**
* Class Pirep * 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 * 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 \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. * Return the flight progress in a percent.

View File

@ -5,7 +5,7 @@ namespace App\Models;
use App\Contracts\Model; use App\Contracts\Model;
/** /**
* Class PirepEvent * Class PirepComment
* *
* @property string pirep_id * @property string pirep_id
* @property int user_id * @property int user_id