Continued:
[core.git] / framework / main / classes / resolver / class_BaseResolver.php
index e93bcd81dc5f1970090f1345de115e0c4f8d1ca8..20ca0f72543f2527df96b39c9495136aabe0c63d 100644 (file)
@@ -5,13 +5,14 @@ namespace Org\Mxchange\CoreFramework\Resolver;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
+use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
 /**
  * A generic resolver class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @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
  *
@@ -29,6 +30,12 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 abstract class BaseResolver extends BaseFrameworkSystem {
+       // Exception constants
+       const EXCEPTION_INVALID_COMMAND    = 0x1d0;
+       const EXCEPTION_INVALID_CONTROLLER = 0x1d1;
+       const EXCEPTION_INVALID_ACTION     = 0x1d2;
+       const EXCEPTION_INVALID_STATE      = 0x1d3;
+
        /**
         * Namespace
         */
@@ -49,19 +56,13 @@ abstract class BaseResolver extends BaseFrameworkSystem {
         */
        private $resolvedInstance = NULL;
 
-       // Exception constants
-       const EXCEPTION_INVALID_COMMAND    = 0x1d0;
-       const EXCEPTION_INVALID_CONTROLLER = 0x1d1;
-       const EXCEPTION_INVALID_ACTION     = 0x1d2;
-       const EXCEPTION_INVALID_STATE      = 0x1d3;
-
        /**
         * Protected constructor
         *
         * @param       $className      Real name of the class
         * @return      void
         */
-       protected function __construct ($className) {
+       protected function __construct (string $className) {
                // Call parent constructor
                parent::__construct($className);
        }
@@ -81,8 +82,8 @@ abstract class BaseResolver extends BaseFrameworkSystem {
         * @param       $namespace      Namespace to look in
         * @return      void
         */
-       protected final function setNamespace ($namespace) {
-               $this->namespace = (string) $namespace;
+       protected final function setNamespace (string $namespace) {
+               $this->namespace = $namespace;
        }
 
        /**
@@ -100,8 +101,8 @@ abstract class BaseResolver extends BaseFrameworkSystem {
         * @param       $className      Name of the class
         * @return      void
         */
-       protected final function setClassName ($className) {
-               $this->className = (string) $className;
+       protected final function setClassName (string $className) {
+               $this->className = $className;
        }
 
        /**
@@ -114,7 +115,7 @@ abstract class BaseResolver extends BaseFrameworkSystem {
                $className = $this->getClassPrefix();
 
                // And capitalize it
-               $className = self::convertToClassName($className);
+               $className = StringUtils::convertToClassName($className);
 
                // Return it
                return $className;
@@ -135,8 +136,8 @@ abstract class BaseResolver extends BaseFrameworkSystem {
         * @param       $classPrefix    Last validated classPrefix
         * @return      void
         */
-       protected final function setClassPrefix ($classPrefix) {
-               $this->classPrefix = (string) $classPrefix;
+       protected final function setClassPrefix (string $classPrefix) {
+               $this->classPrefix = $classPrefix;
        }
 
        /**