PHP Class XPSPL\SIG

The SIG object is the representation of a signal. Every SIG object is represented as an index, with each index being a valid indexable value. By default a SIG will generate it's index based simply on the value of the function get_class. The SIG object allows for unique signals by creating a child of SIG with the property of _unique set as true. .. note:: When a SIG is declared unique any index assigned to the SIG on construct will be ignored.
Since: 0.3.0
Inheritance: use trait State
Mostra file Open project: prggmr/xpspl Class Usage Examples

Protected Properties

Property Type Description
$_index string | integer Signal index.
$_parent object Parent signal.
$_unique boolean Declare this SIG as unique.

Public Methods

Method Description
__construct ( string | integer $index = null ) : void Constructs a new signal.
__get ( mixed $key ) : mixed | null Get a variable in the signal.
__isset ( mixed $key ) : boolean Checks for a variable in the signal.
__set ( string $key, mixed $value ) : boolean Set a variable in the signal.
__toString ( ) : string String representation.
__unset ( mixed $key ) : boolean Deletes a variable in the signal.
compare ( SIG $sig ) : boolean Compare if the given $sig is identical to this.
get_index ( ) : boolean Returns the signal index.
get_parent ( ) : null | object Retrieves this signal's parent.
halt ( ) : void Halts the signal execution.
is_child ( ) : boolean Determines if the signal is a child of another signal.
set_parent ( SIG $signal ) : void Sets the parent signal.

Method Details

__construct() public method

Constructs a new signal.
public __construct ( string | integer $index = null ) : void
$index string | integer Signal Index
return void

__get() public method

Get a variable in the signal.
public __get ( mixed $key ) : mixed | null
$key mixed Variable name.
return mixed | null

__isset() public method

Checks for a variable in the signal.
public __isset ( mixed $key ) : boolean
$key mixed Variable name.
return boolean

__set() public method

Set a variable in the signal.
public __set ( string $key, mixed $value ) : boolean
$key string Name of variable
$value mixed Value to variable
return boolean True

__toString() public method

String representation.
public __toString ( ) : string
return string

__unset() public method

Deletes a variable in the signal.
public __unset ( mixed $key ) : boolean
$key mixed Variable name.
return boolean

compare() public method

Compare if the given $sig is identical to this.
public compare ( SIG $sig ) : boolean
$sig SIG SIG to compare.
return boolean

get_index() public method

Returns the signal index.
public get_index ( ) : boolean
return boolean

get_parent() public method

Retrieves this signal's parent.
public get_parent ( ) : null | object
return null | object

halt() public method

Halts the signal execution.
public halt ( ) : void
return void

is_child() public method

Determines if the signal is a child of another signal.
public is_child ( ) : boolean
return boolean

set_parent() public method

Sets the parent signal.
public set_parent ( SIG $signal ) : void
$signal SIG \XPSPL\Signal
return void

Property Details

$_index protected_oe property

Signal index.
protected string|int $_index
return string | integer

$_parent protected_oe property

Parent signal.
protected object $_parent
return object

$_unique protected_oe property

Declare this SIG as unique.
protected bool $_unique
return boolean