DeferInterface
extends
Countable
in
This interface MUST be implemented by any class that manages deferred callbacks.
Implementations SHALL provide mechanisms to register, execute, and check the presence of callbacks. All documentation MUST be in English and use RFC 2119 terminology.
Table of Contents
Methods
- __invoke() : void
- Registers a callback to be executed later.
- defer() : void
- Registers a callback to be executed later.
- isEmpty() : bool
- Determines if there are no registered callbacks.
Methods
__invoke()
Registers a callback to be executed later.
public
__invoke(callable $callback, mixed ...$arguments) : void
This method MUST add the callback to the stack. It MAY be called multiple times.
Parameters
- $callback : callable
-
the callback to register
- $arguments : mixed
-
Arguments for the callback.
defer()
Registers a callback to be executed later.
public
defer(callable $callback, mixed ...$args) : void
This method MUST add the callback to the stack. It MAY be called multiple times.
Parameters
- $callback : callable
-
the callback to register
- $args : mixed
-
Arguments for the callback.
isEmpty()
Determines if there are no registered callbacks.
public
isEmpty() : bool
This method MUST return true if no callbacks are registered; otherwise, it MUST return false.
Return values
bool —true if no callbacks are registered; otherwise, false