Fix formatting and interfaces in nearly every file
This commit is contained in:
@@ -17,6 +17,7 @@ class Altitude extends \PhpUnitsOfMeasure\PhysicalQuantity\Length implements Arr
|
||||
{
|
||||
$unit = setting('units.altitude');
|
||||
$value = $this->toUnit($unit);
|
||||
|
||||
return (string) round($value, 2);
|
||||
}
|
||||
|
||||
@@ -35,8 +36,8 @@ class Altitude extends \PhpUnitsOfMeasure\PhysicalQuantity\Length implements Arr
|
||||
public function toObject()
|
||||
{
|
||||
return [
|
||||
'ft' => round($this->toUnit('feet'), 2),
|
||||
'm' => round($this->toUnit('meters') / 1000, 2),
|
||||
'ft' => round($this->toUnit('feet'), 2),
|
||||
'm' => round($this->toUnit('meters') / 1000, 2),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ class Distance extends \PhpUnitsOfMeasure\PhysicalQuantity\Length implements Arr
|
||||
{
|
||||
$unit = setting('units.distance');
|
||||
$value = $this->toUnit($unit);
|
||||
|
||||
return (string) round($value, 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ class Fuel extends \PhpUnitsOfMeasure\PhysicalQuantity\Mass implements Arrayable
|
||||
{
|
||||
$unit = setting('units.fuel');
|
||||
$value = $this->toUnit($unit);
|
||||
|
||||
return (string) round($value, 2);
|
||||
}
|
||||
|
||||
@@ -35,7 +36,7 @@ class Fuel extends \PhpUnitsOfMeasure\PhysicalQuantity\Mass implements Arrayable
|
||||
public function toObject()
|
||||
{
|
||||
return [
|
||||
'kg' => round($this->toUnit('kg'), 2),
|
||||
'kg' => round($this->toUnit('kg'), 2),
|
||||
'lbs' => round($this->toUnit('lbs'), 2),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ class Mass extends \PhpUnitsOfMeasure\PhysicalQuantity\Mass implements Arrayable
|
||||
{
|
||||
$unit = setting('units.weight');
|
||||
$value = $this->toUnit($unit);
|
||||
|
||||
return (string) round($value, 2);
|
||||
}
|
||||
|
||||
@@ -35,7 +36,7 @@ class Mass extends \PhpUnitsOfMeasure\PhysicalQuantity\Mass implements Arrayable
|
||||
public function toObject()
|
||||
{
|
||||
return [
|
||||
'kg' => round($this->toUnit('kg'), 2),
|
||||
'kg' => round($this->toUnit('kg'), 2),
|
||||
'lbs' => round($this->toUnit('lbs'), 2),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ use Illuminate\Contracts\Support\Arrayable;
|
||||
class Time implements Arrayable
|
||||
{
|
||||
public $hours,
|
||||
$minutes;
|
||||
$minutes;
|
||||
|
||||
/**
|
||||
* @param $minutes
|
||||
@@ -29,11 +29,11 @@ class Time implements Arrayable
|
||||
* @param $minutes
|
||||
* @param $hours
|
||||
*/
|
||||
public function __construct($minutes, $hours=null)
|
||||
public function __construct($minutes, $hours = null)
|
||||
{
|
||||
$minutes = (int) $minutes;
|
||||
|
||||
if(!empty($hours)) {
|
||||
if (!empty($hours)) {
|
||||
$this->hours = (int) $hours;
|
||||
} else {
|
||||
$this->hours = floor($minutes / 60);
|
||||
@@ -67,7 +67,7 @@ class Time implements Arrayable
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->hours . 'h ' . $this->minutes . 'm';
|
||||
return $this->hours.'h '.$this->minutes.'m';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,7 @@ class Velocity extends \PhpUnitsOfMeasure\PhysicalQuantity\Velocity implements A
|
||||
{
|
||||
$unit = setting('units.speed');
|
||||
$value = $this->toUnit($unit);
|
||||
|
||||
return (string) round($value, 2);
|
||||
}
|
||||
|
||||
@@ -36,7 +37,7 @@ class Velocity extends \PhpUnitsOfMeasure\PhysicalQuantity\Velocity implements A
|
||||
{
|
||||
return [
|
||||
'knots' => round($this->toUnit('knots'), 2),
|
||||
'km/h' => round($this->toUnit('km/h'), 2),
|
||||
'km/h' => round($this->toUnit('km/h'), 2),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ class Volume extends \PhpUnitsOfMeasure\PhysicalQuantity\Volume implements Array
|
||||
{
|
||||
$unit = setting('units.volume');
|
||||
$value = $this->toUnit($unit);
|
||||
|
||||
return (string) round($value, 2);
|
||||
}
|
||||
|
||||
@@ -35,8 +36,8 @@ class Volume extends \PhpUnitsOfMeasure\PhysicalQuantity\Volume implements Array
|
||||
public function toObject()
|
||||
{
|
||||
return [
|
||||
'gal' => round($this->toUnit('gal'), 2),
|
||||
'liters' => round($this->toUnit('liters'), 2),
|
||||
'gal' => round($this->toUnit('gal'), 2),
|
||||
'liters' => round($this->toUnit('liters'), 2),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user