initial commit; version 22.5.12042

This commit is contained in:
2022-12-12 23:28:25 -05:00
commit af1b03d79f
17653 changed files with 22692970 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<?php
namespace PhpUnitsOfMeasure\Exception;
use Exception;
abstract class AbstractPhysicalQuantityException extends Exception
{
/**
* The error message template for this exception.
*
* @var string
*/
protected $error = '';
/**
* given an array of replacement values, assemble the error message for
* this exception.
*
* @param array $parameters key/value replacement pairs for the error message.
*/
public function __construct(array $parameters = [])
{
$message = strtr($this->error, $parameters);
parent::__construct($message);
}
}

View File

@ -0,0 +1,7 @@
<?php
namespace PhpUnitsOfMeasure\Exception;
class DuplicateUnitNameOrAlias extends AbstractPhysicalQuantityException
{
protected $error = 'The unit has a name or alias (:labels) which is already a registered unit for this quantity.';
}

View File

@ -0,0 +1,7 @@
<?php
namespace PhpUnitsOfMeasure\Exception;
class NonNumericValue extends AbstractPhysicalQuantityException
{
protected $error = 'Value (:value) must be numeric.';
}

View File

@ -0,0 +1,7 @@
<?php
namespace PhpUnitsOfMeasure\Exception;
class NonStringUnitName extends AbstractPhysicalQuantityException
{
protected $error = 'Unit name or alias (:name) must be a string value.';
}

View File

@ -0,0 +1,7 @@
<?php
namespace PhpUnitsOfMeasure\Exception;
class PhysicalQuantityMismatch extends AbstractPhysicalQuantityException
{
protected $error = '(:lhs) and (:rhs) cannot be added or subtracted because they are not the same physical quantity.';
}

View File

@ -0,0 +1,7 @@
<?php
namespace PhpUnitsOfMeasure\Exception;
class UnknownUnitOfMeasure extends AbstractPhysicalQuantityException
{
protected $error = 'Unknown unit of measure (:unit).';
}