X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Ffactories%2Fobjects%2Fclass_ObjectFactory.php;h=ab8e9ced21505a42442e0979dac56d815b805227;hp=2701ede9a53ffb256197a2f6fd233c31d37602b6;hb=67f34799fe805b8a01cd56f64d12813a37195ee1;hpb=63f5632b0c5d2cebf8dd0940fdab561f86470f80 diff --git a/framework/main/classes/factories/objects/class_ObjectFactory.php b/framework/main/classes/factories/objects/class_ObjectFactory.php index 2701ede9..ab8e9ced 100644 --- a/framework/main/classes/factories/objects/class_ObjectFactory.php +++ b/framework/main/classes/factories/objects/class_ObjectFactory.php @@ -4,7 +4,6 @@ namespace CoreFramework\Factory; // Import framework stuff use CoreFramework\Bootstrap\FrameworkBootstrap; -use CoreFramework\Generic\EmptyVariableException; use CoreFramework\Loader\NoClassException; // Import SPL stuff @@ -53,8 +52,7 @@ class ObjectFactory extends BaseFactory { * @param $args Arguments in an indexed array * @return $objectInstance An instance of the requested object * @throws NoClassException If the requested class was not found - * @throws EmptyVariableException If a variable is empty unexpectly - * @throws InvalidArgumentException If class name is not following naming-convention + * @throws InvalidArgumentException If className is empty or the name not following naming-convention */ public static final function createObjectByName ($className, array $args = array()) { // First get an instance of this factory @@ -66,7 +64,7 @@ class ObjectFactory extends BaseFactory { // Is the class name valid and is the class there? if (empty($className)) { // Throw an exception here - throw new EmptyVariableException(array($factoryInstance, 'className'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + throw new InvalidArgumentException('Parameter "className" is empty'); } elseif (!class_exists($className)) { // Then throw an exception throw new NoClassException(array($factoryInstance, $className), self::EXCEPTION_CLASS_NOT_FOUND);