]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/class_BaseFrameworkSystem.php
Continued:
[core.git] / framework / main / classes / class_BaseFrameworkSystem.php
index 38a45f3de6487ae05416f5e7fbff5ab4508723ec..36e7bd6b64d49a8103407e060403f212fe29a2e5 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Mxchange\CoreFramework\Object;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Filesystem\FileIoException;
 use Org\Mxchange\CoreFramework\Filesystem\PathWriteProtectedException;
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
@@ -32,7 +33,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2021 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
  *
@@ -55,6 +56,15 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac
         */
        private static $selfInstance = NULL;
 
+       /**
+        * Stub methods
+        */
+       private static $stubMethods = [
+               'partialStub' => true,
+               '__call' => true,
+               '__callStatic' => true,
+       ];
+
        /**
         * The real class name
         */
@@ -533,25 +543,6 @@ Loaded includes:
                ));
        }
 
-       /**
-        * Replaces control characters with printable output
-        *
-        * @param       $str    String with control characters
-        * @return      $str    Replaced string
-        */
-       protected function replaceControlCharacters (string $str) {
-               // Replace them
-               $str = str_replace(
-                       chr(13), '[r]', str_replace(
-                       chr(10), '[n]', str_replace(
-                       chr(9) , '[t]',
-                       $str
-               )));
-
-               // Return it
-               return $str;
-       }
-
        /**
         * Output a partial stub message for the caller method
         *
@@ -672,7 +663,7 @@ Loaded includes:
                $backtrace = debug_backtrace(!DEBUG_BACKTRACE_PROVIDE_OBJECT);
 
                // Is function partialStub/__callStatic ?
-               if (in_array($backtrace[1]['function'], array('partialStub', '__call', '__callStatic'))) {
+               if (isset(self::$stubMethods[$backtrace[1]['function']])) {
                        // Prepend class::function:line from 3rd element
                        $message = sprintf('[%s::%s:%d]: %s',
                                $backtrace[2]['class'],
@@ -1346,7 +1337,7 @@ Loaded includes:
         * @param       $keyGroup       Main group for the key
         * @return      $count          Count of given group
         */
-       protected final function countGenericArray ($keyGroup) {
+       protected final function countGenericArray (string $keyGroup) {
                // Debug message
                //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup);
 
@@ -1434,7 +1425,7 @@ Loaded includes:
         * @param       $keyGroup       Key group to get
         * @return      $array          Whole generic array group
         */
-       protected final function getGenericArray ($keyGroup) {
+       protected final function getGenericArray (string $keyGroup) {
                // Debug message
                //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup);
 
@@ -1588,9 +1579,6 @@ Loaded includes:
         * @return      $translated             Translated boolean value
         */
        public static final function translateBooleanToYesNo (bool $boolean) {
-               // Make sure it is really boolean
-               assert(is_bool($boolean));
-
                // "Translate" it
                $translated = ($boolean === true) ? 'Y' : 'N';