diff --git a/app/Http/Resources/Flight.php b/app/Http/Resources/Flight.php index 0314504e..c058f633 100644 --- a/app/Http/Resources/Flight.php +++ b/app/Http/Resources/Flight.php @@ -2,8 +2,6 @@ namespace App\Http\Resources; -use App\Support\Units\Distance; - class Flight extends Response { /** diff --git a/app/Http/Resources/Response.php b/app/Http/Resources/Response.php index ae1e2171..cdce41b3 100644 --- a/app/Http/Resources/Response.php +++ b/app/Http/Resources/Response.php @@ -27,5 +27,4 @@ class Response extends Resource } } } - } diff --git a/app/Providers/MeasurementsProvider.php b/app/Providers/MeasurementsProvider.php index d9ffa964..4efbe744 100755 --- a/app/Providers/MeasurementsProvider.php +++ b/app/Providers/MeasurementsProvider.php @@ -5,12 +5,9 @@ namespace App\Providers; use Exception; use Illuminate\Support\Facades\Log; use Illuminate\Support\ServiceProvider; -use PhpUnitsOfMeasure\Exception\DuplicateUnitNameOrAlias; use PhpUnitsOfMeasure\Exception\NonStringUnitName; use PhpUnitsOfMeasure\Exception\UnknownUnitOfMeasure; -use PhpUnitsOfMeasure\PhysicalQuantity\Length; use PhpUnitsOfMeasure\PhysicalQuantity\Temperature; -use PhpUnitsOfMeasure\UnitOfMeasure; /** * Add new measurement units to PhpUnitsOfMeasure diff --git a/app/Support/Metar.php b/app/Support/Metar.php index 06a820a6..34584d80 100644 --- a/app/Support/Metar.php +++ b/app/Support/Metar.php @@ -7,6 +7,7 @@ use App\Support\Units\Distance; use App\Support\Units\Pressure; use App\Support\Units\Temperature; use App\Support\Units\Velocity; +use function count; use PhpUnitsOfMeasure\Exception\NonNumericValue; use PhpUnitsOfMeasure\Exception\NonStringUnitName; @@ -392,15 +393,13 @@ class Metar implements \ArrayAccess if (isset($this->result[$parameter])) { return $this->result[$parameter]; } - - return null; } /** * Return an Altitude value or object * * @param int|float $value - * @param string $unit "feet" or "meters" + * @param string $unit "feet" or "meters" * * @throws NonStringUnitName * @throws NonNumericValue @@ -416,7 +415,7 @@ class Metar implements \ArrayAccess * Return a Distance value or object * * @param int|float $value - * @param string $unit "m" (meters) or "mi" (miles) + * @param string $unit "m" (meters) or "mi" (miles) * * @throws NonNumericValue * @throws NonStringUnitName @@ -448,7 +447,7 @@ class Metar implements \ArrayAccess * Return a Temperature value or object * * @param int|float $value - * @param string $unit "F" or "C" + * @param string $unit "F" or "C" * * @throws NonNumericValue * @throws NonStringUnitName @@ -463,7 +462,7 @@ class Metar implements \ArrayAccess /** * Create a new velocity unit * @param int|float $value - * @param string $unit "knots", "km/hour", "m/s" + * @param string $unit "knots", "km/hour", "m/s" * * @throws NonStringUnitName * @throws NonNumericValue @@ -483,8 +482,8 @@ class Metar implements \ArrayAccess $this->raw_parts = explode(' ', $this->raw); $current_method = 0; - $raw_part_count = \count($this->raw_parts); - $method_name_count = \count(static::$method_names); + $raw_part_count = count($this->raw_parts); + $method_name_count = count(static::$method_names); while ($this->part < $raw_part_count) { $this->method = $current_method; @@ -878,7 +877,7 @@ class Metar implements \ArrayAccess // ICAO visibility (in meters) if (isset($found[2]) && !empty($found[2])) { - $visibility = $this->createDistance((int)$found[2], 'm'); + $visibility = $this->createDistance((int) $found[2], 'm'); } // US visibility (in miles) else { if (isset($found[3]) && !empty($found[3])) { @@ -927,7 +926,7 @@ class Metar implements \ArrayAccess return false; } - $meters = $this->createDistance((int)$found[1], 'm'); + $meters = $this->createDistance((int) $found[1], 'm'); $this->set_result_value('visibility_min', $meters); if (isset($found[2]) && !empty($found[2])) { @@ -1488,7 +1487,7 @@ class Metar implements \ArrayAccess $raw_parts = []; // Get all parts after trend part - while ($this->part < \count($this->raw_parts)) { + while ($this->part < count($this->raw_parts)) { if (preg_match($r, $this->raw_parts[$this->part], $found)) { // Get trend flag if (isset($found[2], static::$trends_flag_codes[$found[2]])) { @@ -1618,7 +1617,7 @@ class Metar implements \ArrayAccess $remarks = []; // Get all parts after - while ($this->part < \count($this->raw_parts)) { + while ($this->part < count($this->raw_parts)) { if (isset($this->raw_parts[$this->part])) { $remarks[] = $this->raw_parts[$this->part]; }