phpbotgram

After
in package

Read onlyYes
FinalYes

Describes what the framework should do **after** a scene handler returns.

Mirrors the After dataclass (aiogram/fsm/scene.py:890-906). Upstream uses @dataclass with three class-method factories; the PHP port uses a final readonly class with static factory methods and named constructor arguments.

Usage:

#[OnMessage(after: After::exit())] public function handleMessage(...): void { ... }

Factory methods:

  • After::exit() — exit FSM after the handler returns.
  • After::back() — go back one step in history.
  • After::goto($scene) — transition to $scene.

Table of Contents

Properties

$action  : SceneAction
$scene  : State|string|null

Methods

__construct()  : mixed
back()  : self
Roll back to the previous scene after the handler returns.
exit()  : self
Exit the FSM after the handler returns.
goto()  : self
Transition to `$scene` after the handler returns.

Properties

Methods

__construct()

public __construct(SceneAction $action[, null|Scene>|State|string $scene = null ]) : mixed
Parameters
$action : SceneAction

The action to execute after the handler.

$scene : null|Scene>|State|string = null

Target scene for Enter transitions. Unused (and should be null) for Exit / Back.

back()

Roll back to the previous scene after the handler returns.

public static back() : self

Mirrors After.back() (aiogram/fsm/scene.py:897-898).

Return values
self

exit()

Exit the FSM after the handler returns.

public static exit() : self

Mirrors After.exit() (aiogram/fsm/scene.py:894-895).

Return values
self

goto()

Transition to `$scene` after the handler returns.

public static goto(null|Scene>|State|string $scene) : self

Mirrors After.goto() (aiogram/fsm/scene.py:900-901).

Parameters
$scene : null|Scene>|State|string

The target scene class name, a State instance, a bare state string, or null to clear FSM state.

Return values
self
On this page

Search results