allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
41
vendor/laravel/prompts/src/Concerns/Events.php
vendored
Normal file
41
vendor/laravel/prompts/src/Concerns/Events.php
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Prompts\Concerns;
|
||||
|
||||
use Closure;
|
||||
|
||||
trait Events
|
||||
{
|
||||
/**
|
||||
* The registered event listeners.
|
||||
*
|
||||
* @var array<string, array<int, Closure>>
|
||||
*/
|
||||
protected array $listeners = [];
|
||||
|
||||
/**
|
||||
* Register an event listener.
|
||||
*/
|
||||
public function on(string $event, Closure $callback): void
|
||||
{
|
||||
$this->listeners[$event][] = $callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit an event.
|
||||
*/
|
||||
public function emit(string $event, mixed ...$data): void
|
||||
{
|
||||
foreach ($this->listeners[$event] ?? [] as $listener) {
|
||||
$listener(...$data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean the event listeners.
|
||||
*/
|
||||
public function clearListeners(): void
|
||||
{
|
||||
$this->listeners = [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user