⚝
One Hat Cyber Team
⚝
Your IP:
18.188.37.186
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 :
FormStep.php
<?php namespace Laravel\Prompts; use Closure; class FormStep { protected readonly Closure $condition; public function __construct( protected readonly Closure $step, bool|Closure $condition, public readonly ?string $name, protected readonly bool $ignoreWhenReverting, ) { $this->condition = is_bool($condition) ? fn () => $condition : $condition; } /** * Execute this step. * * @param array<mixed> $responses */ public function run(array $responses, mixed $previousResponse): mixed { if (! $this->shouldRun($responses)) { return null; } return ($this->step)($responses, $previousResponse); } /** * Whether the step should run based on the given condition. * * @param array<mixed> $responses */ protected function shouldRun(array $responses): bool { return ($this->condition)($responses); } /** * Whether this step should be skipped over when a subsequent step is reverted. * * @param array<mixed> $responses */ public function shouldIgnoreWhenReverting(array $responses): bool { if (! $this->shouldRun($responses)) { return true; } return $this->ignoreWhenReverting; } }