php-dextrin

DXNSet
in package
implements DXNValueInterface

FinalYes

DXN `set` (`@{...}`) -- deduplicated at construction, structural equality, order-independent.

Table of Contents

Interfaces

DXNValueInterface
Implemented by every `DXN*` wrapper class -- the PHP analog of the `dxnType` string tag used for kind dispatch in the JS port, and of `Dextrin.Value`'s closed type union in the Elixir original. Native PHP values (`null`, `bool`, `int`, `float`, `string`, and `array` for `map`/`array`) never implement this; {@see Equality::kindOf()} handles those directly.

Constants

DXN_TYPE  : mixed = 'set'

Properties

$items  : array<int, mixed>

Methods

__construct()  : mixed
compareTo()  : int
A total order against any other DXN value, not just another instance of this class -- backs {@see DXNSortedSet}. Cross-kind ordering is implementation-defined per DXN.md; within a kind, uses the kind's own natural order where one exists, or a deterministic structural fallback where it doesn't.
dxnType()  : string
The DXN type name this value represents, e.g. "symbol", "uuid".
equals()  : bool
Structural equality, recursing into nested DXN values as needed.
fromArray()  : self
toArray()  : array<int, mixed>
dedupe()  : array<int, mixed>

Constants

DXN_TYPE

private mixed DXN_TYPE = 'set'

Properties

$items read-only

public array<int, mixed> $items

Methods

__construct()

public __construct(array<string|int, mixed> $items) : mixed
Parameters
$items : array<string|int, mixed>

compareTo()

A total order against any other DXN value, not just another instance of this class -- backs {@see DXNSortedSet}. Cross-kind ordering is implementation-defined per DXN.md; within a kind, uses the kind's own natural order where one exists, or a deterministic structural fallback where it doesn't.

public compareTo(mixed $other) : int
Parameters
$other : mixed
Return values
int

dxnType()

The DXN type name this value represents, e.g. "symbol", "uuid".

public dxnType() : string
Return values
string

equals()

Structural equality, recursing into nested DXN values as needed.

public equals(mixed $other) : bool
Parameters
$other : mixed
Return values
bool

fromArray()

public static fromArray(array<string|int, mixed> $items) : self
Parameters
$items : array<string|int, mixed>
Return values
self

toArray()

public toArray() : array<int, mixed>
Return values
array<int, mixed>

dedupe()

private static dedupe(array<int, mixed> $items) : array<int, mixed>
Parameters
$items : array<int, mixed>
Return values
array<int, mixed>
On this page

Search results