Skip to content

Hexadecimal

A value object representing a hexadecimal number

This class exists 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.

  • Full name: \Ramsey\Uuid\Type\Hexadecimal
  • This class is marked as final and can't be subclassed
  • This class implements: \Ramsey\Uuid\Type\TypeInterface
  • This class is a Final class

Properties

value

private string $value

Methods

__construct

public __construct(self|string $value): mixed

Parameters:

Parameter Type Description
$value self|string The hexadecimal value to store

toString

public toString(): string

__toString

public __toString(): string

jsonSerialize

public jsonSerialize(): string

serialize

public serialize(): string

__serialize

public __serialize(): array{string: string}

unserialize

Constructs the object from a serialized string representation

public unserialize(string $data): void

Parameters:

Parameter Type Description
$data string The serialized string representation of the object

__unserialize

public __unserialize(array{string?: string} $data): void

Parameters:

Parameter Type Description
$data array{string?: string}

prepareValue

private prepareValue(string $value): string

Parameters:

Parameter Type Description
$value string


Automatically generated on 2025-03-18