X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Fresolver%2Faction%2Fhtml%2Fclass_HtmlActionResolver.php;h=ad70b5b69080ccd9176a6963bfdf68d23ecea31e;hp=e6ca1fa1edfa075d52a8c1756678ff3baddce4ec;hb=refs%2Fheads%2Fmaster;hpb=67f34799fe805b8a01cd56f64d12813a37195ee1 diff --git a/framework/main/classes/resolver/action/html/class_HtmlActionResolver.php b/framework/main/classes/resolver/action/html/class_HtmlActionResolver.php index e6ca1fa1..ad70b5b6 100644 --- a/framework/main/classes/resolver/action/html/class_HtmlActionResolver.php +++ b/framework/main/classes/resolver/action/html/class_HtmlActionResolver.php @@ -1,10 +1,11 @@ * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * @@ -42,7 +43,7 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver { * * @return void */ - protected function __construct () { + private function __construct () { // Call parent constructor parent::__construct(__CLASS__); @@ -54,27 +55,23 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver { * Creates an instance of a Html action resolver with a given default action * * @param $actionName The default action we shall execute - * @param $applicationInstance An instance of a manageable application helper class * @return $resolverInstance The prepared action resolver instance * @throws InvalidArgumentException Thrown if default action is not set * @throws InvalidActionException Thrown if default action is invalid */ - public static final function createHtmlActionResolver ($actionName, ManageableApplication $applicationInstance) { + public static final function createHtmlActionResolver ($actionName) { // Create the new instance $resolverInstance = new HtmlActionResolver(); // Is the variable $actionName set and the action is valid? if (empty($actionName)) { // Then thrown an exception here - throw new InvalidArgumentException('Parameter "actionName" is empty'); + throw new InvalidArgumentException('Parameter "actionName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); } elseif ($resolverInstance->isActionValid($actionName) === false) { // Invalid action found throw new InvalidActionException(array($resolverInstance, $actionName), self::EXCEPTION_INVALID_ACTION); } - // Set the application instance - $resolverInstance->setApplicationInstance($applicationInstance); - // Return the prepared instance return $resolverInstance; } @@ -100,14 +97,14 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver { // Is the action empty? Then fall back to default action if (empty($actionName)) { - $actionName = $this->getConfigInstance()->getConfigEntry('default_action'); - } // END - if + $actionName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_action'); + } // Check if action is valid if ($this->isActionValid($actionName) === false) { // This action is invalid! throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION); - } // END - if + } // Get the action $actionInstance = $this->loadAction(); @@ -116,7 +113,7 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver { if ((!is_object($actionInstance)) || (!$actionInstance instanceof Actionable)) { // This action has an invalid instance! throw new InvalidActionInstanceException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION); - } // END - if + } // Set last action $this->setResolvedInstance($actionInstance); @@ -140,14 +137,14 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver { // Is the action empty? Then fall back to default action if (empty($actionName)) { - $actionName = $this->getConfigInstance()->getConfigEntry('default_action'); - } // END - if + $actionName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_action'); + } // Check if action is valid if ($this->isActionValid($actionName) === false) { // This action is invalid! throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION); - } // END - if + } // Get the action $actionInstance = $this->loadAction();