2
2
namespace Ioc ;
3
3
4
4
use Ioc \Exceptions \DefinitionNotFoundException ;
5
- use Ioc \Exceptions \Exceptions \ ParameterMissingException ;
5
+ use Ioc \Exceptions \MissingParameterException ;
6
6
7
7
interface MethodInvoker {
8
8
/**
@@ -11,27 +11,22 @@ interface MethodInvoker {
11
11
* method or a class not yet instantiated. The implementation determines how to handle the callable and find the
12
12
* appropriate method for invocation. If no matching class could be found, it must throw an
13
13
* Ioc\Exceptions\DefinitionNotFoundException.
14
- *
15
14
* Following forms must be accepted:
16
- *
17
15
* $methodInvoker->invoke(function () {}, $arguments);
18
16
* A closure
19
- *
20
17
* $methodInvoker->invoke(array($instance, 'methodName'), $arguments);
21
18
* A classic callable with an already instantiated $instance and a methodName.
22
- *
23
19
* $methodInvoker->invoke(array('Full\\Qualified\\Class\\Name', 'methodName'), $arguments);
24
20
* This is not(!) a static call. Full\Qualified\Class\Name gats instantiated first before calling methodName.
25
- *
26
21
* The called method could have either scalar parameters (with or without default values) or Typehinted patemeters
27
22
* mixed together. Scalar-types and array-types can not be determined automatically. They must be provided through
28
23
* $arguments.
29
24
*
30
25
* @param callable $callable
31
26
* @param array $arguments Must be an array were the keys match to the Variable-Names of the __construct'ors parameters.
32
- * @throws DefinitionNotFoundException
33
- * @throws ParameterMissingException
34
27
* @return mixed
28
+ *@throws MissingParameterException
29
+ * @throws DefinitionNotFoundException
35
30
*/
36
31
public function invoke ($ callable , array $ arguments = array ());
37
32
}
0 commit comments