| 1 |
<?php |
| 2 |
|
| 3 |
namespace FL\Assistant\System\Container; |
| 4 |
|
| 5 |
interface Reflector { |
| 6 |
|
| 7 |
/** |
| 8 |
* Retrieves ReflectionClass instances, caching them for future retrieval |
| 9 |
* |
| 10 |
* @param string $class |
| 11 |
* @return \ReflectionClass |
| 12 |
*/ |
| 13 |
public function getClass( $class); |
| 14 |
|
| 15 |
/** |
| 16 |
* Retrieves and caches the constructor (ReflectionMethod) for the specified class |
| 17 |
* |
| 18 |
* @param string $class |
| 19 |
* @return \ReflectionMethod |
| 20 |
*/ |
| 21 |
public function getCtor( $class); |
| 22 |
|
| 23 |
/** |
| 24 |
* Retrieves and caches an array of constructor parameters for the given class |
| 25 |
* |
| 26 |
* @param string $class |
| 27 |
* @return \ReflectionParameter[] |
| 28 |
*/ |
| 29 |
public function getCtorParams( $class); |
| 30 |
|
| 31 |
/** |
| 32 |
* Retrieves the class type-hint from a given ReflectionParameter |
| 33 |
* |
| 34 |
* There is no way to directly access a parameter's type-hint without |
| 35 |
* instantiating a new ReflectionClass instance and calling its getName() |
| 36 |
* method. This method stores the results of this approach so that if |
| 37 |
* the same parameter type-hint or ReflectionClass is needed again we |
| 38 |
* already have it cached. |
| 39 |
* |
| 40 |
* @param \ReflectionFunctionAbstract $function |
| 41 |
* @param \ReflectionParameter $param |
| 42 |
*/ |
| 43 |
public function getParamTypeHint( \ReflectionFunctionAbstract $function, \ReflectionParameter $param); |
| 44 |
|
| 45 |
/** |
| 46 |
* Retrieves and caches a reflection for the specified function |
| 47 |
* |
| 48 |
* @param string $functionName |
| 49 |
* @return \ReflectionFunction |
| 50 |
*/ |
| 51 |
public function getFunction( $functionName); |
| 52 |
|
| 53 |
/** |
| 54 |
* Retrieves and caches a reflection for the specified class method |
| 55 |
* |
| 56 |
* @param mixed $classNameOrInstance |
| 57 |
* @param string $methodName |
| 58 |
* @return \ReflectionMethod |
| 59 |
*/ |
| 60 |
public function getMethod( $classNameOrInstance, $methodName); |
| 61 |
} |
| 62 |
|