]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/resolver/state/class_BaseStateResolver.php
Fixed conflict with 'core' project
[hub.git] / application / hub / main / resolver / state / class_BaseStateResolver.php
index c74170509458d4492af36ec82679fc03c91059d9..4b8d3f3eb99e60e944df80a3e8ace4dff596bc02 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -84,16 +84,16 @@ class BaseStateResolver extends BaseResolver {
 
        /**
         * "Loads" a given state and instances it if not yet cached. If the
-        * state was not found an InvalidStateException is thrown
+        * state was not found an UnresolveableStateException is thrown
         *
         * @param       $stateName                      A state name we shall look for
         * @return      $stateInstance          A loaded state instance
-        * @throws      InvalidStateException   Thrown if even the requested
-        *                                                                      state class is missing (bad!)
+        * @throws      UnresolveableStateException             Thrown if even the requested
+        *                                                                                      state class is missing (bad!)
         */
        protected function loadState ($stateName) {
                // Init state instance
-               $stateInstance = null;
+               $stateInstance = NULL;
 
                // Create state class name
                $className = $this->getStatePrefix() . '' . $this->convertToClassName($stateName) . 'State';
@@ -104,7 +104,7 @@ class BaseStateResolver extends BaseResolver {
                // Is this class loaded?
                if (!class_exists($this->getClassName())) {
                        // Throw an exception here
-                       throw new InvalidStateException(array($this, $stateName), self::EXCEPTION_INVALID_STATE);
+                       throw new UnresolveableStateException(array($this, $stateName), self::EXCEPTION_INVALID_STATE);
                } // END - if
 
                // Initialize the state
@@ -147,9 +147,9 @@ class BaseStateResolver extends BaseResolver {
                        if (class_exists($this->getClassName())) {
                                // This class does exist. :-)
                                $isValid = true;
-                       } elseif ($this->getClassName() != $this->statePrefix.'DefaultNewsState') {
+                       } elseif ($this->getClassName() != $this->statePrefix . 'DefaultState') {
                                // Set default state
-                               $this->setClassName($this->statePrefix . 'DefaultNewsState');
+                               $this->setClassName($this->statePrefix . 'DefaultState');
                        } else {
                                // All is tried, give it up here
                                throw new DefaultStateException($this, self::EXCEPTION_DEFAULT_STATE_GONE);