28 lines
571 B
PHP
28 lines
571 B
PHP
<?php
|
|
|
|
namespace App\Support\Units;
|
|
|
|
use App\Interfaces\Unit;
|
|
use PhpUnitsOfMeasure\PhysicalQuantity\Mass;
|
|
|
|
class Fuel extends Unit
|
|
{
|
|
public $responseUnits = [
|
|
'kg',
|
|
'lbs',
|
|
];
|
|
|
|
/**
|
|
* @param float $value
|
|
* @param string $unit
|
|
*
|
|
* @throws \PhpUnitsOfMeasure\Exception\NonNumericValue
|
|
* @throws \PhpUnitsOfMeasure\Exception\NonStringUnitName
|
|
*/
|
|
public function __construct(float $value, string $unit)
|
|
{
|
|
$this->unit = setting('units.fuel');
|
|
$this->instance = new Mass($value, $unit);
|
|
}
|
|
}
|