Slot
in package
implements
ArrayAccess
FinalYes
One concrete slot in a slot space, or the special `nil` boundary slot.
Tags
Table of Contents
Interfaces
- ArrayAccess
Properties
- $attributes : array<string|int, mixed>
- $dimensions : array<string|int, mixed>|null
- $key : string
- $space : SlotSpace
Methods
- __construct() : mixed
- Create one concrete or nil slot instance.
- __toString() : non-empty-string
- Return the serialized slot key.
- dimension() : non-empty-string
- Get the value of a specific dimension by name.
- equals() : bool
- Compare two slots by their serialized key.
- isNil() : bool
- Return true when this is the special out-of-space nil slot.
- matches() : bool
- Return true when this slot matches the provided slot pattern.
- offsetExists() : bool
- offsetGet() : string|null
- offsetSet() : void
- offsetUnset() : void
- outgoingEdges() : array<non-empty-string, MovementEdge>
- Return the currently valid outgoing edges from this slot.
- with() : array<string|int, Slot>
- Return slots produced by overriding dimensions on this slot.
- withMeta() : self
- Return a copy of the slot with additional metadata attributes.
Properties
$attributes read-only
public
array<string|int, mixed>
$attributes
= []
$dimensions read-only
public
array<string|int, mixed>|null
$dimensions
$key read-only
public
string
$key
$space read-only
public
SlotSpace
$space
Methods
__construct()
Create one concrete or nil slot instance.
public
__construct(non-empty-string $key, array<non-empty-string, non-empty-string>|null $dimensions, SlotSpace $space[, array<string, mixed> $attributes = [] ]) : mixed
Parameters
- $key : non-empty-string
- $dimensions : array<non-empty-string, non-empty-string>|null
- $space : SlotSpace
- $attributes : array<string, mixed> = []
__toString()
Return the serialized slot key.
public
__toString() : non-empty-string
Return values
non-empty-stringdimension()
Get the value of a specific dimension by name.
public
dimension(non-empty-string $name) : non-empty-string
Parameters
- $name : non-empty-string
Return values
non-empty-stringequals()
Compare two slots by their serialized key.
public
equals(Slot $other) : bool
Parameters
- $other : Slot
Return values
boolisNil()
Return true when this is the special out-of-space nil slot.
public
isNil() : bool
Return values
boolmatches()
Return true when this slot matches the provided slot pattern.
public
matches(array<string|int, mixed>|string|null $pattern) : bool
Parameters
- $pattern : array<string|int, mixed>|string|null
Tags
Return values
booloffsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Attributes
- #[Override]
Return values
booloffsetGet()
public
offsetGet(mixed $offset) : string|null
Parameters
- $offset : mixed
Attributes
- #[Override]
Return values
string|nulloffsetSet()
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
Attributes
- #[Override]
offsetUnset()
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
Attributes
- #[Override]
outgoingEdges()
Return the currently valid outgoing edges from this slot.
public
outgoingEdges() : array<non-empty-string, MovementEdge>
Return values
array<non-empty-string, MovementEdge>with()
Return slots produced by overriding dimensions on this slot.
public
with(array<non-empty-string, non-empty-string> $overrides) : array<string|int, Slot>
May return an empty array if the overridden slot does not exist. If this is the nil slot, the overrides are treated as a partial pattern match.
Parameters
- $overrides : array<non-empty-string, non-empty-string>
Return values
array<string|int, Slot>withMeta()
Return a copy of the slot with additional metadata attributes.
public
withMeta(array<string, mixed> $attributes) : self
Existing attributes keep precedence over newly provided ones.
Parameters
- $attributes : array<string, mixed>