phpbotgram

RCombinationOperation extends BaseOperation
in package

FinalYes

Reverse-binary combinator: the running value is on the RIGHT and a fixed literal (or nested `MagicFilter`) is on the LEFT. Powers the `__rxxx__` family of upstream operators — for example `'pong' + F.text` produces an `RCombinationOperation(left='pong', combinator=add)` whose `resolve(value)` returns `'pong' . $value`.

Mirrors upstream magic_filter.operations.combination.RCombinationOperation (magic_filter/operations/combination.py:25-37).

Table of Contents

Properties

$combinator  : Closure
$left  : 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.

Properties

Methods

__construct()

public __construct(mixed $left, Closure $combinator) : mixed
Parameters
$left : mixed
$combinator : Closure

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
bool

resolve()

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 nested MagicFilter against the root rather than the current intermediate value.

On this page

Search results