MediaWiki  REL1_22
ScopedCallback Class Reference

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

List of all members.

Public Member Functions

 __construct ($callback)
 __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
 *

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

ScopedCallback::__construct ( callback)
Parameters:
callable$callback
Exceptions:
MWException

Definition at line 35 of file ScopedCallback.php.

Trigger the callback when this leaves scope.

Definition at line 67 of file ScopedCallback.php.


Member Function Documentation

static ScopedCallback::cancel ( ScopedCallback &$  sc = null) [static]

Destroy a scoped callback without triggering it.

Parameters:
ScopedCallback$sc

Definition at line 57 of file ScopedCallback.php.

static ScopedCallback::consume ( ScopedCallback &$  sc = null) [static]

Trigger a scoped callback and destroy it.

This is the same is just setting it to null.

Parameters:
ScopedCallback$sc

Definition at line 48 of file ScopedCallback.php.


Member Data Documentation

callable ScopedCallback::$callback [protected]

*

Definition at line 29 of file ScopedCallback.php.


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