PHP Class Dotink\Parody\Quip

Author: Matthew J. Sahagian [mjs] ([email protected])
Datei anzeigen Open project: dotink/parody

Protected Properties

Property Type Description
$extended array The extended properties for this Quip
$factories array A list of availble factories for instantiating classes, keyed by class name
$methods array The registered methods on this Quip, keyed by method name
$mime Mime The mime associated with this object. This value is only set in the Mime constructor.
$objects array A list of the first created Quips keyed by class
$properties array The registered properties on this Quip, keyed by property name

Public Methods

Method Description
__call ( string $method, array $args ) : mixed Handle missing instance calls
__callStatic ( string $method, array $args ) : mixed Handle missing static calls
__construct ( ) : void Instantiate a new Quip.
__get ( string $property ) : mixed Handle missing instance properties
__isset ( string $property ) : boolean Handle checking whether or not properties are set
__set ( string $property, mixed $value ) : void Handle setting properties
__unset ( string $property ) : void Handle unsetting a property

Protected Methods

Method Description
qualify ( string $class ) : string Qualifies a class for the global namespace by ensuring it has a \ in front.

Method Details

__call() public method

This method will look for the value assigned via Mime::onCall which whose expectations match the arguments provided. If the value is a Closure the return value of the closure will be returned, but the Quip's mime will be passed as the first and only argument so that future behavior can be modified based on the call.
public __call ( string $method, array $args ) : mixed
$method string The method we are trying to call
$args array The arguments that were passed to the method
return mixed The value as mimicked by the call

__callStatic() public static method

Static calls are always looked up on the most recently instantiated Quip, so if you need to mimick their functionality you should create a mime and add them first.
public static __callStatic ( string $method, array $args ) : mixed
$method string The static method we are trying to call
$args array The arguments that were passed to the method
return mixed The value that the method should provide with matching expectations

__construct() public method

This method will look through the list of registered factories created with the Mime::onNew() method. The factory is passed a new mime wrapper with this quip as it's first and only argument for post-instantiation modification.
public __construct ( ) : void
return void

__get() public method

This method will return the value assigned via Mime::onGet. It is possible that a user is attempting to mimic a magic property which would normally be accessed and provided via the __get() method on the actual class. Since this method can contain logic, it is also possible to have a Closure registered with Mime::give() on a property. As with other mimicking, the Closure will be passed the mime object as the first and only argument.
public __get ( string $property ) : mixed
$property string The property we are trying to get
return mixed The value as mimicked by the property

__isset() public method

Handle checking whether or not properties are set
public __isset ( string $property ) : boolean
$property string The property to check if it is set
return boolean TRUE if the mimicked property is set, FALSE otherwise

__set() public method

Handle setting properties
public __set ( string $property, mixed $value ) : void
$property string THe property to set
$value mixed The value to set it to
return void

__unset() public method

Handle unsetting a property
public __unset ( string $property ) : void
$property string The property to check if it is set
return void

qualify() protected static method

Qualifies a class for the global namespace by ensuring it has a \ in front.
protected static qualify ( string $class ) : string
$class string The class to qualify
return string The qualfied class

Property Details

$extended protected_oe property

The extended properties for this Quip
protected array $extended
return array

$factories protected_oe static_oe property

A list of availble factories for instantiating classes, keyed by class name
protected static array $factories
return array

$methods protected_oe property

The registered methods on this Quip, keyed by method name
protected array $methods
return array

$mime protected_oe property

The mime associated with this object. This value is only set in the Mime constructor.
protected Mime,Dotink\Parody $mime
return Mime

$objects protected_oe static_oe property

A list of the first created Quips keyed by class
protected static array $objects
return array

$properties protected_oe property

The registered properties on this Quip, keyed by property name
protected array $properties
return array