X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Ffactories%2Fobjects%2Fclass_ObjectFactory.php;fp=inc%2Fclasses%2Fmain%2Ffactories%2Fobjects%2Fclass_ObjectFactory.php;h=71b7b93909bc9d421fc3865cc638637830549d59;hp=7fe995509e3043368c476c95dd2bc0c1abfc21a4;hb=2e970c64c922f4653e0e74d60f2229b37aa9c33e;hpb=829b3054654704809ceb0e2bb47a24846023dd5a diff --git a/inc/classes/main/factories/objects/class_ObjectFactory.php b/inc/classes/main/factories/objects/class_ObjectFactory.php index 7fe99550..71b7b939 100644 --- a/inc/classes/main/factories/objects/class_ObjectFactory.php +++ b/inc/classes/main/factories/objects/class_ObjectFactory.php @@ -49,17 +49,14 @@ class ObjectFactory extends BaseFactory { * @throws EmptyVariableException If a variable is empty unexpectly */ public final static function createObjectByName ($className, array $args=array()) { + // First get an instance of this factory + $factoryInstance = new ObjectFactory(); + // Is the class name valid and is the class there? if (empty($className)) { - // First get an instance of this factory - $factoryInstance = new ObjectFactory(); - // Throw an exception here throw new EmptyVariableException(array($factoryInstance, 'className'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); } elseif (!class_exists($className)) { - // First get an instance of this factory - $factoryInstance = new ObjectFactory(); - // Then throw an exception throw new ClassNotFoundException(array($factoryInstance, $className), self::EXCEPTION_CLASS_NOT_FOUND); }