After
in package
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
$action
public
SceneAction
$action
$scene
public
State|string|null
$scene
= null
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
Entertransitions. Unused (and should benull) forExit/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
selfexit()
Exit the FSM after the handler returns.
public
static exit() : self
Mirrors After.exit() (aiogram/fsm/scene.py:894-895).
Return values
selfgoto()
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
Stateinstance, a bare state string, ornullto clear FSM state.