芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/reginaeigbe.com/folder/admin/tmp/vendor/laravel/prompts/src/Concerns/Themes.php
, class-string
>> */ protected static array $themes = [ 'default' => [ TextPrompt::class => TextPromptRenderer::class, PasswordPrompt::class => PasswordPromptRenderer::class, SelectPrompt::class => SelectPromptRenderer::class, MultiSelectPrompt::class => MultiSelectPromptRenderer::class, ConfirmPrompt::class => ConfirmPromptRenderer::class, PausePrompt::class => PausePromptRenderer::class, SearchPrompt::class => SearchPromptRenderer::class, MultiSearchPrompt::class => MultiSearchPromptRenderer::class, SuggestPrompt::class => SuggestPromptRenderer::class, Spinner::class => SpinnerRenderer::class, Note::class => NoteRenderer::class, Table::class => TableRenderer::class, Progress::class => ProgressRenderer::class, ], ]; /** * Get or set the active theme. * * @throws \InvalidArgumentException */ public static function theme(?string $name = null): string { if ($name === null) { return static::$theme; } if (! isset(static::$themes[$name])) { throw new InvalidArgumentException("Prompt theme [{$name}] not found."); } return static::$theme = $name; } /** * Add a new theme. * * @param array
, class-string
> $renderers */ public static function addTheme(string $name, array $renderers): void { if ($name === 'default') { throw new InvalidArgumentException('The default theme cannot be overridden.'); } static::$themes[$name] = $renderers; } /** * Get the renderer for the current prompt. */ protected function getRenderer(): callable { $class = get_class($this); return new (static::$themes[static::$theme][$class] ?? static::$themes['default'][$class])($this); } /** * Render the prompt using the active theme. */ protected function renderTheme(): string { $renderer = $this->getRenderer(); return $renderer($this); } }