Laravel 9 Update (#1413)

Update to Laravel 9 and PHP 8+

Co-authored-by: B.Fatih KOZ <fatih.koz@gmail.com>
This commit is contained in:
Nabeel S
2022-03-14 11:45:18 -04:00
committed by GitHub
parent 00bf18c225
commit 12848091a2
340 changed files with 6130 additions and 4502 deletions

View File

@@ -7,7 +7,7 @@ use PhpUnitsOfMeasure\PhysicalQuantity\Length;
class Distance extends Unit
{
public $responseUnits = [
public array $responseUnits = [
'm',
'km',
'mi',
@@ -17,19 +17,26 @@ class Distance extends Unit
/**
* Distance constructor.
*
* @param float $value
* @param string $unit
* @param Distance|float $value
* @param string $unit The unit of $value
*
* @throws \PhpUnitsOfMeasure\Exception\NonNumericValue
* @throws \PhpUnitsOfMeasure\Exception\NonStringUnitName
*/
public function __construct($value, string $unit)
public function __construct(mixed $value, string $unit)
{
if (empty($value)) {
$value = 0;
}
$this->unit = setting('units.distance');
$this->instance = new Length($value, $unit);
$this->localUnit = setting('units.distance');
$this->internalUnit = config('phpvms.internal_units.distance');
if ($value instanceof self) {
$value->toUnit($unit);
$this->instance = $value->instance;
} else {
$this->instance = new Length($value, $unit);
}
}
}