2019-07-16 03:14:40 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Support\Units;
|
|
|
|
|
2019-07-16 03:44:31 +08:00
|
|
|
use App\Contracts\Unit;
|
2019-07-16 03:14:40 +08:00
|
|
|
use PhpUnitsOfMeasure\PhysicalQuantity\Pressure as PressureUnit;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Composition for the converter
|
|
|
|
*/
|
|
|
|
class Pressure extends Unit
|
|
|
|
{
|
|
|
|
public $responseUnits = [
|
|
|
|
'atm',
|
|
|
|
'hPa',
|
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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.temperature');
|
|
|
|
$this->instance = new PressureUnit($value, $unit);
|
|
|
|
}
|
|
|
|
}
|