]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/factories/objects/class_ObjectFactory.php
Copyright updated, interface RenderableMenu added
[core.git] / inc / classes / main / factories / objects / class_ObjectFactory.php
index 7fe995509e3043368c476c95dd2bc0c1abfc21a4..874d14017b74eaf3b70ed9a2b4ce32ffdad164fe 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007 - 2009 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -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);
                }