Formatting

This commit is contained in:
Nabeel Shahzad 2019-07-15 15:17:51 -04:00
parent 06d8f11ca3
commit c04bfb78c6
4 changed files with 11 additions and 18 deletions

View File

@ -2,8 +2,6 @@
namespace App\Http\Resources; namespace App\Http\Resources;
use App\Support\Units\Distance;
class Flight extends Response class Flight extends Response
{ {
/** /**

View File

@ -27,5 +27,4 @@ class Response extends Resource
} }
} }
} }
} }

View File

@ -5,12 +5,9 @@ namespace App\Providers;
use Exception; use Exception;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use PhpUnitsOfMeasure\Exception\DuplicateUnitNameOrAlias;
use PhpUnitsOfMeasure\Exception\NonStringUnitName; use PhpUnitsOfMeasure\Exception\NonStringUnitName;
use PhpUnitsOfMeasure\Exception\UnknownUnitOfMeasure; use PhpUnitsOfMeasure\Exception\UnknownUnitOfMeasure;
use PhpUnitsOfMeasure\PhysicalQuantity\Length;
use PhpUnitsOfMeasure\PhysicalQuantity\Temperature; use PhpUnitsOfMeasure\PhysicalQuantity\Temperature;
use PhpUnitsOfMeasure\UnitOfMeasure;
/** /**
* Add new measurement units to PhpUnitsOfMeasure * Add new measurement units to PhpUnitsOfMeasure

View File

@ -7,6 +7,7 @@ use App\Support\Units\Distance;
use App\Support\Units\Pressure; use App\Support\Units\Pressure;
use App\Support\Units\Temperature; use App\Support\Units\Temperature;
use App\Support\Units\Velocity; use App\Support\Units\Velocity;
use function count;
use PhpUnitsOfMeasure\Exception\NonNumericValue; use PhpUnitsOfMeasure\Exception\NonNumericValue;
use PhpUnitsOfMeasure\Exception\NonStringUnitName; use PhpUnitsOfMeasure\Exception\NonStringUnitName;
@ -392,15 +393,13 @@ class Metar implements \ArrayAccess
if (isset($this->result[$parameter])) { if (isset($this->result[$parameter])) {
return $this->result[$parameter]; return $this->result[$parameter];
} }
return null;
} }
/** /**
* Return an Altitude value or object * Return an Altitude value or object
* *
* @param int|float $value * @param int|float $value
* @param string $unit "feet" or "meters" * @param string $unit "feet" or "meters"
* *
* @throws NonStringUnitName * @throws NonStringUnitName
* @throws NonNumericValue * @throws NonNumericValue
@ -416,7 +415,7 @@ class Metar implements \ArrayAccess
* Return a Distance value or object * Return a Distance value or object
* *
* @param int|float $value * @param int|float $value
* @param string $unit "m" (meters) or "mi" (miles) * @param string $unit "m" (meters) or "mi" (miles)
* *
* @throws NonNumericValue * @throws NonNumericValue
* @throws NonStringUnitName * @throws NonStringUnitName
@ -448,7 +447,7 @@ class Metar implements \ArrayAccess
* Return a Temperature value or object * Return a Temperature value or object
* *
* @param int|float $value * @param int|float $value
* @param string $unit "F" or "C" * @param string $unit "F" or "C"
* *
* @throws NonNumericValue * @throws NonNumericValue
* @throws NonStringUnitName * @throws NonStringUnitName
@ -463,7 +462,7 @@ class Metar implements \ArrayAccess
/** /**
* Create a new velocity unit * Create a new velocity unit
* @param int|float $value * @param int|float $value
* @param string $unit "knots", "km/hour", "m/s" * @param string $unit "knots", "km/hour", "m/s"
* *
* @throws NonStringUnitName * @throws NonStringUnitName
* @throws NonNumericValue * @throws NonNumericValue
@ -483,8 +482,8 @@ class Metar implements \ArrayAccess
$this->raw_parts = explode(' ', $this->raw); $this->raw_parts = explode(' ', $this->raw);
$current_method = 0; $current_method = 0;
$raw_part_count = \count($this->raw_parts); $raw_part_count = count($this->raw_parts);
$method_name_count = \count(static::$method_names); $method_name_count = count(static::$method_names);
while ($this->part < $raw_part_count) { while ($this->part < $raw_part_count) {
$this->method = $current_method; $this->method = $current_method;
@ -878,7 +877,7 @@ class Metar implements \ArrayAccess
// ICAO visibility (in meters) // ICAO visibility (in meters)
if (isset($found[2]) && !empty($found[2])) { 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) } // US visibility (in miles)
else { else {
if (isset($found[3]) && !empty($found[3])) { if (isset($found[3]) && !empty($found[3])) {
@ -927,7 +926,7 @@ class Metar implements \ArrayAccess
return false; return false;
} }
$meters = $this->createDistance((int)$found[1], 'm'); $meters = $this->createDistance((int) $found[1], 'm');
$this->set_result_value('visibility_min', $meters); $this->set_result_value('visibility_min', $meters);
if (isset($found[2]) && !empty($found[2])) { if (isset($found[2]) && !empty($found[2])) {
@ -1488,7 +1487,7 @@ class Metar implements \ArrayAccess
$raw_parts = []; $raw_parts = [];
// Get all parts after trend part // 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)) { if (preg_match($r, $this->raw_parts[$this->part], $found)) {
// Get trend flag // Get trend flag
if (isset($found[2], static::$trends_flag_codes[$found[2]])) { if (isset($found[2], static::$trends_flag_codes[$found[2]])) {
@ -1618,7 +1617,7 @@ class Metar implements \ArrayAccess
$remarks = []; $remarks = [];
// Get all parts after // 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])) { if (isset($this->raw_parts[$this->part])) {
$remarks[] = $this->raw_parts[$this->part]; $remarks[] = $this->raw_parts[$this->part];
} }