phpbotgram

SceneRegistryInterface

Resolves a scene identifier to a concrete `Scene` subclass name.

Provides the forward declaration used by ScenesManager; the concrete SceneRegistry (Task 5.11) implements this interface.

Mirrors the resolution logic inside ScenesManager._get_scene (aiogram/fsm/scene.py:670-671).

Table of Contents

Methods

get()  : Scene>
Resolve `$sceneType` to a concrete `Scene` class-string.

Methods

get()

Resolve `$sceneType` to a concrete `Scene` class-string.

public get(null|Scene>|State|string $sceneType) : Scene>

Accepted input forms:

  • A class-string<Scene> — returned as-is after validating the class is registered.
  • A State instance — resolved by matching $state->state() against the registered scene states.
  • A bare state string — resolved by matching against the registered scene states.
  • null — always throws SceneException (used by ScenesManager to detect the "clear FSM state" path).
Parameters
$sceneType : null|Scene>|State|string

The identifier to resolve.

Tags
throws
SceneException

When $sceneType is null or does not match any registered scene.

Return values
Scene>

The resolved concrete scene class.

On this page

Search results