GetItemOperation
extends BaseOperation
in package
Subscript / index access: `F->items[$key]` resolves to `$value[$key]`.
Mirrors upstream magic_filter.operations.getitem.GetItemOperation
(magic_filter/operations/getitem.py). Two special keys flip the
resolver into a "fan-out" mode over an iterable subject:
MagicFilter::WILDCARD_ALL(PHP equivalent of Python's[:]empty slice) — raiseSwitchModeToAll, resolver re-runs the rest of the chain on every element and accepts when ALL succeed.MagicFilter::WILDCARD_ANY(PHP equivalent of Python's[...]Ellipsis) — raiseSwitchModeToAny, resolver accepts when ANY element succeeds.
Both wildcards require the current value to be iterable; otherwise we fall through to the literal subscript path and let it reject normally.
Table of Contents
Properties
- $key : mixed
Methods
- __construct() : mixed
- important() : bool
- `true` for operations that must always evaluate even when an earlier step in the chain raised `RejectOperations`. The canonical example is `~F->message->text` (`ImportantFunctionOperation` wrapping logical NOT): if `text` is missing we want the negation to still flip the `null` result to `true` rather than collapse to `false`.
- resolve() : mixed
- Evaluate this operation.
- keyDescription() : string
Properties
$key read-only
public
mixed
$key
Methods
__construct()
public
__construct(mixed $key) : mixed
Parameters
- $key : mixed
important()
`true` for operations that must always evaluate even when an earlier step in the chain raised `RejectOperations`. The canonical example is `~F->message->text` (`ImportantFunctionOperation` wrapping logical NOT): if `text` is missing we want the negation to still flip the `null` result to `true` rather than collapse to `false`.
public
important() : bool
Subclasses opt in by extending ImportantBaseOperation or by
overriding this method directly.
Return values
boolresolve()
Evaluate this operation.
public
resolve(mixed $value, mixed $initialValue) : mixed
Parameters
- $value : mixed
-
The current running value (output of the previous operation, or the original subject for the first step).
- $initialValue : mixed
-
The original subject passed to
MagicFilter::resolve. Used by combinator / comparator operations that need to resolve a nestedMagicFilteragainst the root rather than the current intermediate value.
keyDescription()
private
keyDescription() : string