diff --git a/app/Models/Acars.php b/app/Models/Acars.php index f2f95a10..9ee4d41b 100644 --- a/app/Models/Acars.php +++ b/app/Models/Acars.php @@ -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 * diff --git a/app/Models/Flight.php b/app/Models/Flight.php index bb1400d5..a67e251e 100644 --- a/app/Models/Flight.php +++ b/app/Models/Flight.php @@ -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 * diff --git a/app/Models/GeoJson.php b/app/Models/GeoJson.php index 2747567b..9259599f 100644 --- a/app/Models/GeoJson.php +++ b/app/Models/GeoJson.php @@ -17,10 +17,12 @@ class GeoJson * @var int */ protected $counter; + /** * @var array [lon, lat] pairs */ protected $line_coords = []; + /** * @var Feature[] */ diff --git a/app/Models/Ledger.php b/app/Models/Ledger.php index 25433536..51c78763 100644 --- a/app/Models/Ledger.php +++ b/app/Models/Ledger.php @@ -11,7 +11,7 @@ use App\Support\Money; use Carbon\Carbon; /** - * Class Journal + * Class Ledger * * @property Money $balance * @property string $currency diff --git a/app/Models/Pirep.php b/app/Models/Pirep.php index 0891a798..e8c0fc38 100644 --- a/app/Models/Pirep.php +++ b/app/Models/Pirep.php @@ -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. diff --git a/app/Models/PirepComment.php b/app/Models/PirepComment.php index be8cd527..97a51661 100644 --- a/app/Models/PirepComment.php +++ b/app/Models/PirepComment.php @@ -5,7 +5,7 @@ namespace App\Models; use App\Contracts\Model; /** - * Class PirepEvent + * Class PirepComment * * @property string pirep_id * @property int user_id