Make a callback run when a dummy object leaves the scope.
More...
|
| | __construct (?callable $callback, protected readonly array $params=[]) |
| |
|
| __destruct () |
| | Trigger the callback when it leaves scope.
|
| |
|
| __sleep () |
| | Do not allow this class to be serialized.
|
| |
|
| __wakeup () |
| | Protect the caller against arbitrary code execution.
|
| |
Make a callback run when a dummy object leaves the scope.
◆ __construct()
| Wikimedia\ScopedCallback::__construct |
( |
?callable | $callback, |
|
|
protected readonly array | $params = [] ) |
- Parameters
-
| callable | null | $callback | |
| array | $params | Callback arguments (since 1.0.0, MediaWiki 1.25) |
◆ consume()
Trigger a scoped callback and destroy it.
This is the same as just setting it to null.
◆ newScopedIgnoreUserAbort()
| static Wikimedia\ScopedCallback::newScopedIgnoreUserAbort |
( |
| ) |
|
|
static |
Make PHP ignore user aborts/disconnects until the returned value leaves scope.
This returns null and does nothing in CLI mode.
- Since
- 3.0.0
Also no benefit testing a function just returns null.
The documentation for this class was generated from the following file: