PHP Class Pheasant\Property

Show file Open project: lox/pheasant

Public Properties

Property Type Description
$name
$type

Public Methods

Method Description
__construct ( $name, $type ) Constructor
__toString ( ) Returns the name of the property
defaultValue ( ) Returns the default value for a property, or NULL
getter ( $key ) : closure Return a closure for accessing the value of the property
hasDefaultValue ( ) : boolean Returns a bool for whether the property has a default value
reference ( $object ) : PropertyReference Returns a reference to the property value of a specific object
setter ( $key ) : closure Return a closure that when called sets the value of the property

Method Details

__construct() public method

Constructor
public __construct ( $name, $type )

__toString() public method

Returns the name of the property
public __toString ( )

defaultValue() public method

Returns the default value for a property, or NULL
public defaultValue ( )

getter() public method

Return a closure for accessing the value of the property
public getter ( $key ) : closure
return closure

hasDefaultValue() public method

Returns a bool for whether the property has a default value
public hasDefaultValue ( ) : boolean
return boolean

reference() public method

Returns a reference to the property value of a specific object
public reference ( $object ) : PropertyReference
return PropertyReference

setter() public method

Return a closure that when called sets the value of the property
public setter ( $key ) : closure
return closure

Property Details

$name public property

public $name

$type public property

public $type