BadUnit extends Exception
Exception to be thrown when a bad unit of measurement is encountered.
Tags
Table of Contents
- ERROR_SCALAR_TYPE = 2
- ERROR_SELF_CONVERSION_FORMULA = 3
- formula() : Exception
- Throw a new exception for an un unkown self conversioin unit formula.
- scalar() : self|Exception
- Throw a new exception for an unsupported scalar type of a unit's value.
Constants
ERROR_SCALAR_TYPE
public
mixed
ERROR_SCALAR_TYPE
= 2
ERROR_SELF_CONVERSION_FORMULA
public
mixed
ERROR_SELF_CONVERSION_FORMULA
= 3
Methods
formula()
Throw a new exception for an un unkown self conversioin unit formula.
public
static formula(string $symbol[, Exception $previous = null ]) : Exception
Parameters
- $symbol : string
-
The symbol of the unit lacking a formula
- $previous : Exception = null
Return values
Exception —scalar()
Throw a new exception for an unsupported scalar type of a unit's value.
public
static scalar(string $type[, array<string|int, mixed> $types = null ][, Exception $previous = null ]) : self|Exception
Parameters
- $type : string
-
The unsupported type that was attempted to be used.
- $types : array<string|int, mixed> = null
-
(optional) An array of supported types to use in the message.
- $previous : Exception = null