X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=framework%2Fmain%2Fclasses%2Fresolver%2Fclass_;h=0547b94d0b2c0e549fcd8eb3462e2d8ca2f6db09;hb=67f34799fe805b8a01cd56f64d12813a37195ee1;hp=fdb146cffef3e7f193de7bad19fbe40e6ff7b8d2;hpb=78a010fef84895720e796842208f01dfb619c332;p=core.git
diff --git a/framework/main/classes/resolver/class_ b/framework/main/classes/resolver/class_
index fdb146cf..0547b94d 100644
--- a/framework/main/classes/resolver/class_
+++ b/framework/main/classes/resolver/class_
@@ -1,7 +1,6 @@
* @version 0.0.0
@@ -53,7 +52,7 @@ class ???Resolver extends BaseResolver implements Resolver {
if (empty($!!!Name)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'default|||'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->is|||Valid($!!!Name) === FALSE) {
+ } elseif ($resolverInstance->is|||Valid($!!!Name) === false) {
// Invalid action found
throw new Invalid|||Exception(array($resolverInstance, $!!!Name), self::EXCEPTION_INVALID_ACTION);
}
@@ -88,7 +87,7 @@ class ???Resolver extends BaseResolver implements Resolver {
if (empty($!!!Name)) $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
// Check if action is valid
- if ($this->is|||Valid($!!!Name) === FALSE) {
+ if ($this->is|||Valid($!!!Name) === false) {
// This action is invalid!
throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
} // END - if
@@ -128,7 +127,7 @@ class ???Resolver extends BaseResolver implements Resolver {
} // END - if
// Check if action is valid
- if ($this->is|||Valid($!!!Name) === FALSE) {
+ if ($this->is|||Valid($!!!Name) === false) {
// This action is invalid!
throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
} // END - if
@@ -139,439 +138,5 @@ class ???Resolver extends BaseResolver implements Resolver {
// Return the instance
return $!!!Instance;
}
-}
-
-// [EOF]
-?>
-
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-class ???Resolver extends BaseResolver implements Resolver {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
-
- // Set prefix to '???'
- $this->setClassPrefix('???');
- }
-
- /**
- * Creates an instance of a Html action resolver with a given default action
- *
- * @param $!!!Name The default action we shall execute
- * @param $appInstance An instance of a manageable application helper class
- * @return $resolverInstance The prepared action resolver instance
- * @throws EmptyVariableException Thrown if default action is not set
- * @throws Invalid|||Exception Thrown if default action is invalid
- */
- public static final function create???Resolver ($!!!Name, ManageableApplication $appInstance) {
- // Create the new instance
- $resolverInstance = new ???Resolver();
-
- // Is the variable $!!!Name set and the action is valid?
- if (empty($!!!Name)) {
- // Then thrown an exception here
- throw new EmptyVariableException(array($resolverInstance, 'default|||'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->is|||Valid($!!!Name) === FALSE) {
- // Invalid action found
- throw new Invalid|||Exception(array($resolverInstance, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- }
-
- // Set the application instance
- $resolverInstance->setApplicationInstance($appInstance);
-
- // Return the prepared instance
- return $resolverInstance;
- }
-
- /**
- * Returns an action instance for a given request class or null if
- * it was not found
- *
- * @param $requestInstance An instance of a request class
- * @return $!!!Instance An instance of the resolved action
- * @throws Invalid|||Exception Thrown if $!!!Name is
- * invalid
- * @throws Invalid|||InstanceException Thrown if $!!!Instance
- * is an invalid instance
- */
- public function resolve|||ByRequest (Requestable $requestInstance) {
- // Init variables
- $!!!Name = '';
- $!!!Instance = null;
-
- // This goes fine so let's resolve the action
- $!!!Name = $requestInstance->getRequestElement('action');
-
- // Is the action empty? Then fall back to default action
- if (empty($!!!Name)) $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
-
- // Check if action is valid
- if ($this->is|||Valid($!!!Name) === FALSE) {
- // This action is invalid!
- throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- } // END - if
-
- // Get the action
- $!!!Instance = $this->load|||();
-
- // And validate it
- if ((!is_object($!!!Instance)) || (!$!!!Instance instanceof |||able)) {
- // This action has an invalid instance!
- throw new Invalid|||InstanceException(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- } // END - if
-
- // Set last action
- $this->setResolvedInstance($!!!Instance);
-
- // Return the resolved action instance
- return $!!!Instance;
- }
-
- /**
- * Resolves the action by its direct name and returns an instance of its class
- *
- * @return $!!!Instance An instance of the action class
- * @throws Invalid|||Exception Thrown if $!!!Name is invalid
- */
- public function resolve||| () {
- // Initiate the instance variable
- $!!!Instance = null;
-
- // Get action name
- $!!!Name = $this->get|||Name();
-
- // Is the action empty? Then fall back to default action
- if (empty($!!!Name)) {
- $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
- } // END - if
-
- // Check if action is valid
- if ($this->is|||Valid($!!!Name) === FALSE) {
- // This action is invalid!
- throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- } // END - if
-
- // Get the action
- $!!!Instance = $this->load|||();
-
- // Return the instance
- return $!!!Instance;
- }
-}
-
-// [EOF]
-?>
-
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-class ???Resolver extends BaseResolver implements Resolver {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
-
- // Set prefix to '???'
- $this->setClassPrefix('???');
- }
-
- /**
- * Creates an instance of a Html action resolver with a given default action
- *
- * @param $!!!Name The default action we shall execute
- * @param $appInstance An instance of a manageable application helper class
- * @return $resolverInstance The prepared action resolver instance
- * @throws EmptyVariableException Thrown if default action is not set
- * @throws Invalid|||Exception Thrown if default action is invalid
- */
- public static final function create???Resolver ($!!!Name, ManageableApplication $appInstance) {
- // Create the new instance
- $resolverInstance = new ???Resolver();
-
- // Is the variable $!!!Name set and the action is valid?
- if (empty($!!!Name)) {
- // Then thrown an exception here
- throw new EmptyVariableException(array($resolverInstance, 'default|||'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->is|||Valid($!!!Name) === FALSE) {
- // Invalid action found
- throw new Invalid|||Exception(array($resolverInstance, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- }
-
- // Set the application instance
- $resolverInstance->setApplicationInstance($appInstance);
-
- // Return the prepared instance
- return $resolverInstance;
- }
-
- /**
- * Returns an action instance for a given request class or null if
- * it was not found
- *
- * @param $requestInstance An instance of a request class
- * @return $!!!Instance An instance of the resolved action
- * @throws Invalid|||Exception Thrown if $!!!Name is
- * invalid
- * @throws Invalid|||InstanceException Thrown if $!!!Instance
- * is an invalid instance
- */
- public function resolve|||ByRequest (Requestable $requestInstance) {
- // Init variables
- $!!!Name = '';
- $!!!Instance = null;
-
- // This goes fine so let's resolve the action
- $!!!Name = $requestInstance->getRequestElement('action');
-
- // Is the action empty? Then fall back to default action
- if (empty($!!!Name)) $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
-
- // Check if action is valid
- if ($this->is|||Valid($!!!Name) === FALSE) {
- // This action is invalid!
- throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- } // END - if
-
- // Get the action
- $!!!Instance = $this->load|||();
-
- // And validate it
- if ((!is_object($!!!Instance)) || (!$!!!Instance instanceof |||able)) {
- // This action has an invalid instance!
- throw new Invalid|||InstanceException(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- } // END - if
-
- // Set last action
- $this->setResolvedInstance($!!!Instance);
-
- // Return the resolved action instance
- return $!!!Instance;
- }
-
- /**
- * Resolves the action by its direct name and returns an instance of its class
- *
- * @return $!!!Instance An instance of the action class
- * @throws Invalid|||Exception Thrown if $!!!Name is invalid
- */
- public function resolve||| () {
- // Initiate the instance variable
- $!!!Instance = null;
-
- // Get action name
- $!!!Name = $this->get|||Name();
-
- // Is the action empty? Then fall back to default action
- if (empty($!!!Name)) {
- $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
- } // END - if
-
- // Check if action is valid
- if ($this->is|||Valid($!!!Name) === FALSE) {
- // This action is invalid!
- throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- } // END - if
-
- // Get the action
- $!!!Instance = $this->load|||();
-
- // Return the instance
- return $!!!Instance;
- }
-}
-
-// [EOF]
-?>
-
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-class ???Resolver extends BaseResolver implements Resolver {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
- // Set prefix to '???'
- $this->setClassPrefix('???');
- }
-
- /**
- * Creates an instance of a ??? resolver with a given default action
- *
- * @param $!!!Name The default action we shall execute
- * @param $appInstance An instance of a manageable application helper class
- * @return $resolverInstance The prepared action resolver instance
- * @throws EmptyVariableException Thrown if default action is not set
- * @throws Invalid|||Exception Thrown if default action is invalid
- */
- public static final function create???Resolver ($!!!Name, ManageableApplication $appInstance) {
- // Create the new instance
- $resolverInstance = new ???Resolver();
-
- // Is the variable $!!!Name set and the action is valid?
- if (empty($!!!Name)) {
- // Then thrown an exception here
- throw new EmptyVariableException(array($resolverInstance, 'default|||'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->is|||Valid($!!!Name) === FALSE) {
- // Invalid action found
- throw new Invalid|||Exception(array($resolverInstance, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- }
-
- // Set the application instance
- $resolverInstance->setApplicationInstance($appInstance);
-
- // Return the prepared instance
- return $resolverInstance;
- }
-
- /**
- * Returns an action instance for a given request class or null if
- * it was not found
- *
- * @param $requestInstance An instance of a request class
- * @return $!!!Instance An instance of the resolved action
- * @throws Invalid|||Exception Thrown if $!!!Name is
- * invalid
- * @throws Invalid|||InstanceException Thrown if $!!!Instance
- * is an invalid instance
- */
- public function resolve|||ByRequest (Requestable $requestInstance) {
- // Init variables
- $!!!Name = '';
- $!!!Instance = null;
-
- // This goes fine so let's resolve the action
- $!!!Name = $requestInstance->getRequestElement('action');
-
- // Is the action empty? Then fall back to default action
- if (empty($!!!Name)) $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
-
- // Check if action is valid
- if ($this->is|||Valid($!!!Name) === FALSE) {
- // This action is invalid!
- throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- } // END - if
-
- // Get the action
- $!!!Instance = $this->load|||();
-
- // And validate it
- if ((!is_object($!!!Instance)) || (!$!!!Instance instanceof |||able)) {
- // This action has an invalid instance!
- throw new Invalid|||InstanceException(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- } // END - if
-
- // Set last action
- $this->setResolvedInstance($!!!Instance);
-
- // Return the resolved action instance
- return $!!!Instance;
- }
-
- /**
- * Resolves the action by its direct name and returns an instance of its class
- *
- * @return $!!!Instance An instance of the action class
- * @throws Invalid|||Exception Thrown if $!!!Name is invalid
- */
- public function resolve||| () {
- // Initiate the instance variable
- $!!!Instance = null;
-
- // Get action name
- $!!!Name = $this->get|||Name();
-
- // Is the action empty? Then fall back to default action
- if (empty($!!!Name)) {
- $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
- } // END - if
-
- // Check if action is valid
- if ($this->is|||Valid($!!!Name) === FALSE) {
- // This action is invalid!
- throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
- } // END - if
-
- // Get the action
- $!!!Instance = $this->load|||();
-
- // Return the instance
- return $!!!Instance;
- }
}
-
-// [EOF]
-?>