phpbotgram

MethodCallOperation extends BaseOperation
in package

FinalYes

Invoke a named method on the running value: `F->text->lower()` resolves to `$value->lower()`. The Python upstream models this as `__getattr__` (binding the method) followed by `__call__` (invoking it); PHP doesn't expose bound methods as first-class values, so we collapse the pair into one step here.

Used by MagicFilter::__call: unknown method names that aren't named- operation builders (equals, func, …) are wrapped in this op.

Reject behaviour: missing method → RejectOperations so the resolver blanks the running value to null (matching upstream's getattrAttributeErrorRejectOperations chain).

Table of Contents

Properties

$args  : array<string|int, mixed>
$kwargs  : array<string|int, mixed>
$name  : string

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(string $name, array<int, mixed> $args, array<string, mixed> $kwargs) : mixed
Parameters
$name : string
$args : array<int, mixed>
$kwargs : array<string, 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
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