MediaWiki REL1_27
ScopedCallback Class Reference

Class for asserting that a callback happens when an dummy object leaves scope. More...

Inheritance diagram for ScopedCallback:

Public Member Functions

 __construct ( $callback, array $params=[])
 
 __destruct ()
 Trigger the callback when this leaves scope.
 

Static Public Member Functions

static cancel (ScopedCallback &$sc=null)
 Destroy a scoped callback without triggering it.
 
static consume (ScopedCallback &$sc=null)
 Trigger a scoped callback and destroy it.
 

Protected Attributes

callable $callback
 
array $params
 

Detailed Description

Class for asserting that a callback happens when an dummy object leaves scope.

Since
1.21

Definition at line 28 of file ScopedCallback.php.

Constructor & Destructor Documentation

◆ __construct()

ScopedCallback::__construct (   $callback,
array  $params = [] 
)
Parameters
callable | null$callback
array$paramsCallback arguments (since 1.25)
Exceptions
Exception

Definition at line 39 of file ScopedCallback.php.

References $callback, and $params.

◆ __destruct()

ScopedCallback::__destruct ( )

Trigger the callback when this leaves scope.

Reimplemented in SectionProfileCallback.

Definition at line 72 of file ScopedCallback.php.

Member Function Documentation

◆ cancel()

static ScopedCallback::cancel ( ScopedCallback $sc = null)
static

Destroy a scoped callback without triggering it.

Parameters
ScopedCallback$sc

Definition at line 62 of file ScopedCallback.php.

◆ consume()

Member Data Documentation

◆ $callback

callable ScopedCallback::$callback
protected

Definition at line 30 of file ScopedCallback.php.

Referenced by __construct().

◆ $params

array ScopedCallback::$params
protected

Definition at line 32 of file ScopedCallback.php.

Referenced by __construct().


The documentation for this class was generated from the following file: