class Signals (View source)

internal  
 

Properties

protected SignalRegistry $registry

The signal registry instance.

protected array<int, array<int, callable>>|null $previousHandlers

The signal registry's previous list of handlers.

static protected callable(): bool|null $availabilityResolver

The current availability resolver, if any.

Methods

void
__construct(SignalRegistry $registry)

Create a new signal registrar instance.

void
register(int $signal, callable(int $signal): void $callback)

Register a new signal handler.

array<int, callable(int $signal): void>
initializeSignal($signal)

Gets the signal's existing handler in array format.

array<int, array<int, callable(int $signal): void>>
unregister()

Unregister the current signal handlers.

static void
whenAvailable(callable $callback)

Execute the given callback if "signals" should be used and are available.

array<int, array<int, callable>>
getHandlers()

Get the registry's handlers.

void
setHandlers(array<int, array<int, callable(int $signal): void>> $handlers)

Set the registry's handlers.

static 
resolveAvailabilityUsing($resolver)

Set the availability resolver.

Details

void __construct(SignalRegistry $registry)

Create a new signal registrar instance.

Parameters

SignalRegistry $registry

Return Value

void

void register(int $signal, callable(int $signal): void $callback)

Register a new signal handler.

Parameters

int $signal
callable(int $signal): void $callback

Return Value

void

protected array<int, callable(int $signal): void> initializeSignal($signal)

Gets the signal's existing handler in array format.

Parameters

$signal

Return Value

array<int, callable(int $signal): void>

array<int, array<int, callable(int $signal): void>> unregister()

Unregister the current signal handlers.

Return Value

array<int, array<int, callable(int $signal): void>>

static void whenAvailable(callable $callback)

Execute the given callback if "signals" should be used and are available.

Parameters

callable $callback

Return Value

void

protected array<int, array<int, callable>> getHandlers()

Get the registry's handlers.

Return Value

array<int, array<int, callable>>

protected void setHandlers(array<int, array<int, callable(int $signal): void>> $handlers)

Set the registry's handlers.

Parameters

array<int, array<int, callable(int $signal): void>> $handlers

Return Value

void

static resolveAvailabilityUsing($resolver)

Set the availability resolver.

Parameters

$resolver

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.