abstract class Util

Static utility methods

Methods

static array
decodePointer(string $pointer)

Decode a JSON pointer to a path array

static string
encodePointer(array $path)

Encode a path array as a JSON pointer

static bool
compare(mixed $valueOne, mixed $valueTwo)

Compare two values for equality

static int
typeMask(mixed $value, bool $onlyOne = false)

Get the type mask for a given value

static mixed
cast(int $asType, mixed $value)

Cast a value to conform to the given type mask, losing as little fidelity as possible

Details

at line 26
static array decodePointer(string $pointer)

Decode a JSON pointer to a path array

Parameters

string $pointer JSON pointer

Return Value

array Array of path elements

at line 47
static string encodePointer(array $path)

Encode a path array as a JSON pointer

Parameters

array $path Array of path elements

Return Value

string JSON pointer

at line 64
static bool compare(mixed $valueOne, mixed $valueTwo)

Compare two values for equality

Parameters

mixed $valueOne
mixed $valueTwo

Return Value

bool

at line 145
static int typeMask(mixed $value, bool $onlyOne = false)

Get the type mask for a given value

Parameters

mixed $value Value to test
bool $onlyOne Whether to set only one type (the most specific)

Return Value

int Type mask

at line 191
static mixed cast(int $asType, mixed $value)

Cast a value to conform to the given type mask, losing as little fidelity as possible

Parameters

int $asType The type mask to cast to
mixed $value The value to cast

Return Value

mixed The cast value