]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/resolver/action/class_BaseActionResolver.php
Continued:
[core.git] / framework / main / classes / resolver / action / class_BaseActionResolver.php
index cff62f7eed6df6bc748771e50cde9b8a9381a130..2832256d67a66582088834eeeb9797a6bfbb6f5e 100644 (file)
@@ -3,8 +3,9 @@
 namespace Org\Mxchange\CoreFramework\Resolver\Action;
 
 // Import framework stuff
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Resolver\BaseResolver;
+use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
 // Import SPL stuff
 use \InvalidArgumentException;
@@ -14,7 +15,7 @@ use \InvalidArgumentException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -54,8 +55,8 @@ abstract class BaseActionResolver extends BaseResolver {
         * @param       $actionName     Last validated action name
         * @return      void
         */
-       protected final function setActionName ($actionName) {
-               $this->actionName = (string) $actionName;
+       protected final function setActionName (string $actionName) {
+               $this->actionName = $actionName;
        }
 
        /**
@@ -75,7 +76,7 @@ abstract class BaseActionResolver extends BaseResolver {
         * @return      $isValid                Whether the given action is valid
         * @throws      InvalidArgumentException        Thrown if given action is not set
         */
-       public function isActionValid ($namespace, $actionName) {
+       public function isActionValid (string $namespace, string $actionName) {
                // Is a action set?
                if (empty($namespace)) {
                        // Then thrown an exception here
@@ -90,7 +91,7 @@ abstract class BaseActionResolver extends BaseResolver {
                        '%s\%s%sAction',
                        $namespace,
                        $this->getCapitalizedClassPrefix(),
-                       self::convertToClassName($actionName)
+                       StringUtils::convertToClassName($actionName)
                );
 
                // Now, let us create the full name of the action class
@@ -123,14 +124,14 @@ abstract class BaseActionResolver extends BaseResolver {
                        '%s\%s%sAction',
                        $this->getNamespace(),
                        $this->getCapitalizedClassPrefix(),
-                       self::convertToClassName($actionName)
+                       StringUtils::convertToClassName($actionName)
                );
 
                // ... and set it
                $this->setClassName($className);
 
                // Initiate the action
-               $actionInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));
+               $actionInstance = ObjectFactory::createObjectByName($this->getClassName(), [$this]);
 
                // Return the result
                return $actionInstance;