final class ConditionOrder

Accepts the condition clauses of one statement in EARS order.

The order is an optional feature (Where) at most once, then preconditions (While), then at most one trigger (When or If). The trigger decides how the system clause must begin.

Methods§

public function accept(string $clause): void

Accepts the next condition clause.

Parameters

$clausestringThe clause text before the system response

Throws

InvalidInputException When the clause lacks a keyword or text, is out of order, or contains shall or then
Test cases 5
Called from 1
Calls 5
public function trigger(): string|null

Returns the trigger keyword accepted so far.

Returns

string|null "when" or "if", or null without a trigger
Test cases 3
Called from 1

Private surface 2§

Implementation details, listed for orientation only.

private int $rank = 0
private ?string $trigger = null

Test cases 22§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 6
Other tests reaching this symbol 16

Relations§

Instantiated in 1
Method calls 2