|
XRL
latest
Simple XML-RPC Library (both client and server)
|
Class used to represent anything that is callable. More...
Inheritance diagram for fpoirotte\XRL\CallableObject:Public Member Functions | |
| __construct ($callable) | |
| __invoke (&...$args) | |
| __toString () | |
| getCallable () | |
| getReflector () | |
| getRepresentation () | |
Public Member Functions inherited from fpoirotte\XRL\CallableInterface | |
| __invoke () | |
Protected Attributes | |
| $callableObj | |
| Inner callable object, as used by PHP. | |
| $representation | |
| Human representation of the inner callable. | |
Class used to represent anything that is callable.
This class can represent a wild range of callable items supported by PHP (functions, lambdas, methods, closures, etc.).
Definition at line 23 of file CallableObject.php.
| fpoirotte\XRL\CallableObject::__construct | ( | $callable | ) |
Constructs a new callable object, abstracting differences between the different constructs PHP supports.
| mixed | $callable | A callable item. It must be compatible with the PHP callback pseudo-type. |
| InvalidArgumentException | The given item is not compatible with the PHP callback pseudo-type. |
Definition at line 48 of file CallableObject.php.
References fpoirotte\XRL\CallableObject\$representation.
| fpoirotte\XRL\CallableObject::__invoke | ( | &... | $args | ) |
Definition at line 77 of file CallableObject.php.
| fpoirotte\XRL\CallableObject::__toString | ( | ) |
Alias for fpoirotte::XRL::CallableInterface::getRepresentation().
| string | Human representation of this callable. |
Implements fpoirotte\XRL\CallableInterface.
Definition at line 83 of file CallableObject.php.
References fpoirotte\XRL\CallableObject\$representation.
| fpoirotte\XRL\CallableObject::getCallable | ( | ) |
Returns the callable object in its raw form (as used by PHP).
| string | The name of the function this callable represents, which can be either a core function, a user-defined function, or the result of a call to create_function(). |
| array | An array whose contents matches the definition of a PHP callback, that is:
|
| object | Either a Closure object or an instance of a class that implements the __invoke() magic method. |
Implements fpoirotte\XRL\CallableInterface.
Definition at line 65 of file CallableObject.php.
References fpoirotte\XRL\CallableObject\$callableObj.
| fpoirotte\XRL\CallableObject::getReflector | ( | ) |
Get a reflection objets for the function/method/object represented by this callable.
| Reflector | Reflection object for this callable's inner PHP callback. |
Implements fpoirotte\XRL\CallableInterface.
Definition at line 89 of file CallableObject.php.
References fpoirotte\XRL\CallableObject\$callableObj.
| fpoirotte\XRL\CallableObject::getRepresentation | ( | ) |
Returns a human representation of this callable. For (anonymous) functions, this is a string containing the name of that function. For methods and classes that implement the __invoke() magic method (including Closures), this is a string of the form "ClassName::methodname".
| string | Human representation of this callable. |
Implements fpoirotte\XRL\CallableInterface.
Definition at line 71 of file CallableObject.php.
References fpoirotte\XRL\CallableObject\$representation.