Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
tbfguestbe.tbf.ro
/
vendor
/
laravel
/
prompts
/
src
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
ConfirmPrompt.php
| Size :
1.32
KB
Copy
<?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 ?Closure $validate = null, public string $hint = '' ) { $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; } }
Back