⚝
One Hat Cyber Team
⚝
Your IP:
160.79.111.20
Server IP:
162.254.39.145
Server:
Linux premium289.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
Server Software:
LiteSpeed
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
favoaysf
/
www
/
vendor
/
laravel
/
prompts
/
src
/
View File Name :
ConfirmPrompt.php
<?php namespace Laravel\Prompts; use Closure; class ConfirmPrompt extends Prompt { /** * Whether the prompt has been confirmed. */ public bool $confirmed; /** * Create a new ConfirmPrompt instance. */ public function __construct( public string $label, public bool $default = true, public string $yes = 'Yes', public string $no = 'No', public bool|string $required = false, public mixed $validate = null, public string $hint = '', public ?Closure $transform = null, ) { $this->confirmed = $default; $this->on('key', fn ($key) => match ($key) { 'y' => $this->confirmed = true, 'n' => $this->confirmed = false, Key::TAB, Key::UP, Key::UP_ARROW, Key::DOWN, Key::DOWN_ARROW, Key::LEFT, Key::LEFT_ARROW, Key::RIGHT, Key::RIGHT_ARROW, Key::CTRL_P, Key::CTRL_F, Key::CTRL_N, Key::CTRL_B, 'h', 'j', 'k', 'l' => $this->confirmed = ! $this->confirmed, Key::ENTER => $this->submit(), default => null, }); } /** * Get the value of the prompt. */ public function value(): bool { return $this->confirmed; } /** * Get the label of the selected option. */ public function label(): string { return $this->confirmed ? $this->yes : $this->no; } }