Make a callback run when a dummy object leaves the scope.
More...
|
| __construct ( $callback, 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 |
( |
| $callback, |
|
|
array | $params = [] ) |
- Parameters
-
callable | null | $callback | |
array | $params | Callback arguments (since 1.0.0, MediaWiki 1.25) |
◆ __sleep()
Wikimedia\ScopedCallback::__sleep |
( |
| ) |
|
Do not allow this class to be serialized.
- Returns
- never
◆ __wakeup()
Wikimedia\ScopedCallback::__wakeup |
( |
| ) |
|
Protect the caller against arbitrary code execution.
- Returns
- never
◆ cancel()
Destroy a scoped callback without triggering it.
- Parameters
-
◆ consume()
Trigger a scoped callback and destroy it.
This is the same as just setting it to null.
- Parameters
-
◆ 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
- Returns
- ScopedCallback|null
Also no benefit testing a function just returns null.
The documentation for this class was generated from the following file: