PHP Class Resque\Helpers\SerializableClosure

Author: Michael Haynes ([email protected])
Inheritance: implements Serializabl\Serializable
显示文件 Open project: mjphaynes/php-resque

Protected Properties

Property Type Description
$closure Closure The Closure instance.
$code string The code contained by the Closure.
$reflection ReflectionFunction The ReflectionFunction instance of the Closure.

Public Methods

Method Description
__construct ( Closure $closure ) : void Create a new serializable Closure instance.
__invoke ( ) : mixed Invoke the contained Closure.
getClosure ( ) : Closure Get the unserialized Closure instance.
getCode ( ) : string Get the code for the Closure.
getVariables ( ) : array Get the variables used by the Closure.
serialize ( ) : string Serialize the Closure instance.
unserialize ( string $serialized ) : void Unserialize the Closure instance.

Protected Methods

Method Description
getCodeFromFile ( ) : string Extract the code from the Closure's file.
getFile ( ) : SplFileObject Get an SplObjectFile object at the starting line of the Closure.
getUseClauseVariables ( ) : array Get the variables from the "use" clause.
getUseIndex ( ) : integer Get the index location of the "use" clause.

Method Details

__construct() public method

Create a new serializable Closure instance.
public __construct ( Closure $closure ) : void
$closure Closure
return void

__invoke() public method

Invoke the contained Closure.
public __invoke ( ) : mixed
return mixed

getClosure() public method

Get the unserialized Closure instance.
public getClosure ( ) : Closure
return Closure

getCode() public method

Get the code for the Closure.
public getCode ( ) : string
return string

getCodeFromFile() protected method

Extract the code from the Closure's file.
protected getCodeFromFile ( ) : string
return string

getFile() protected method

Get an SplObjectFile object at the starting line of the Closure.
protected getFile ( ) : SplFileObject
return SplFileObject

getUseClauseVariables() protected method

Get the variables from the "use" clause.
protected getUseClauseVariables ( ) : array
return array

getUseIndex() protected method

Get the index location of the "use" clause.
protected getUseIndex ( ) : integer
return integer

getVariables() public method

Get the variables used by the Closure.
public getVariables ( ) : array
return array

serialize() public method

Serialize the Closure instance.
public serialize ( ) : string
return string

unserialize() public method

Unserialize the Closure instance.
public unserialize ( string $serialized ) : void
$serialized string
return void

Property Details

$closure protected_oe property

The Closure instance.
protected Closure $closure
return Closure

$code protected_oe property

The code contained by the Closure.
protected string $code
return string

$reflection protected_oe property

The ReflectionFunction instance of the Closure.
protected ReflectionFunction $reflection
return ReflectionFunction