Particle
in package
FinalYes
One of a `{:list-items}`'s items (DXNS.md ยง1a): a type for exactly one item, or a repeat of a group of them, `$max` `null` when there is no upper bound.
Table of Contents
Properties
Methods
- map() : self
- This particle with every type in it replaced by what `$map` makes of it.
- one() : self
- Exactly one item, a `$type`.
- repeat() : self
- The `$group`'s items, together, between `$min` and `$max` times.
- types() : array<int, TypeExpr>
- Every type in this particle, in order.
- __construct() : mixed
Properties
$group read-only
public
array<string|int, mixed>|null
$group
$max read-only
public
int|null
$max
$min read-only
public
int
$min
$type read-only
public
TypeExpr|null
$type
Methods
map()
This particle with every type in it replaced by what `$map` makes of it.
public
map(callable(TypeExpr): TypeExpr $map) : self
Parameters
Return values
selfone()
Exactly one item, a `$type`.
public
static one(TypeExpr $type) : self
Parameters
- $type : TypeExpr
Return values
selfrepeat()
The `$group`'s items, together, between `$min` and `$max` times.
public
static repeat(array<int, self> $group, int $min, int|null $max) : self
Parameters
- $group : array<int, self>
- $min : int
- $max : int|null
Return values
selftypes()
Every type in this particle, in order.
public
types() : array<int, TypeExpr>
Return values
array<int, TypeExpr>__construct()
private
__construct(TypeExpr|null $type, array<int, self>|null $group, int $min, int|null $max) : mixed
Parameters
- $type : TypeExpr|null
- $group : array<int, self>|null
- $min : int
- $max : int|null