From 1177a22818fc5ef3407bcb1e73b215656a946a88 Mon Sep 17 00:00:00 2001 From: rkr Date: Fri, 30 Sep 2022 09:24:56 +0200 Subject: [PATCH] Renamed ParameterMissingException to MissingParameterException --- src/Exceptions/MissingParameterException.php | 5 +++++ src/Exceptions/ParameterMissingException.php | 5 ----- src/MethodInvoker.php | 11 +++-------- src/ObjectFactory.php | 6 +++--- 4 files changed, 11 insertions(+), 16 deletions(-) create mode 100644 src/Exceptions/MissingParameterException.php delete mode 100644 src/Exceptions/ParameterMissingException.php diff --git a/src/Exceptions/MissingParameterException.php b/src/Exceptions/MissingParameterException.php new file mode 100644 index 0000000..fa27b3a --- /dev/null +++ b/src/Exceptions/MissingParameterException.php @@ -0,0 +1,5 @@ +invoke(function () {}, $arguments); * A closure - * * $methodInvoker->invoke(array($instance, 'methodName'), $arguments); * A classic callable with an already instantiated $instance and a methodName. - * * $methodInvoker->invoke(array('Full\\Qualified\\Class\\Name', 'methodName'), $arguments); * This is not(!) a static call. Full\Qualified\Class\Name gats instantiated first before calling methodName. - * * The called method could have either scalar parameters (with or without default values) or Typehinted patemeters * mixed together. Scalar-types and array-types can not be determined automatically. They must be provided through * $arguments. * * @param callable $callable * @param array $arguments Must be an array were the keys match to the Variable-Names of the __construct'ors parameters. - * @throws DefinitionNotFoundException - * @throws ParameterMissingException * @return mixed + *@throws MissingParameterException + * @throws DefinitionNotFoundException */ public function invoke($callable, array $arguments = array()); } diff --git a/src/ObjectFactory.php b/src/ObjectFactory.php index e385f99..ecfec59 100644 --- a/src/ObjectFactory.php +++ b/src/ObjectFactory.php @@ -2,7 +2,7 @@ namespace Ioc; use Ioc\Exceptions\DefinitionNotFoundException; -use Ioc\Exceptions\Exceptions\ParameterMissingException; +use Ioc\Exceptions\MissingParameterException; interface ObjectFactory { /** @@ -12,9 +12,9 @@ interface ObjectFactory { * * @param string $className Must be an fully qualified class-name. * @param array $arguments Must be an array were the keys match to the Variable-Names of the __construct'ors parameters. - * @throws DefinitionNotFoundException - * @throws ParameterMissingException * @return mixed + *@throws MissingParameterException + * @throws DefinitionNotFoundException */ public function create($className, array $arguments = array()); } \ No newline at end of file