X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Fclass_BaseFrameworkSystem.php;fp=framework%2Fmain%2Fclasses%2Fclass_BaseFrameworkSystem.php;h=18a2c2c9526e116247c760fa03d5a541bf77b8af;hp=3b29231e6362db413dd7afc639b1d55729c3985f;hb=6e770c26c13f7b06bfc3f9b565b22f6607c5755e;hpb=384eb9724a031ed971f4f2aaf3cf691dbfc1690d diff --git a/framework/main/classes/class_BaseFrameworkSystem.php b/framework/main/classes/class_BaseFrameworkSystem.php index 3b29231e..18a2c2c9 100644 --- a/framework/main/classes/class_BaseFrameworkSystem.php +++ b/framework/main/classes/class_BaseFrameworkSystem.php @@ -46,6 +46,7 @@ use Org\Mxchange\CoreFramework\State\Stateable; use Org\Mxchange\CoreFramework\Stream\Input\InputStream; use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer; use Org\Mxchange\CoreFramework\Stream\Output\OutputStream; +use Org\Mxchange\CoreFramework\String\Utils\StringUtils; use Org\Mxchange\CoreFramework\Template\CompileableTemplate; use Org\Mxchange\CoreFramework\User\ManageableAccount; use Org\Mxchange\CoreFramework\Visitor\Visitor; @@ -1877,7 +1878,7 @@ Loaded includes: $className = ''; // Convert all dashes in underscores - $str = self::convertDashesToUnderscores($str); + $str = StringUtils::convertDashesToUnderscores($str); // Now use that underscores to get classname parts for hungarian style foreach (explode('_', $str) as $strPart) { @@ -1889,34 +1890,6 @@ Loaded includes: return $className; } - /** - * Converts dashes to underscores, e.g. useable for configuration entries - * - * @param $str The string with maybe dashes inside - * @return $str The converted string with no dashed, but underscores - * @throws NullPointerException If $str is null - * @throws InvalidArgumentException If $str is empty - */ - public static function convertDashesToUnderscores ($str) { - // Is it null? - if (is_null($str)) { - // Throw NPE - throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_string($str)) { - // Entry is empty - throw new InvalidArgumentException(sprintf('str[]=%s is not a string', gettype($str)), FrameworkConfiguration::EXCEPTION_CONFIG_KEY_IS_EMPTY); - } elseif ((is_string($str)) && (empty($str))) { - // Entry is empty - throw new InvalidArgumentException('str is empty', FrameworkConfiguration::EXCEPTION_CONFIG_KEY_IS_EMPTY); - } - - // Convert them all - $str = str_replace('-', '_', $str); - - // Return converted string - return $str; - } - /** * Marks up the code by adding e.g. line numbers * @@ -2079,7 +2052,7 @@ Loaded includes: //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.':
'.print_r($fieldArray, true).'
'); // Convert dashes to underscore - $fieldName2 = self::convertDashesToUnderscores($fieldName); + $fieldName2 = StringUtils::convertDashesToUnderscores($fieldName); // Does the field exist? if ($this->isFieldSet($fieldName)) { @@ -2119,7 +2092,7 @@ Loaded includes: //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . $this->__toString() . ':' . __LINE__ . '] fieldName=' . $fieldName . ',fieldArray=
'.print_r($fieldArray, true).'
'); // Convert dashes to underscore - $fieldName = self::convertDashesToUnderscores($fieldName); + $fieldName = StringUtils::convertDashesToUnderscores($fieldName); // Determine it $isSet = isset($fieldArray[$fieldName]);