Themes
trait Themes
Constants
| protected DEFAULT_THEME |
The default theme name. |
| protected DEFAULT_THEMES |
The default theme registry. |
Properties
| static protected string | $theme | The name of the active theme. |
|
| static protected Prompt>, class-string<callable&object>>> | $themes | The available themes. |
Methods
Get or set the active theme.
Add a new theme.
Get the renderer for the current prompt.
Render the prompt using the active theme.
Reset theme state to defaults.
Details
at line 118
static string
theme(string|null $name = null)
Get or set the active theme.
A given theme persists in a static property for the worker lifetime and applies to every subsequent prompt render.
at line 140
static void
addTheme(string $name, array $renderers)
Add a new theme.
Themes persist in a static property for the worker lifetime and are available to every subsequent prompt render.
at line 153
protected callable
getRenderer()
Get the renderer for the current prompt.
at line 168
protected string
renderTheme()
Render the prompt using the active theme.
at line 181
static void
resetTheme()
Reset theme state to defaults.
Clears worker-wide prompt theme configuration; concurrent prompts may render with different themes depending on timing.