Documentation

BadUnit extends Exception

Exception to be thrown when a bad unit of measurement is encountered.

Tags
version
1.0.0
since
0.8.0
author

Jordan Brauer 18744334+jordanbrauer@users.noreply.github.com

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
Return values
self|Exception

Search results