Documentation

GenericNumberConverter
in package
implements NumberConverterInterface

GenericNumberConverter uses the provided calculator to convert decimal numbers to and from hexadecimal values

Tags
psalm-immutable

Interfaces, Classes, Traits and Enums

NumberConverterInterface
A number converter converts UUIDs from hexadecimal characters into representations of integers and vice versa

Table of Contents

$calculator  : CalculatorInterface
__construct()  : mixed
fromHex()  : string
Converts a hexadecimal number into an string integer representation of the number
toHex()  : string
Converts a string integer representation into a hexadecimal string representation of the number

Properties

Methods

fromHex()

Converts a hexadecimal number into an string integer representation of the number

public fromHex(string $hex) : string
Parameters
$hex : string

The hexadecimal string representation to convert

Tags
inheritDoc
psalm-pure
psalm-return

numeric-string

psalm-suppress

MoreSpecificReturnType we know that the retrieved string is never empty

psalm-suppress

LessSpecificReturnStatement we know that the retrieved string is never empty

Return values
string

String representation of an integer

toHex()

Converts a string integer representation into a hexadecimal string representation of the number

public toHex(string $number) : string
Parameters
$number : string

A string integer representation to convert; this must be a numeric string to accommodate unsigned integers greater than PHP_INT_MAX.

Tags
inheritDoc
psalm-pure
psalm-return

non-empty-string

psalm-suppress

MoreSpecificReturnType we know that the retrieved string is never empty

psalm-suppress

LessSpecificReturnStatement we know that the retrieved string is never empty

Return values
string

Hexadecimal string

Search results