Types

class Ramsey\Uuid\Type\TypeInterface

Implements JsonSerializable and Serializable.

TypeInterface ensures consistency in typed values returned by ramsey/uuid.

toString()
Return type

string

__toString()
Return type

string

class Ramsey\Uuid\Type\NumberInterface

Implements Ramsey\Uuid\Type\TypeInterface.

NumberInterface ensures consistency in numeric values returned by ramsey/uuid.

isNegative()
Returns

True if this number is less than zero, false otherwise.

Return type

bool

class Ramsey\Uuid\Type\Decimal

Implements Ramsey\Uuid\Type\NumberInterface.

A value object representing a decimal, for type-safety purposes, to ensure that decimals returned from ramsey/uuid methods as strings are truly decimals and not some other kind of string.

To support values as true decimals and not as floats or doubles, we store the decimals as strings.

class Ramsey\Uuid\Type\Hexadecimal

Implements Ramsey\Uuid\Type\TypeInterface.

A value object representing a hexadecimal number, for type-safety purposes, to ensure that hexadecimal numbers returned from ramsey/uuid methods as strings are truly hexadecimal and not some other kind of string.

class Ramsey\Uuid\Type\Integer

Implements Ramsey\Uuid\Type\NumberInterface.

A value object representing an integer, for type-safety purposes, to ensure that integers returned from ramsey/uuid methods as strings are truly integers and not some other kind of string.

To support large integers beyond PHP_INT_MAX and PHP_INT_MIN on both 64-bit and 32-bit systems, we store the integers as strings.

class Ramsey\Uuid\Type\Time

Implements Ramsey\Uuid\Type\TypeInterface.

A value object representing a timestamp, for type-safety purposes, to ensure that timestamps used by ramsey/uuid are truly timestamp integers and not some other kind of string or integer.

getSeconds()
Return type

Ramsey\Uuid\Type\Integer

getMicroseconds()
Return type

Ramsey\Uuid\Type\Integer