PathSegment
in package
FinalYes
A single path segment: identifier (field name), wildcard (*), or index (numeric array index). The index value serializes as a number to match the JS reference's segment shape ({type:'index', value:number}).
Table of Contents
Properties
Methods
- identifier() : self
- A named-field segment.
- index() : self
- A fixed numeric array-index segment.
- toArray() : array<string, mixed>
- Serialize to the JS segment shape (index value emitted as a number).
- wildcard() : self
- A wildcard (*) segment matching any array index.
- __construct() : mixed
Properties
$index read-only
public
int|null
$index
$type read-only
public
string
$type
$value read-only
public
string|null
$value
Methods
identifier()
A named-field segment.
public
static identifier(string $value) : self
Parameters
- $value : string
Return values
selfindex()
A fixed numeric array-index segment.
public
static index(int $value) : self
Parameters
- $value : int
Return values
selftoArray()
Serialize to the JS segment shape (index value emitted as a number).
public
toArray() : array<string, mixed>
Return values
array<string, mixed>wildcard()
A wildcard (*) segment matching any array index.
public
static wildcard() : self
Return values
self__construct()
private
__construct(string $type, string|null $value, int|null $index) : mixed
Parameters
- $type : string
- $value : string|null
- $index : int|null