]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 2 Dec 2020 17:45:47 +0000 (18:45 +0100)
committerRoland Häder <roland@mxchange.org>
Wed, 2 Dec 2020 17:45:47 +0000 (18:45 +0100)
- added type-hints for primitive variables
- thanks to these type-hints, some tests are no longer needed

Signed-off-by: Roland Häder <roland@mxchange.org>
32 files changed:
framework/bootstrap/class_FrameworkBootstrap.php
framework/config/class_FrameworkConfiguration.php
framework/main/classes/auth/class_CookieAuth.php
framework/main/classes/crypto/class_CryptoHelper.php
framework/main/classes/discovery/class_BaseDiscovery.php
framework/main/classes/handler/class_BaseHandler.php
framework/main/classes/handler/tasks/class_TaskHandler.php
framework/main/classes/helper/captcha/images/class_ImageHelper.php
framework/main/classes/helper/captcha/web/class_GraphicalCodeCaptcha.php
framework/main/classes/helper/class_BaseHelper.php
framework/main/classes/helper/html/blocks/class_HtmlBlockHelper.php
framework/main/classes/helper/html/forms/class_HtmlFormHelper.php
framework/main/classes/helper/html/links/class_HtmlLinkHelper.php
framework/main/classes/request/class_BaseRequest.php
framework/main/classes/request/console/class_ConsoleRequest.php
framework/main/classes/request/html/class_HtmlRequest.php
framework/main/classes/states/class_BaseState.php
framework/main/classes/streams/crypto/mcrypt/class_McryptStream.php
framework/main/classes/streams/crypto/null/class_NullCryptoStream.php
framework/main/classes/streams/crypto/openssl/class_OpenSslStream.php
framework/main/classes/template/image/class_ImageTemplateEngine.php
framework/main/classes/template/mail/class_MailTemplateEngine.php
framework/main/classes/template/menu/class_MenuTemplateEngine.php
framework/main/classes/template/xml/class_BaseXmlTemplateEngine.php
framework/main/exceptions/database/class_DatabaseException.php
framework/main/interfaces/crypto/class_Cryptable.php
framework/main/interfaces/handler/task/class_HandleableTask.php
framework/main/interfaces/registration/class_UserRegister.php
framework/main/interfaces/request/class_Requestable.php
framework/main/interfaces/streams/crypto/class_EncryptableStream.php
tests/framework/bootstrap/class_FrameworkBootstrapTest.php
tests/framework/config/FrameworkConfigurationTest.php

index 0e0cdb6a917259b31b7040b6a64999d67c464092..9f376df51ba254807866e0160364ccd306620950 100644 (file)
@@ -449,18 +449,11 @@ final class FrameworkBootstrap {
         *
         * @param       $timezone       The timezone string (e.g. Europe/Berlin)
         * @return      $success        If timezone was accepted
         *
         * @param       $timezone       The timezone string (e.g. Europe/Berlin)
         * @return      $success        If timezone was accepted
-        * @throws      NullPointerException    If $timezone is NULL
         * @throws      InvalidArgumentException        If $timezone is empty
         */
         * @throws      InvalidArgumentException        If $timezone is empty
         */
-       public static function setDefaultTimezone ($timezone) {
-               // Is it null?
-               if (is_null($timezone)) {
-                       // Throw NPE
-                       throw new NullPointerException(NULL, BaseFrameworkSystem::EXCEPTION_IS_NULL_POINTER);
-               } elseif (!is_string($timezone)) {
-                       // Is not a string
-                       throw new InvalidArgumentException(sprintf('timezone[]=%s is not a string', gettype($timezone)));
-               } elseif ((is_string($timezone)) && (empty($timezone))) {
+       public static function setDefaultTimezone (string $timezone) {
+               // Is it set?
+               if (empty($timezone)) {
                        // Entry is empty
                        throw new InvalidArgumentException('timezone is empty');
                }
                        // Entry is empty
                        throw new InvalidArgumentException('timezone is empty');
                }
index 0d5560a550ac10708d1f97a9e2406938f91074d9..132fba6ac0bea54717dd70c90a339e75d13fa3b9 100644 (file)
@@ -6,7 +6,6 @@ namespace Org\Mxchange\CoreFramework\Configuration;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Configuration\NoConfigEntryException;
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Configuration\NoConfigEntryException;
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
-use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
@@ -84,18 +83,11 @@ class FrameworkConfiguration implements Registerable {
         *
         * @param       $configKey      The configuration key we shall check
         * @return      $isset  Whether the given configuration key is set
         *
         * @param       $configKey      The configuration key we shall check
         * @return      $isset  Whether the given configuration key is set
-        * @throws      NullPointerException    If $configKey is NULL
         * @throws      InvalidArgumentException        If $configKey is empty
         */
         * @throws      InvalidArgumentException        If $configKey is empty
         */
-       public function isConfigurationEntrySet ($configKey) {
+       public function isConfigurationEntrySet (string $configKey) {
                // Is it null?
                // Is it null?
-               if (is_null($configKey)) {
-                       // Throw NPE
-                       throw new NullPointerException($this, BaseFrameworkSystem::EXCEPTION_IS_NULL_POINTER);
-               } elseif (!is_string($configKey)) {
-                       // Is not a string
-                       throw new InvalidArgumentException(sprintf('configKey[]=%s is not a string', gettype($configKey)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
-               } elseif ((is_string($configKey)) && (empty($configKey))) {
+               if (empty($configKey)) {
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }
@@ -112,19 +104,12 @@ class FrameworkConfiguration implements Registerable {
         *
         * @param       $configKey              The configuration element
         * @return      $configValue    The fetched configuration value
         *
         * @param       $configKey              The configuration element
         * @return      $configValue    The fetched configuration value
-        * @throws      NullPointerException    If $configKey is NULL
         * @throws      InvalidArgumentException        If $configKey is empty
         * @throws      NoConfigEntryException          If a configuration element was not found
         */
         * @throws      InvalidArgumentException        If $configKey is empty
         * @throws      NoConfigEntryException          If a configuration element was not found
         */
-       public function getConfigEntry ($configKey) {
+       public function getConfigEntry (string $configKey) {
                // Is it null?
                // Is it null?
-               if (is_null($configKey)) {
-                       // Throw NPE
-                       throw new NullPointerException($this, BaseFrameworkSystem::EXCEPTION_IS_NULL_POINTER);
-               } elseif (!is_string($configKey)) {
-                       // Is not a string
-                       throw new InvalidArgumentException(sprintf('configKey[]=%s is not a string', gettype($configKey)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
-               } elseif ((is_string($configKey)) && (empty($configKey))) {
+               if (empty($configKey)) {
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }
@@ -148,19 +133,12 @@ class FrameworkConfiguration implements Registerable {
         * @param       $configKey      The configuration key we want to add/change
         * @param       $configValue    The configuration value we want to set
         * @return      void
         * @param       $configKey      The configuration key we want to add/change
         * @param       $configValue    The configuration value we want to set
         * @return      void
-        * @throws      NullPointerException    If $configKey is NULL
         * @throws      InvalidArgumentException        If $configKey is empty
         * @throws      InvalidArgumentException        If $configValue has an unsupported variable type
         */
         * @throws      InvalidArgumentException        If $configKey is empty
         * @throws      InvalidArgumentException        If $configValue has an unsupported variable type
         */
-       public final function setConfigEntry ($configKey, $configValue) {
+       public final function setConfigEntry (string $configKey, $configValue) {
                // Is a valid configuration key key provided?
                // Is a valid configuration key key provided?
-               if (is_null($configKey)) {
-                       // Configuration key is null
-                       throw new NullPointerException($this, BaseFrameworkSystem::EXCEPTION_IS_NULL_POINTER);
-               } elseif (!is_string($configKey)) {
-                       // Is not a string
-                       throw new InvalidArgumentException(sprintf('configKey[]=%s is not a string', gettype($configKey)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
-               } elseif ((is_string($configKey)) && (empty($configKey))) {
+               if (empty($configKey)) {
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                } elseif ((is_array($configValue)) || (is_object($configValue)) || (is_resource($configValue))) {
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                } elseif ((is_array($configValue)) || (is_object($configValue)) || (is_resource($configValue))) {
@@ -195,19 +173,12 @@ class FrameworkConfiguration implements Registerable {
         *
         * @param       $configKey      Configuration key to unset
         * @return      void
         *
         * @param       $configKey      Configuration key to unset
         * @return      void
-        * @throws      NullPointerException    If $configKey is NULL
         * @throws      InvalidArgumentException        If $configKey is empty
         * @throws      NoConfigEntryException  If a configuration element was not found
         */
         * @throws      InvalidArgumentException        If $configKey is empty
         * @throws      NoConfigEntryException  If a configuration element was not found
         */
-       public final function unsetConfigEntry ($configKey) {
+       public final function unsetConfigEntry (string $configKey) {
                // Validate parameters
                // Validate parameters
-               if (is_null($configKey)) {
-                       // Configuration key is null
-                       throw new NullPointerException($this, BaseFrameworkSystem::EXCEPTION_IS_NULL_POINTER);
-               } elseif (!is_string($configKey)) {
-                       // Entry is empty
-                       throw new InvalidArgumentException(sprintf('configKey[]=%s is not a string', gettype($configKey)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
-               } elseif ((is_string($configKey)) && (empty($configKey))) {
+               if (empty($configKey)) {
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }
                        // Entry is empty
                        throw new InvalidArgumentException('configKey is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
                }
@@ -225,30 +196,6 @@ class FrameworkConfiguration implements Registerable {
                unset(self::$config[$configKey]);
        }
 
                unset(self::$config[$configKey]);
        }
 
-       /**
-        * Getter for field name
-        *
-        * @param       $fieldName              Field name which we shall get
-        * @return      $fieldValue             Field value from the user
-        * @throws      NullPointerException    If the result instance is null
-        */
-       public final function getField ($fieldName) {
-               // The super interface "FrameworkInterface" requires this
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), BaseFrameworkSystem::EXCEPTION_UNSPPORTED_OPERATION);
-       }
-
-       /**
-        * Checks if given field is set
-        *
-        * @param       $fieldName      Field name to check
-        * @return      $isSet          Whether the given field name is set
-        * @throws      NullPointerException    If the result instance is null
-        */
-       public function isFieldSet ($fieldName) {
-               // The super interface "FrameworkInterface" requires this
-               throw new UnsupportedOperationException(array($this, __FUNCTION__), BaseFrameworkSystem::EXCEPTION_UNSPPORTED_OPERATION);
-       }
-
        /**
         * Generates a code for hashes from this class
         *
        /**
         * Generates a code for hashes from this class
         *
@@ -287,4 +234,28 @@ class FrameworkConfiguration implements Registerable {
                $this->callbackInstance = $callbackInstance;
        }
 
                $this->callbackInstance = $callbackInstance;
        }
 
+       /**
+        * Getter for field name
+        *
+        * @param       $fieldName              Field name which we shall get
+        * @return      $fieldValue             Field value from the user
+        * @throws      NullPointerException    If the result instance is null
+        */
+       public final function getField (string $fieldName) {
+               // The super interface "FrameworkInterface" requires this
+               throw new UnsupportedOperationException(array($this, __FUNCTION__), BaseFrameworkSystem::EXCEPTION_UNSPPORTED_OPERATION);
+       }
+
+       /**
+        * Checks if given field is set
+        *
+        * @param       $fieldName      Field name to check
+        * @return      $isSet          Whether the given field name is set
+        * @throws      NullPointerException    If the result instance is null
+        */
+       public function isFieldSet (string $fieldName) {
+               // The super interface "FrameworkInterface" requires this
+               throw new UnsupportedOperationException(array($this, __FUNCTION__), BaseFrameworkSystem::EXCEPTION_UNSPPORTED_OPERATION);
+       }
+
 }
 }
index 659c97680438709fb7dfd3733c1eb8aa31e1a204..c9bd58d2c8daa1cf474b43a6d5a32f2e12d25c35 100644 (file)
@@ -61,7 +61,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         * @param       $userName       The username from request we shall set
         * @return      void
         */
         * @param       $userName       The username from request we shall set
         * @return      void
         */
-       public function setUserAuth ($userName) {
+       public function setUserAuth (string $userName) {
                FrameworkBootstrap::getResponseInstance()->addCookie('username', $userName);
        }
 
                FrameworkBootstrap::getResponseInstance()->addCookie('username', $userName);
        }
 
@@ -71,7 +71,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         * @param       $passHash       The hashed password from request we shall set
         * @return      void
         */
         * @param       $passHash       The hashed password from request we shall set
         * @return      void
         */
-       public function setPasswordAuth ($passHash) {
+       public function setPasswordAuth (string $passHash) {
                FrameworkBootstrap::getResponseInstance()->addCookie('u_hash', $passHash);
        }
 
                FrameworkBootstrap::getResponseInstance()->addCookie('u_hash', $passHash);
        }
 
index 7ef8d3f3adab43aab9ab033cf5e0a86f2ef3fd35..c5115dec8e2917ae63f0221f4d939a7312d759f8 100644 (file)
@@ -201,10 +201,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
         * @param       $withFixed      Whether to include a fixed salt (not recommended in p2p applications)
         * @return      $hashed         The hashed and salted string
         */
         * @param       $withFixed      Whether to include a fixed salt (not recommended in p2p applications)
         * @return      $hashed         The hashed and salted string
         */
-       public function hashString ($str, $oldHash = '', $withFixed = true) {
-               // Cast the string
-               $str = (string) $str;
-
+       public function hashString (string $str, string $oldHash = '', bool $withFixed = true) {
                // Default is the default salt ;-)
                $salt = $this->salt;
 
                // Default is the default salt ;-)
                $salt = $this->salt;
 
@@ -245,7 +242,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
-       public function encryptString ($str, $key = NULL) {
+       public function encryptString (string $str, string $key = NULL) {
                // Encrypt the string through the stream
                $encrypted = $this->cryptoStreamInstance->encryptStream($str, $key);
 
                // Encrypt the string through the stream
                $encrypted = $this->cryptoStreamInstance->encryptStream($str, $key);
 
@@ -259,7 +256,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
         * @param       $encrypted      Encrypted string
         * @return      $str            The unencrypted string
         */
         * @param       $encrypted      Encrypted string
         * @return      $str            The unencrypted string
         */
-       public function decryptString ($encrypted) {
+       public function decryptString (string $encrypted) {
                // Encrypt the string through the stream
                $str = $this->cryptoStreamInstance->decryptStream($encrypted);
 
                // Encrypt the string through the stream
                $str = $this->cryptoStreamInstance->decryptStream($encrypted);
 
index 62740e8e8dc48f25e6af88c3b492eef139b9a6b4..471600763dae5c0f85e7f177246d1fec86b4be91 100644 (file)
@@ -50,8 +50,8 @@ abstract class BaseDiscovery extends BaseFrameworkSystem {
         * @param       $actionName             Action name to set
         * @return      void
         */
         * @param       $actionName             Action name to set
         * @return      void
         */
-       protected final function setActionName ($actionName) {
-               $this->actionName = (string) $actionName;
+       protected final function setActionName (string $actionName) {
+               $this->actionName = $actionName;
        }
 
        /**
        }
 
        /**
index 03751cce4bb9c3c0276b58f2f50590eba939e6ed..e18c0f604e8722d026e6d63f77a213d4d7d2b43a 100644 (file)
@@ -61,7 +61,7 @@ abstract class BaseHandler extends BaseFrameworkSystem implements HandleableData
         * @param       $handlerName    Name of this handler
         * @return      void
         */
         * @param       $handlerName    Name of this handler
         * @return      void
         */
-       protected final function setHandlerName ($handlerName) {
+       protected final function setHandlerName (string $handlerName) {
                $this->handlerName = $handlerName;
        }
 
                $this->handlerName = $handlerName;
        }
 
index 84b9f603a4519775e1fb5ff5e95854def598c892..3bbe3938e686b4803e8e5a975beb39e5e62ca8b4 100644 (file)
@@ -105,7 +105,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                if (!$this->getListInstance()->getIterator()->valid()) {
                        // Not valid!
                        throw new InvalidTaskException($this, self::EXCEPTION_TASK_IS_INVALID);
                if (!$this->getListInstance()->getIterator()->valid()) {
                        // Not valid!
                        throw new InvalidTaskException($this, self::EXCEPTION_TASK_IS_INVALID);
-               } // END - if
+               }
 
                // Get current task
                $currentTask = $this->getListInstance()->getIterator()->current();
 
                // Get current task
                $currentTask = $this->getListInstance()->getIterator()->current();
@@ -120,7 +120,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                                // Skip this silently
                                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Task ' . $currentTask['id'] . ' not started: diff=' . $diff . ',task_startup_delay=' . $currentTask['task_startup_delay']);
                                return;
                                // Skip this silently
                                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Task ' . $currentTask['id'] . ' not started: diff=' . $diff . ',task_startup_delay=' . $currentTask['task_startup_delay']);
                                return;
-                       } // END - if
+                       }
 
                        // Launch the task and mark it as updated
                        $currentTask['task_started'] = true;
 
                        // Launch the task and mark it as updated
                        $currentTask['task_started'] = true;
@@ -128,7 +128,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
 
                        // Debug message
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Task ' . $currentTask['id'] . ' started with startup_delay=' . $currentTask['task_startup_delay'] . 'ms');
 
                        // Debug message
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Task ' . $currentTask['id'] . ' started with startup_delay=' . $currentTask['task_startup_delay'] . 'ms');
-               } // END - if
+               }
 
                // Get time difference from interval delay
                $diff = ($this->getMilliTime() - $currentTask['task_last_activity']) * 1000;
 
                // Get time difference from interval delay
                $diff = ($this->getMilliTime() - $currentTask['task_last_activity']) * 1000;
@@ -142,11 +142,11 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                        if ($updateTask === true) {
                                // Update the task before leaving
                                $this->updateTask($currentTask);
                        if ($updateTask === true) {
                                // Update the task before leaving
                                $this->updateTask($currentTask);
-                       } // END - if
+                       }
 
                        // Skip this silently
                        return;
 
                        // Skip this silently
                        return;
-               } // END - if
+               }
 
                // Set last activity
                $currentTask['task_last_activity'] = $this->getMilliTime();
 
                // Set last activity
                $currentTask['task_last_activity'] = $this->getMilliTime();
@@ -218,8 +218,8 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
 
                                // Abort here
                                break;
 
                                // Abort here
                                break;
-                       } // END - if
-               } // END - foreach
+                       }
+               }
 
                // Return found name
                return $taskName;
 
                // Return found name
                return $taskName;
@@ -229,10 +229,10 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         * Registers a task with a task handler.
         *
         * @param       $taskName               A task name to register the task on
         * Registers a task with a task handler.
         *
         * @param       $taskName               A task name to register the task on
-        * @param       $taskInstance   The instance that should be registered as a task
+        * @param       $taskInstance   An instance of a Taskable class
         * @return      void
         */
         * @return      void
         */
-       public function registerTask ($taskName, Visitable $taskInstance) {
+       public function registerTask (string $taskName, Taskable $taskInstance) {
                // Get interval delay
                $intervalDelay = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('task_' . $taskName . '_interval_delay');
                $startupDelay  = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('task_' . $taskName . '_startup_delay');
                // Get interval delay
                $intervalDelay = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('task_' . $taskName . '_interval_delay');
                $startupDelay  = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('task_' . $taskName . '_startup_delay');
@@ -243,7 +243,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                assert(($taskName === 'idle_loop') || (($taskName != 'idle_loop') && ($startupDelay > 0)));
 
                // Create the entry
                assert(($taskName === 'idle_loop') || (($taskName != 'idle_loop') && ($startupDelay > 0)));
 
                // Create the entry
-               $taskEntry = array(
+               $taskEntry = [
                        // Identifier for the generateHash() method
                        'id'                  => $taskName,
                        // Whether the task is started
                        // Identifier for the generateHash() method
                        'id'                  => $taskName,
                        // Whether the task is started
@@ -266,7 +266,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                        'task_interval_delay' => $intervalDelay,
                        // How often should this task run?
                        'task_max_runs'       => FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('task_' . $taskName . '_max_runs'),
                        'task_interval_delay' => $intervalDelay,
                        // How often should this task run?
                        'task_max_runs'       => FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('task_' . $taskName . '_max_runs'),
-               );
+               ];
 
                // Add the entry
                $this->getListInstance()->addEntry('tasks', $taskEntry);
 
                // Add the entry
                $this->getListInstance()->addEntry('tasks', $taskEntry);
@@ -306,7 +306,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                if (!$this->getListInstance()->getIterator()->valid()) {
                        // Rewind to the beginning for next loop
                        $this->getListInstance()->getIterator()->rewind();
                if (!$this->getListInstance()->getIterator()->valid()) {
                        // Rewind to the beginning for next loop
                        $this->getListInstance()->getIterator()->rewind();
-               } // END - if
+               }
 
                // Try to execute the task
                $this->executeCurrentTask();
 
                // Try to execute the task
                $this->executeCurrentTask();
@@ -350,7 +350,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
 
                        // Advance to next one
                        $this->getListInstance()->getIterator()->next();
 
                        // Advance to next one
                        $this->getListInstance()->getIterator()->next();
-               } // END - while
+               }
 
                // Debug message
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Shutdown of all tasks completed.');
 
                // Debug message
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Shutdown of all tasks completed.');
@@ -358,7 +358,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                // Remove all tasks
                foreach ($tasks as $entry) {
                        $this->unregisterTask($entry);
                // Remove all tasks
                foreach ($tasks as $entry) {
                        $this->unregisterTask($entry);
-               } // END - foreach
+               }
        }
 
 }
        }
 
 }
index 1353efc2e8acb51730b611398dfe4a39b9e7063d..a1ef9add7b824ba0be86309d0c6ee55e21fcfebd 100644 (file)
@@ -123,8 +123,8 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate {
         * @param       $imageType      Type of the image
         * @return      void
         */
         * @param       $imageType      Type of the image
         * @return      void
         */
-       protected final function setImageType ($imageType) {
-               $this->imageType = (string) $imageType;
+       protected final function setImageType (string $imageType) {
+               $this->imageType = $imageType;
        }
 
        /**
        }
 
        /**
@@ -142,8 +142,8 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate {
         * @param       $baseImage      A base image template
         * @return      void
         */
         * @param       $baseImage      A base image template
         * @return      void
         */
-       public final function setBaseImage ($baseImage) {
-               $this->baseImage = (string) $baseImage;
+       public final function setBaseImage (string $baseImage) {
+               $this->baseImage = $baseImage;
        }
 
        /**
        }
 
        /**
@@ -161,8 +161,8 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate {
         * @param       $imageName      Name of the image
         * @return      void
         */
         * @param       $imageName      Name of the image
         * @return      void
         */
-       public final function setImageName ($imageName) {
-               $this->imageName = (string) $imageName;
+       public final function setImageName (string $imageName) {
+               $this->imageName = $imageName;
        }
 
        /**
        }
 
        /**
@@ -180,8 +180,8 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate {
         * @param       $width  Width of the image
         * @return      void
         */
         * @param       $width  Width of the image
         * @return      void
         */
-       public final function setWidth ($width) {
-               $this->width = (int) $width;
+       public final function setWidth (int $width) {
+               $this->width = $width;
        }
 
        /**
        }
 
        /**
@@ -199,8 +199,8 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate {
         * @param       $height         Height of the image
         * @return      void
         */
         * @param       $height         Height of the image
         * @return      void
         */
-       public final function setHeight ($height) {
-               $this->height = (int) $height;
+       public final function setHeight (int $height) {
+               $this->height = $height;
        }
 
        /**
        }
 
        /**
@@ -224,13 +224,13 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate {
                // Random numbers?
                if ($red === 'rand') {
                        $red = $this->getRngInstance()->randomNumber(0, 255);
                // Random numbers?
                if ($red === 'rand') {
                        $red = $this->getRngInstance()->randomNumber(0, 255);
-               } // END - if
+               }
                if ($green === 'rand') {
                        $green = $this->getRngInstance()->randomNumber(0, 255);
                if ($green === 'rand') {
                        $green = $this->getRngInstance()->randomNumber(0, 255);
-               } // END - if
+               }
                if ($blue === 'rand') {
                        $blue = $this->getRngInstance()->randomNumber(0, 255);
                if ($blue === 'rand') {
                        $blue = $this->getRngInstance()->randomNumber(0, 255);
-               } // END - if
+               }
 
                $this->backgroundColor['red']   = (int) $red;
                $this->backgroundColor['green'] = (int) $green;
 
                $this->backgroundColor['red']   = (int) $red;
                $this->backgroundColor['green'] = (int) $green;
@@ -249,13 +249,13 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate {
                // Random numbers?
                if ($red === 'rand') {
                        $red = $this->getRngInstance()->randomNumber(0, 255);
                // Random numbers?
                if ($red === 'rand') {
                        $red = $this->getRngInstance()->randomNumber(0, 255);
-               } // END - if
+               }
                if ($green === 'rand') {
                        $green = $this->getRngInstance()->randomNumber(0, 255);
                if ($green === 'rand') {
                        $green = $this->getRngInstance()->randomNumber(0, 255);
-               } // END - if
+               }
                if ($blue === 'rand') {
                        $blue = $this->getRngInstance()->randomNumber(0, 255);
                if ($blue === 'rand') {
                        $blue = $this->getRngInstance()->randomNumber(0, 255);
-               } // END - if
+               }
 
                $this->foregroundColor['red']   = (int) $red;
                $this->foregroundColor['green'] = (int) $green;
 
                $this->foregroundColor['red']   = (int) $red;
                $this->foregroundColor['green'] = (int) $green;
@@ -339,7 +339,7 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate {
                // Random font size?
                if ($fontSize === 'rand') {
                        $fontSize = $this->getRngInstance()->randomNumber(4, 9);
                // Random font size?
                if ($fontSize === 'rand') {
                        $fontSize = $this->getRngInstance()->randomNumber(4, 9);
-               } // END - if
+               }
 
                $this->imageStrings[$this->currString]['size'] = (int) $fontSize;
        }
 
                $this->imageStrings[$this->currString]['size'] = (int) $fontSize;
        }
@@ -390,7 +390,7 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate {
                        $templateInstance->addGroupVariable('image_y'     , $this->getY());
                        $templateInstance->addGroupVariable('image_size'  , $this->getFontSize());
                        $templateInstance->addGroupVariable('image_string', $this->getImageString());
                        $templateInstance->addGroupVariable('image_y'     , $this->getY());
                        $templateInstance->addGroupVariable('image_size'  , $this->getFontSize());
                        $templateInstance->addGroupVariable('image_string', $this->getImageString());
-               } // END - foreach
+               }
 
                // Get the raw content
                $imageContent = $templateInstance->getRawTemplateData();
 
                // Get the raw content
                $imageContent = $templateInstance->getRawTemplateData();
index 4a229c0f33cbda5ebf0f3be31353877701bf1adb..6d9d8574a4952faf360d32a7afc5bed2d910af4e 100644 (file)
@@ -118,7 +118,7 @@ class GraphicalCodeCaptcha extends BaseCaptcha implements SolveableCaptcha {
 
                        // Replace character
                        $captchaString = str_replace($search, $replace, $captchaString, $captchaLength);
 
                        // Replace character
                        $captchaString = str_replace($search, $replace, $captchaString, $captchaLength);
-               } // END - foreach
+               }
 
                // Get crypto instance
                $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
 
                // Get crypto instance
                $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
index d594489e878dc82652095f575d7fed0100662a1a..994988e59efa96f70fedeebb72d2f03124e3d049 100644 (file)
@@ -97,8 +97,8 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @param       $newContent             New content to add
         * @return      void
         */
         * @param       $newContent             New content to add
         * @return      void
         */
-       protected final function addContent ($newContent) {
-               $this->content .= (string) trim($newContent) . PHP_EOL;
+       protected final function addContent (string $newContent) {
+               $this->content .= trim($newContent) . PHP_EOL;
        }
 
        /**
        }
 
        /**
@@ -107,9 +107,9 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @param       $content        Content to to the base
         * @return      void
         */
         * @param       $content        Content to to the base
         * @return      void
         */
-       protected function addHeaderContent ($content) {
+       protected function addHeaderContent (string $content) {
                // Add the header content
                // Add the header content
-               $this->groups['header']['content'] = (string) trim($content);
+               $this->groups['header']['content'] = trim($content);
        }
 
        /**
        }
 
        /**
@@ -118,9 +118,9 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @param       $content        Content to to the base
         * @return      void
         */
         * @param       $content        Content to to the base
         * @return      void
         */
-       protected function addFooterContent ($content) {
+       protected function addFooterContent (string $content) {
                // Add the footer content
                // Add the footer content
-               $this->groups['footer']['content'] = (string) trim($content);
+               $this->groups['footer']['content'] = trim($content);
        }
 
        /**
        }
 
        /**
@@ -131,7 +131,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @param       $newContent             New content to add
         * @return      void
         */
         * @param       $newContent             New content to add
         * @return      void
         */
-       protected final function addContentToPreviousGroup ($newContent) {
+       protected final function addContentToPreviousGroup (string $newContent) {
                // Check for sub/group
                if ($this->ifSubGroupOpenedPreviously()) {
                        // Get sub group id
                // Check for sub/group
                if ($this->ifSubGroupOpenedPreviously()) {
                        // Get sub group id
@@ -176,7 +176,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @param       $fieldName      Name of the field to assign
         * @return      void
         */
         * @param       $fieldName      Name of the field to assign
         * @return      void
         */
-       public function assignField ($fieldName) {
+       public function assignField (string $fieldName) {
                // Get the value from value instance
                $fieldValue = $this->getValueField($fieldName);
 
                // Get the value from value instance
                $fieldValue = $this->getValueField($fieldName);
 
@@ -254,7 +254,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @return      void
         * @throws      HelperGroupAlreadyCreatedException      If the group was already created before
         */
         * @return      void
         * @throws      HelperGroupAlreadyCreatedException      If the group was already created before
         */
-       protected function openGroupByIdContent ($groupId, $content, $tag) {
+       protected function openGroupByIdContent (string $groupId, string $content, string $tag) {
                //* DEBUG: */ echo "OPEN:groupId={$groupId},content=<pre>".htmlentities($content)."</pre>\n";
                // Is the group already there?
                if (isset($this->groups[$groupId])) {
                //* DEBUG: */ echo "OPEN:groupId={$groupId},content=<pre>".htmlentities($content)."</pre>\n";
                // Is the group already there?
                if (isset($this->groups[$groupId])) {
@@ -289,7 +289,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @return      void
         * @throws      HelperNoPreviousOpenedGroupException    If no previously opened group was found
         */
         * @return      void
         * @throws      HelperNoPreviousOpenedGroupException    If no previously opened group was found
         */
-       public function closePreviousGroupByContent ($content = '') {
+       public function closePreviousGroupByContent (string $content = '') {
                // Check if any sub group was opened before
                if ($this->ifSubGroupOpenedPreviously()) {
                        // Close it automatically
                // Check if any sub group was opened before
                if ($this->ifSubGroupOpenedPreviously()) {
                        // Close it automatically
@@ -341,7 +341,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @return      void
         * @throws      HelperSubGroupAlreadyCreatedException   If the sub group was already created before
         */
         * @return      void
         * @throws      HelperSubGroupAlreadyCreatedException   If the sub group was already created before
         */
-       protected function openSubGroupByIdContent ($subGroupId, $content, $tag) {
+       protected function openSubGroupByIdContent (string $subGroupId, string $content, string $tag) {
                //* DEBUG: */ echo "OPEN:subGroupId={$subGroupId},content=".htmlentities($content)."<br />\n";
                // Is the group already there?
                if (isset($this->subGroups[$subGroupId])) {
                //* DEBUG: */ echo "OPEN:subGroupId={$subGroupId},content=".htmlentities($content)."<br />\n";
                // Is the group already there?
                if (isset($this->subGroups[$subGroupId])) {
@@ -370,7 +370,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @return      void
         * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
         */
         * @return      void
         * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
         */
-       public function closePreviousSubGroupByContent ($content = '') {
+       public function closePreviousSubGroupByContent (string $content = '') {
                // Check if any sub group was opened before
                if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception
                // Check if any sub group was opened before
                if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception
@@ -450,7 +450,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @param       $groupId        Id of group to check
         * @return      $isOpened       Whether the specified group is open
         */
         * @param       $groupId        Id of group to check
         * @return      $isOpened       Whether the specified group is open
         */
-       protected function ifGroupIsOpened ($groupId) {
+       protected function ifGroupIsOpened (string $groupId) {
                // Is the group open?
                $isOpened = ((isset($this->groups[$groupId])) && ($this->groups[$groupId]['opened'] === true));
 
                // Is the group open?
                $isOpened = ((isset($this->groups[$groupId])) && ($this->groups[$groupId]['opened'] === true));
 
@@ -465,7 +465,7 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @return      $fieldValue             Value from field
         * @throws      NullPointerException    Thrown if $valueInstance is null
         */
         * @return      $fieldValue             Value from field
         * @throws      NullPointerException    Thrown if $valueInstance is null
         */
-       public function getValueField ($fieldName) {
+       public function getValueField (string $fieldName) {
                // Init value
                $fieldValue = NULL;
 
                // Init value
                $fieldValue = NULL;
 
@@ -537,8 +537,8 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @param       $previousGroupId        Id of previously opened group
         * @return      void
         */
         * @param       $previousGroupId        Id of previously opened group
         * @return      void
         */
-       protected final function setPreviousGroupId ($previousGroupId) {
-               $this->previousGroupId = (string) $previousGroupId;
+       protected final function setPreviousGroupId (string $previousGroupId) {
+               $this->previousGroupId = $previousGroupId;
        }
 
        /**
        }
 
        /**
@@ -556,8 +556,8 @@ abstract class BaseHelper extends BaseFrameworkSystem {
         * @param       $previousSubGroupId             Id of previously opened sub group
         * @return      void
         */
         * @param       $previousSubGroupId             Id of previously opened sub group
         * @return      void
         */
-       protected final function setPreviousSubGroupId ($previousSubGroupId) {
-               $this->previousSubGroupId = (string) $previousSubGroupId;
+       protected final function setPreviousSubGroupId (string $previousSubGroupId) {
+               $this->previousSubGroupId = $previousSubGroupId;
        }
 
 }
        }
 
 }
index 346d56da2552d7012a5293e22085b73ede99ac32..5611e6038d02a34ceccf747b4f57aa421ee23bb3 100644 (file)
@@ -72,8 +72,8 @@ class HtmlBlockHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $blockName      Name of the block we shall generate
         * @return      void
         */
         * @param       $blockName      Name of the block we shall generate
         * @return      void
         */
-       protected final function setBlockName ($blockName) {
-               $this->blockName = (string) $blockName;
+       protected final function setBlockName (string $blockName) {
+               $this->blockName = $blockName;
        }
 
        /**
        }
 
        /**
index 54422a82dde079691acbc040f10f843158bf0f87..add8e9fccbb3d83f532dc41f36a6d4ad5bc66cf6 100644 (file)
@@ -83,7 +83,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $withForm                       Whether include the form tag
         * @return      $helperInstance         A preparedf instance of this helper
         */
         * @param       $withForm                       Whether include the form tag
         * @return      $helperInstance         A preparedf instance of this helper
         */
-       public static final function createHtmlFormHelper (CompileableTemplate $templateInstance, string $formName, $formId = false, bool $withForm = true) {
+       public static final function createHtmlFormHelper (CompileableTemplate $templateInstance, string $formName, string $formId = NULL, bool $withForm = true) {
                // Get new instance
                $helperInstance = new HtmlFormHelper();
 
                // Get new instance
                $helperInstance = new HtmlFormHelper();
 
@@ -91,7 +91,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                $helperInstance->setTemplateInstance($templateInstance);
 
                // Is the form id not set?
                $helperInstance->setTemplateInstance($templateInstance);
 
                // Is the form id not set?
-               if ($formId === false) {
+               if (is_null($formId)) {
                        // Use form id from form name
                        $formId = $formName;
                } // END - if
                        // Use form id from form name
                        $formId = $formName;
                } // END - if
@@ -121,12 +121,12 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @throws      InvalidFormNameException        If the form name is invalid ( = false)
         * @todo        Add some unique PIN here to bypass problems with some browser and/or extensions
         */
         * @throws      InvalidFormNameException        If the form name is invalid ( = false)
         * @todo        Add some unique PIN here to bypass problems with some browser and/or extensions
         */
-       public function addFormTag ($formName = false, $formId = false) {
+       public function addFormTag (string $formName = NULL, string $formId = NULL) {
                // When the form is not yet opened at least form name must be valid
                // When the form is not yet opened at least form name must be valid
-               if (($this->formOpened === false) && ($formName === false)) {
+               if (($this->formOpened === false) && (is_null($formName))) {
                        // Thrown an exception
                        throw new InvalidFormNameException ($this, self::EXCEPTION_FORM_NAME_INVALID);
                        // Thrown an exception
                        throw new InvalidFormNameException ($this, self::EXCEPTION_FORM_NAME_INVALID);
-               } // END - if
+               }
 
                // Close the form is default
                $formContent = '</form>';
 
                // Close the form is default
                $formContent = '</form>';
@@ -177,7 +177,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputTextField ($fieldName, $fieldValue = '') {
+       public function addInputTextField (string $fieldName, string $fieldValue = '') {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
@@ -202,7 +202,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $fieldName      Input field name
         * @return      void
         */
         * @param       $fieldName      Input field name
         * @return      void
         */
-       public function addInputTextFieldWithDefault ($fieldName) {
+       public function addInputTextFieldWithDefault (string $fieldName) {
                // Get the value from instance
                $fieldValue = $this->getValueField($fieldName);
                //* DEBUG: */ print __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
                // Get the value from instance
                $fieldValue = $this->getValueField($fieldName);
                //* DEBUG: */ print __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
@@ -220,7 +220,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputPasswordField ($fieldName, $fieldValue = '') {
+       public function addInputPasswordField (string $fieldName, string $fieldValue = '') {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
@@ -248,7 +248,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputHiddenField ($fieldName, $fieldValue = '') {
+       public function addInputHiddenField (string $fieldName, string $fieldValue = '') {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
@@ -271,7 +271,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $fieldName      Input field name
         * @return      void
         */
         * @param       $fieldName      Input field name
         * @return      void
         */
-       public function addInputHiddenFieldWithDefault ($fieldName) {
+       public function addInputHiddenFieldWithDefault (string $fieldName) {
                // Get the value from instance
                $fieldValue = $this->getValueField($fieldName);
                //* DEBUG: */ print __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
                // Get the value from instance
                $fieldValue = $this->getValueField($fieldName);
                //* DEBUG: */ print __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
@@ -287,7 +287,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $prefix         Prefix for configuration without trailing _
         * @return      void
         */
         * @param       $prefix         Prefix for configuration without trailing _
         * @return      void
         */
-       public function addInputHiddenConfiguredField ($fieldName, $prefix) {
+       public function addInputHiddenConfiguredField (string $fieldName, string $prefix) {
                // Get the value from instance
                $fieldValue = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry("{$prefix}_{$fieldName}");
                //* DEBUG: */ print __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
                // Get the value from instance
                $fieldValue = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry("{$prefix}_{$fieldName}");
                //* DEBUG: */ print __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
@@ -305,7 +305,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputCheckboxField ($fieldName, $fieldChecked = true) {
+       public function addInputCheckboxField (string $fieldName, bool $fieldChecked = true) {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
@@ -313,8 +313,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                } // END - if
 
                // Set whether the check box is checked...
                } // END - if
 
                // Set whether the check box is checked...
-               $checked = ' checked="checked"';
-               if ($fieldChecked === false) $checked = ' ';
+               $checked = ($fieldChecked ? ' checked="checked"' : ' ');
 
                // Generate the content
                $inputContent = sprintf('<input type="checkbox" name="%s" class="checkbox" id="%s_%s_field" value="1"%s />',
 
                // Generate the content
                $inputContent = sprintf('<input type="checkbox" name="%s" class="checkbox" id="%s_%s_field" value="1"%s />',
@@ -336,7 +335,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputResetButton ($buttonText) {
+       public function addInputResetButton (string $buttonText) {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
@@ -361,7 +360,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputSubmitButton ($buttonText) {
+       public function addInputSubmitButton (string $buttonText) {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
@@ -388,7 +387,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @throws      FormClosedException             If no form has been opened before
         * @throws      InvalidArgumentException        If $groupId is not set
         */
         * @throws      FormClosedException             If no form has been opened before
         * @throws      InvalidArgumentException        If $groupId is not set
         */
-       public function addFormGroup ($groupId = '', $groupText = '') {
+       public function addFormGroup (string $groupId = '', string $groupText = '') {
                // Is a form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw exception here
                // Is a form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw exception here
@@ -460,7 +459,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @throws      FormFormClosedException         If no group has been opened before
         * @throws      InvalidArgumentException                If $subGroupId is not set
         */
         * @throws      FormFormClosedException         If no group has been opened before
         * @throws      InvalidArgumentException                If $subGroupId is not set
         */
-       public function addFormSubGroup ($subGroupId = '', $subGroupText = '') {
+       public function addFormSubGroup (string $subGroupId = '', string $subGroupText = '') {
                // Is a group opened?
                if ($this->ifGroupOpenedPreviously() === false) {
                        // Throw exception here
                // Is a group opened?
                if ($this->ifGroupOpenedPreviously() === false) {
                        // Throw exception here
@@ -523,7 +522,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addFieldLabel ($fieldName, $fieldText, $fieldTitle = '') {
+       public function addFieldLabel (string $fieldName, string $fieldText, string $fieldTitle = '') {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
@@ -562,7 +561,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addFormNote ($noteId, $formNotes) {
+       public function addFormNote (string $noteId, string $formNotes) {
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                // Is the form opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
@@ -590,7 +589,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputSelectField ($selectId, $firstEntry) {
+       public function addInputSelectField (string $selectId, string $firstEntry) {
                // Is the form group opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                // Is the form group opened?
                if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
@@ -637,7 +636,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
         * @todo        Add checking if sub option is already added
         */
         * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
         * @todo        Add checking if sub option is already added
         */
-       public function addSelectSubOption ($subName, $subValue) {
+       public function addSelectSubOption (string $subName, string $subValue) {
                // Is there a sub group (shall be a selection box!)
                if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception here
                // Is there a sub group (shall be a selection box!)
                if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception here
@@ -665,7 +664,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
         * @todo        Add checking if sub option is already added
         */
         * @throws      HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
         * @todo        Add checking if sub option is already added
         */
-       public function addSelectOption ($optionName, $optionValue) {
+       public function addSelectOption (string $optionName, string $optionValue) {
                // Is there a sub group (shall be a selection box!)
                if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception here
                // Is there a sub group (shall be a selection box!)
                if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception here
@@ -719,8 +718,8 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $formEnabled    Whether form is enabled or disabled
         * @return      void
         */
         * @param       $formEnabled    Whether form is enabled or disabled
         * @return      void
         */
-       public final function enableForm ($formEnabled = true) {
-               $this->formEnabled = (bool) $formEnabled;
+       public final function enableForm (bool $formEnabled = true) {
+               $this->formEnabled = $formEnabled;
        }
 
        /**
        }
 
        /**
@@ -729,8 +728,8 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $formName       Name of this form
         * @return      void
         */
         * @param       $formName       Name of this form
         * @return      void
         */
-       public final function setFormName ($formName) {
-               $this->formName = (string) $formName;
+       public final function setFormName (string $formName) {
+               $this->formName = $formName;
        }
 
        /**
        }
 
        /**
@@ -748,8 +747,8 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $formId Id of this form
         * @return      void
         */
         * @param       $formId Id of this form
         * @return      void
         */
-       public final function setFormId ($formId) {
-               $this->formId = (string) $formId;
+       public final function setFormId (string $formId) {
+               $this->formId = $formId;
        }
 
        /**
        }
 
        /**
@@ -826,7 +825,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         *
         * @return      $required       Whether the specified chat protocol is enabled
         */
         *
         * @return      $required       Whether the specified chat protocol is enabled
         */
-       public function ifChatEnabled ($chatProtocol) {
+       public function ifChatEnabled (string $chatProtocol) {
                $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('chat_enabled_' . $chatProtocol) == 'Y');
                return $required;
        }
                $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('chat_enabled_' . $chatProtocol) == 'Y');
                return $required;
        }
index 2dd3319c4d18a821b01c5879148c6051e998eb0c..e603d80521eb9b24f3a4027bc8e2d3307f6c2325 100644 (file)
@@ -139,7 +139,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $extraContent   Optional extra HTML content
         * @return      $linkContent    Rendered text link content
         */
         * @param       $extraContent   Optional extra HTML content
         * @return      $linkContent    Rendered text link content
         */
-       private function renderLinkContentWithTextExtraContent ($linkText, $linkTitle, $extraContent='') {
+       private function renderLinkContentWithTextExtraContent (string $linkText, string $linkTitle, string $extraContent = '') {
                // Construct link content
                $linkContent = sprintf('<a href="{?base_url?}/%s%s" title="%s">%s</a>',
                        $this->getLinkBase(),
                // Construct link content
                $linkContent = sprintf('<a href="{?base_url?}/%s%s" title="%s">%s</a>',
                        $this->getLinkBase(),
@@ -158,8 +158,8 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $linkName       Name of the link we shall generate
         * @return      void
         */
         * @param       $linkName       Name of the link we shall generate
         * @return      void
         */
-       protected final function setLinkName ($linkName) {
-               $this->linkName = (string) $linkName;
+       protected final function setLinkName (string $linkName) {
+               $this->linkName = $linkName;
        }
 
        /**
        }
 
        /**
@@ -177,8 +177,8 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $linkBase       Base of the link we shall generate
         * @return      void
         */
         * @param       $linkBase       Base of the link we shall generate
         * @return      void
         */
-       protected final function setLinkBase ($linkBase) {
-               $this->linkBase = (string) $linkBase;
+       protected final function setLinkBase (string $linkBase) {
+               $this->linkBase = $linkBase;
        }
 
        /**
        }
 
        /**
@@ -222,7 +222,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $groupCode      Code to open and close groups
         * @return      void
         */
         * @param       $groupCode      Code to open and close groups
         * @return      void
         */
-       public function addLinkGroup ($groupId, $groupText, $groupCode = 'div') {
+       public function addLinkGroup (string $groupId, string $groupText, string $groupCode = 'div') {
                // Is a group with that name open?
                if ($this->ifGroupOpenedPreviously()) {
                        // Then close it here
                // Is a group with that name open?
                if ($this->ifGroupOpenedPreviously()) {
                        // Then close it here
@@ -251,7 +251,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      NoGroupOpenedException  If no previous group was opened
         */
         * @return      void
         * @throws      NoGroupOpenedException  If no previous group was opened
         */
-       public function addLinkNote ($groupId, $groupNote, $groupCode = 'div') {
+       public function addLinkNote (string $groupId, string $groupNote, string $groupCode = 'div') {
                // Check if a previous group was opened
                if ($this->ifGroupOpenedPreviously() === false) {
                        // No group was opened before!
                // Check if a previous group was opened
                if ($this->ifGroupOpenedPreviously() === false) {
                        // No group was opened before!
@@ -284,7 +284,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      NoGroupOpenedException  If no previous group was opened
         */
         * @return      void
         * @throws      NoGroupOpenedException  If no previous group was opened
         */
-       protected function addActionLink ($linkAction, $linkText, $linkTitle) {
+       protected function addActionLink (string $linkAction, string $linkText, string $linkTitle) {
                // Check if a previous group was opened
                if ($this->ifGroupOpenedPreviously() === false) {
                        // No group was opened before!
                // Check if a previous group was opened
                if ($this->ifGroupOpenedPreviously() === false) {
                        // No group was opened before!
@@ -321,7 +321,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $languageId             Language id string to use
         * @return      void
         */
         * @param       $languageId             Language id string to use
         * @return      void
         */
-       public function addActionLinkById ($linkAction, $languageId) {
+       public function addActionLinkById (string $linkAction, string $languageId) {
                // Resolve the language string
                $languageResolvedText = FrameworkBootstrap::getLanguageInstance()->getMessage('link_' . $languageId . '_text');
 
                // Resolve the language string
                $languageResolvedText = FrameworkBootstrap::getLanguageInstance()->getMessage('link_' . $languageId . '_text');
 
@@ -339,7 +339,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $languageId             Language id string to use
         * @return      void
         */
         * @param       $languageId             Language id string to use
         * @return      void
         */
-       public function addLinkWithTextById ($languageId) {
+       public function addLinkWithTextById (string $languageId) {
                // Resolve the language string
                $languageResolvedText = FrameworkBootstrap::getLanguageInstance()->getMessage('link_' . $languageId . '_text');
 
                // Resolve the language string
                $languageResolvedText = FrameworkBootstrap::getLanguageInstance()->getMessage('link_' . $languageId . '_text');
 
index c501680a13e8f90afc7157b5f9cb1ff57706021e..7ce4940900c6d19e6e7453fbacdcbc428262cdf9 100644 (file)
@@ -56,7 +56,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @param       $element        Name of the request element we want to check
         * @return      $isSet          Whether the request element is set
         */
         * @param       $element        Name of the request element we want to check
         * @return      $isSet          Whether the request element is set
         */
-       public function isRequestElementSet ($element) {
+       public function isRequestElementSet (string $element) {
                // Is this element found?
                $isSet = isset($this->requestData[$element]);
 
                // Is this element found?
                $isSet = isset($this->requestData[$element]);
 
@@ -71,7 +71,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @return      $value          Value of the found request element or 'null' if the
         *                                              element was not found
         */
         * @return      $value          Value of the found request element or 'null' if the
         *                                              element was not found
         */
-       public function getRequestElement ($element) {
+       public function getRequestElement (string $element) {
                // Initialize value
                $value = NULL;
 
                // Initialize value
                $value = NULL;
 
@@ -95,7 +95,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @param       $value          Value to set
         * @return      void
         */
         * @param       $value          Value to set
         * @return      void
         */
-       public function setRequestElement ($element, $value) {
+       public function setRequestElement (string $element, $value) {
                $this->requestData[$element] = $value;
        }
 
                $this->requestData[$element] = $value;
        }
 
index 0406c5e37f11a3ced98f423192f5d0010180a096..dd5f6ed79deb5585a30b187a72fb35820e474452 100644 (file)
@@ -105,7 +105,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         * @return      $headerValue    Value of the header or 'null' if not found
         * @throws      UnsupportedOperationException   This method should never be called
         */
         * @return      $headerValue    Value of the header or 'null' if not found
         * @throws      UnsupportedOperationException   This method should never be called
         */
-       public function getHeaderElement ($headerName) {
+       public function getHeaderElement (string $headerName) {
                // Console doesn't have any headers
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
                // Console doesn't have any headers
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
@@ -127,7 +127,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         * @return      $cookieValue    Value of cookie or null if not found
         * @throws      UnsupportedOperationException   This method should never be called
         */
         * @return      $cookieValue    Value of cookie or null if not found
         * @throws      UnsupportedOperationException   This method should never be called
         */
-       public final function readCookie ($cookieName) {
+       public final function readCookie (string $cookieName) {
                // There are no cookies on console
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
                // There are no cookies on console
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
index f8b0fdbaf3a26e252cf2552e08891e121d2c5124..77f36beeb766aed779fed20d6d21071e6f910e1d 100644 (file)
@@ -104,7 +104,7 @@ class HtmlRequest extends BaseRequest implements Requestable {
         * @param       $headerName             Name of the header
         * @return      $headerValue    Value of the header or 'null' if not found
         */
         * @param       $headerName             Name of the header
         * @return      $headerValue    Value of the header or 'null' if not found
         */
-       public function getHeaderElement ($headerName) {
+       public function getHeaderElement (string $headerName) {
                // Default return value on error
                $headerValue = NULL;
 
                // Default return value on error
                $headerValue = NULL;
 
@@ -135,7 +135,7 @@ class HtmlRequest extends BaseRequest implements Requestable {
         * @param       $cookieName             Name of cookie we shall read
         * @return      $cookieValue    Value of cookie or null if not found
         */
         * @param       $cookieName             Name of cookie we shall read
         * @return      $cookieValue    Value of cookie or null if not found
         */
-       public final function readCookie ($cookieName) {
+       public final function readCookie (string $cookieName) {
                // Default is no cookie with that name found
                $cookieValue = NULL;
 
                // Default is no cookie with that name found
                $cookieValue = NULL;
 
index e51fdc90413f5bc9dfdfee472ceaf66a89c0d2b4..86e9a7ff04642e0f9004f6ce4efc033a9c32069c 100644 (file)
@@ -66,7 +66,7 @@ abstract class BaseState extends BaseFrameworkSystem implements Stateable {
         * @param       $stateName      Name of this state in a printable maner
         * @return      void
         */
         * @param       $stateName      Name of this state in a printable maner
         * @return      void
         */
-       protected final function setStateName ($stateName) {
+       protected final function setStateName (string $stateName) {
                $this->stateName = $stateName;
        }
 
                $this->stateName = $stateName;
        }
 
index 1a974893c8a91f20e24202bc41eea645f72b3692..e76806907168756aaed58666a04f4a5188596eb7 100644 (file)
@@ -66,7 +66,7 @@ class McryptStream extends BaseCryptoStream implements EncryptableStream {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
-       public function encryptStream ($str, $key = NULL) {
+       public function encryptStream (string $str, string $key = NULL) {
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MCRYPT-STREAM: key[' . gettype($key) . ']=' . $key);
 
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MCRYPT-STREAM: key[' . gettype($key) . ']=' . $key);
 
@@ -133,7 +133,7 @@ class McryptStream extends BaseCryptoStream implements EncryptableStream {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $str            The unencrypted string
         */
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $str            The unencrypted string
         */
-       public function decryptStream ($encrypted, $key = NULL) {
+       public function decryptStream (string $encrypted, string $key = NULL) {
                // Init crypto module
                $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
                $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
                // Init crypto module
                $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
                $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
index 38337ba537c342cb896f6e3da5287ff5054d7efc..4e6908d9aebe6ae4efc9d82ff925717966840e20 100644 (file)
@@ -58,29 +58,24 @@ class NullCryptoStream extends BaseCryptoStream implements EncryptableStream {
         * Encrypt the string with fixed salt
         *
         * @param       $str            The unencrypted string
         * Encrypt the string with fixed salt
         *
         * @param       $str            The unencrypted string
-        * @param       $key            Optional key, if none provided, a random key will be generated
+        * @param       $key            Ignored
         * @return      $encrypted      Encrypted string
         */
         * @return      $encrypted      Encrypted string
         */
-       public function encryptStream ($str, $key = NULL) {
-               // Just handle it over
-               $encrypted = (string) $str;
-
+       public function encryptStream (string $str, string $key = NULL) {
                // Return it
                // Return it
-               return $encrypted;
+               return $str;
        }
 
        /**
         * Decrypt the string with fixed salt
         *
         * @param       $encrypted      Encrypted string
        }
 
        /**
         * Decrypt the string with fixed salt
         *
         * @param       $encrypted      Encrypted string
+        * @param       $key            Ignored
         * @return      $str            The unencrypted string
         */
         * @return      $str            The unencrypted string
         */
-       public function decryptStream ($encrypted) {
-               // Just handle it over
-               $str = (string) $encrypted;
-
+       public function decryptStream (string $encrypted, string $key = NULL) {
                // Return it
                // Return it
-               return $str;
+               return $encrypted;
        }
 
        /**
        }
 
        /**
index 72b9b7066f1a9d065a048af0500ac313660b91ba..6fad925e88f274e90c868eadca759c964a4acabb 100644 (file)
@@ -65,7 +65,7 @@ class OpenSslStream extends BaseCryptoStream implements EncryptableStream {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
-       public function encryptStream ($str, $key = NULL) {
+       public function encryptStream (string $str, string $key = NULL) {
                // @TODO unfinished
                return $str;
 
                // @TODO unfinished
                return $str;
 
@@ -135,7 +135,7 @@ class OpenSslStream extends BaseCryptoStream implements EncryptableStream {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $str            The unencrypted string
         */
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $str            The unencrypted string
         */
-       public function decryptStream ($encrypted, $key = NULL) {
+       public function decryptStream (string $encrypted, string $key = NULL) {
                // @TODO unfinished
                return $encrypted;
 
                // @TODO unfinished
                return $encrypted;
 
index 07ba19bf1b99436cff2628d7c16e511db26d6e9d..d5efe92a33cf3251ba7c8bec549a62ebbeb3810c 100644 (file)
@@ -286,7 +286,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @param       $imageType      Code fragment or direct value holding the image type
         * @return      void
         */
         * @param       $imageType      Code fragment or direct value holding the image type
         * @return      void
         */
-       private function setImageType ($imageType) {
+       private function setImageType (string $imageType) {
                // Set group to general
                $this->setVariableGroup('general');
 
                // Set group to general
                $this->setVariableGroup('general');
 
@@ -366,7 +366,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @return      void
         * @see         ImageTemplateEngine::setImageResolution
         */
         * @return      void
         * @see         ImageTemplateEngine::setImageResolution
         */
-       private function setImageImageString ($groupable = 'single') {
+       private function setImageImageString (string $groupable = 'single') {
                // Call the image class
                $this->getImageInstance()->initImageString($groupable);
 
                // Call the image class
                $this->getImageInstance()->initImageString($groupable);
 
@@ -380,7 +380,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @param       $imageName      Name of the image
         * @return      void
         */
         * @param       $imageName      Name of the image
         * @return      void
         */
-       private function setImagePropertyName ($imageName) {
+       private function setImagePropertyName (string $imageName) {
                // Call the image class
                $this->getImageInstance()->setImageName($imageName);
        }
                // Call the image class
                $this->getImageInstance()->setImageName($imageName);
        }
@@ -391,7 +391,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @param       $width  Width of the image or variable
         * @return      void
         */
         * @param       $width  Width of the image or variable
         * @return      void
         */
-       private function setImagePropertyWidth ($width) {
+       private function setImagePropertyWidth (int $width) {
                // Call the image class
                $this->getImageInstance()->setWidth($width);
        }
                // Call the image class
                $this->getImageInstance()->setWidth($width);
        }
@@ -402,7 +402,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @param       $height Height of the image or variable
         * @return      void
         */
         * @param       $height Height of the image or variable
         * @return      void
         */
-       private function setImagePropertyHeight ($height) {
+       private function setImagePropertyHeight (int $height) {
                // Call the image class
                $this->getImageInstance()->setHeight($height);
        }
                // Call the image class
                $this->getImageInstance()->setHeight($height);
        }
@@ -446,7 +446,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @param       $stringName             String name (identifier)
         * @return      void
         */
         * @param       $stringName             String name (identifier)
         * @return      void
         */
-       private function setImagePropertyStringName ($stringName) {
+       private function setImagePropertyStringName (string $stringName) {
                // Call the image class
                $this->getImageInstance()->setStringName($stringName);
        }
                // Call the image class
                $this->getImageInstance()->setStringName($stringName);
        }
@@ -457,7 +457,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @param       $fontSize       Size of the font
         * @return      void
         */
         * @param       $fontSize       Size of the font
         * @return      void
         */
-       private function setImagePropertyFontSize ($fontSize) {
+       private function setImagePropertyFontSize (int $fontSize) {
                // Call the image class
                $this->getImageInstance()->setFontSize($fontSize);
        }
                // Call the image class
                $this->getImageInstance()->setFontSize($fontSize);
        }
@@ -468,7 +468,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @param       $imageString    Image string to set
         * @return      void
         */
         * @param       $imageString    Image string to set
         * @return      void
         */
-       private function setImagePropertyText ($imageString) {
+       private function setImagePropertyText (string $imageString) {
                // Call the image class
                $this->getImageInstance()->setString($imageString);
        }
                // Call the image class
                $this->getImageInstance()->setString($imageString);
        }
@@ -479,7 +479,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @param       $x      X coordinate
         * @return      void
         */
         * @param       $x      X coordinate
         * @return      void
         */
-       private function setImagePropertyX ($x) {
+       private function setImagePropertyX (int $x) {
                // Call the image class
                $this->getImageInstance()->setX($x);
        }
                // Call the image class
                $this->getImageInstance()->setX($x);
        }
@@ -490,7 +490,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @param       $y      Y coordinate
         * @return      void
         */
         * @param       $y      Y coordinate
         * @return      void
         */
-       private function setImagePropertyY ($y) {
+       private function setImagePropertyY (int $y) {
                // Call the image class
                $this->getImageInstance()->setY($y);
        }
                // Call the image class
                $this->getImageInstance()->setY($y);
        }
@@ -535,7 +535,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         *                                              located in 'image' by default
         * @return      void
         */
         *                                              located in 'image' by default
         * @return      void
         */
-       public function loadImageTemplate ($template) {
+       public function loadImageTemplate (string $template) {
                // Set template type
                $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('image_template_type'));
 
                // Set template type
                $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('image_template_type'));
 
index 6734da320e502c395dd76b549d247e004bf1a005..951093a02d8035570a4914dae127b9e15e4d5786 100644 (file)
@@ -267,7 +267,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @param       $senderAddress  Sender address to set in email
         * @return      void
         */
         * @param       $senderAddress  Sender address to set in email
         * @return      void
         */
-       private function setEmailPropertySenderAddress ($senderAddress) {
+       private function setEmailPropertySenderAddress (string $senderAddress) {
                // Set the template variable
                $this->assignVariable('sender', $senderAddress);
        }
                // Set the template variable
                $this->assignVariable('sender', $senderAddress);
        }
@@ -278,7 +278,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @param       $recipientAddress       Recipient address to set in email
         * @return      void
         */
         * @param       $recipientAddress       Recipient address to set in email
         * @return      void
         */
-       private function setEmailPropertyRecipientAddress ($recipientAddress) {
+       private function setEmailPropertyRecipientAddress (string $recipientAddress) {
                // Set the template variable
                $this->assignVariable('recipient', $recipientAddress);
        }
                // Set the template variable
                $this->assignVariable('recipient', $recipientAddress);
        }
index dcdf8cad96204943bcd60f13b11ec20441e361b1..943b6a85c95f199e60254671337904145038001b 100644 (file)
@@ -325,7 +325,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                if (($nodeName != $this->getCurrMainNode()) && (in_array($nodeName, $this->getMainNodes()))) {
                        // Did not match!
                        throw new XmlNodeMismatchException (array($this, $nodeName, $this->getCurrMainNode()), Parseable::EXCEPTION_XML_NODE_MISMATCH);
                if (($nodeName != $this->getCurrMainNode()) && (in_array($nodeName, $this->getMainNodes()))) {
                        // Did not match!
                        throw new XmlNodeMismatchException (array($this, $nodeName, $this->getCurrMainNode()), Parseable::EXCEPTION_XML_NODE_MISMATCH);
-               } // END - if
+               }
 
                // Construct method name
                $methodName = 'finish' . StringUtils::convertToClassName($nodeName);
 
                // Construct method name
                $methodName = 'finish' . StringUtils::convertToClassName($nodeName);
@@ -351,7 +351,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                if (empty($characters)) {
                        // Then skip it silently
                        return;
                if (empty($characters)) {
                        // Then skip it silently
                        return;
-               } // END - if
+               }
 
                // Assign the found characters to variable and use the last entry from
                // stack as the name
 
                // Assign the found characters to variable and use the last entry from
                // stack as the name
@@ -365,7 +365,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @param       $templateDependency             A template to load to satisfy dependencies
         * @return      void
         */
         * @param       $templateDependency             A template to load to satisfy dependencies
         * @return      void
         */
-       private function handleTemplateDependency ($node, $templateDependency) {
+       private function handleTemplateDependency (string $node, string $templateDependency) {
                // Is the template dependency set?
                if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) {
                        // Get a temporay menu template instance
                // Is the template dependency set?
                if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) {
                        // Get a temporay menu template instance
@@ -379,7 +379,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
 
                        // Save the parsed raw content in our dependency array
                        $this->dependencyContent[$node] = $templateInstance->getRawTemplateData();
 
                        // Save the parsed raw content in our dependency array
                        $this->dependencyContent[$node] = $templateInstance->getRawTemplateData();
-               } // END - if
+               }
        }
 
        /**
        }
 
        /**
@@ -389,7 +389,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @return      void
         * @todo        Add cache creation here
         */
         * @return      void
         * @todo        Add cache creation here
         */
-       private function initMenu ($templateDependency = '') {
+       private function initMenu (string $templateDependency = '') {
                // Get web template engine
                $this->setTemplateInstance(ObjectFactory::createObjectByConfiguredName('html_template_class', array(GenericRegistry::getRegistry()->getInstance('application'))));
 
                // Get web template engine
                $this->setTemplateInstance(ObjectFactory::createObjectByConfiguredName('html_template_class', array(GenericRegistry::getRegistry()->getInstance('application'))));
 
@@ -816,11 +816,11 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                        if ($variableName == 'anchor-href') {
                                // Expand variable with URL then
                                $variableValue = '{?base_url?}/' . $variableValue;
                        if ($variableName == 'anchor-href') {
                                // Expand variable with URL then
                                $variableValue = '{?base_url?}/' . $variableValue;
-                       } // END - if
+                       }
 
                        // ... into the instance
                        $this->getTemplateInstance()->assignVariable($variableName, $variableValue);
 
                        // ... into the instance
                        $this->getTemplateInstance()->assignVariable($variableName, $variableValue);
-               } // END - foreach
+               }
 
                // Compile template + variables
                $this->getTemplateInstance()->compileTemplate();
 
                // Compile template + variables
                $this->getTemplateInstance()->compileTemplate();
@@ -850,7 +850,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
 
                        // ... into the instance
                        $this->getTemplateInstance()->assignVariable($variableName, $variableValue);
 
                        // ... into the instance
                        $this->getTemplateInstance()->assignVariable($variableName, $variableValue);
-               } // END - foreach
+               }
 
                // Assign block content
                $this->getTemplateInstance()->assignVariable('block_content', $blockContent);
 
                // Assign block content
                $this->getTemplateInstance()->assignVariable('block_content', $blockContent);
index e86763777e99529537ef3cd5f4befdcb68b48a1a..84680b8d5dee4dc5688cf194491c06c4d03cbcf6 100644 (file)
@@ -199,8 +199,8 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         * @param       $element                Element name to set as current main node
         * @return      $currMainNode   Current main node
         */
         * @param       $element                Element name to set as current main node
         * @return      $currMainNode   Current main node
         */
-       private final function setCurrMainNode ($element) {
-               $this->curr['main_node'] = (string) $element;
+       private final function setCurrMainNode (string $element) {
+               $this->curr['main_node'] = $element;
        }
 
        /**
        }
 
        /**
@@ -275,7 +275,7 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         * @param       $templateDependency             A template to load to satisfy dependencies
         * @return      void
         */
         * @param       $templateDependency             A template to load to satisfy dependencies
         * @return      void
         */
-       protected function handleTemplateDependency ($node, $templateDependency) {
+       protected function handleTemplateDependency (string $node, string $templateDependency) {
                // Check that the XML node is not empty
                assert(!empty($node));
 
                // Check that the XML node is not empty
                assert(!empty($node));
 
@@ -304,7 +304,7 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         * @return      void
         * @throws      InvalidXmlNodeException         If an unknown/invalid XML node name was found
         */
         * @return      void
         * @throws      InvalidXmlNodeException         If an unknown/invalid XML node name was found
         */
-       public final function startElement ($resource, $element, array $attributes) {
+       public final function startElement ($resource, string $element, array $attributes) {
                // Initial method name which will never be called...
                $methodName = 'init' . StringUtils::convertToClassName($this->xmlTemplateType);
 
                // Initial method name which will never be called...
                $methodName = 'init' . StringUtils::convertToClassName($this->xmlTemplateType);
 
@@ -339,7 +339,7 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine implements Compi
         * @return      void
         * @throws      XmlNodeMismatchException        If current main node mismatches the closing one
         */
         * @return      void
         * @throws      XmlNodeMismatchException        If current main node mismatches the closing one
         */
-       public final function finishElement ($resource, $nodeName) {
+       public final function finishElement ($resource, string $nodeName) {
                // Make all lower-case
                $nodeName = strtolower($nodeName);
 
                // Make all lower-case
                $nodeName = strtolower($nodeName);
 
index ec6067a55404684989472a34dd56d5c518d822ba..8d7ca8876c1f3733cc9ef35feddb41d6bf3ee968 100644 (file)
@@ -35,7 +35,7 @@ class DatabaseException extends FrameworkException {
         * @param       $code           Code number for the exception
         * @return      void
         */
         * @param       $code           Code number for the exception
         * @return      void
         */
-       public function __construct ($message, int $code) {
+       public function __construct (string $message, int $code) {
                // Just call the parent constructor
                parent::__construct($message, $code);
        }
                // Just call the parent constructor
                parent::__construct($message, $code);
        }
index 6dc778cc3d103ea43a7cedd43110ca75b919072d..427270d992341f57224ca220d3016ae8d3569e31 100644 (file)
@@ -39,7 +39,7 @@ interface Cryptable extends FrameworkInterface {
         * @param       $withFixed      Whether to include a fixed salt (not recommended in p2p applications)
         * @return      $hashed         The hashed and salted string
         */
         * @param       $withFixed      Whether to include a fixed salt (not recommended in p2p applications)
         * @return      $hashed         The hashed and salted string
         */
-       function hashString ($str, $oldHash = '', $withFixed = true);
+       function hashString (string $str, string $oldHash = '', bool $withFixed = true);
 
        /**
         * Encrypt the string with fixed salt
 
        /**
         * Encrypt the string with fixed salt
@@ -48,7 +48,7 @@ interface Cryptable extends FrameworkInterface {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
-       function encryptString ($str, $key = NULL);
+       function encryptString (string $str, string $key = NULL);
 
        /**
         * Decrypt the string with fixed salt
 
        /**
         * Decrypt the string with fixed salt
@@ -56,6 +56,6 @@ interface Cryptable extends FrameworkInterface {
         * @param       $encrypted      Encrypted string
         * @return      $str            The unencrypted string
         */
         * @param       $encrypted      Encrypted string
         * @return      $str            The unencrypted string
         */
-       function decryptString ($encrypted);
+       function decryptString (string $encrypted);
 
 }
 
 }
index 0c2952741c7859dab0c99eb8514d16e75ced524e..3e9934e69afd9a610a5be8aed139fc79539c213f 100644 (file)
@@ -43,10 +43,10 @@ interface HandleableTask extends HandleableDataSet {
         * Registers a task with a task handler.
         *
         * @param       $taskName               A task name to register the task on
         * Registers a task with a task handler.
         *
         * @param       $taskName               A task name to register the task on
-        * @param       $taskInstance   The instance we should register as a task
+        * @param       $taskInstance   An instance of a Taskable class
         * @return      void
         */
         * @return      void
         */
-       function registerTask ($taskName, Visitable $taskInstance);
+       function registerTask (string $taskName, Taskable $taskInstance);
 
        /**
         * Checks whether tasks are left including idle task
 
        /**
         * Checks whether tasks are left including idle task
index af1cfc7f9d21e7a8ab628af0b85fc7ae0f6d1c83..ed4bb82f43dfa33bc581acfcdca9e2b28a8780b7 100644 (file)
@@ -35,7 +35,7 @@ interface UserRegister extends AddableCriteria {
         * @param       $requestKey             Key in request class
         * @return      void
         */
         * @param       $requestKey             Key in request class
         * @return      void
         */
-       function encryptPassword ($requestKey);
+       function encryptPassword (string $requestKey);
 
        /**
         * Perform things like informing assigned affilates about new registration
 
        /**
         * Perform things like informing assigned affilates about new registration
index 60def40ceb56926882ec15394d49ef1ae35cb8b4..55f4cac4cc10435a78808ee826cfd4cec9c17d3a 100644 (file)
@@ -34,7 +34,7 @@ interface Requestable extends FrameworkInterface {
         * @param       $element        Name of the request element we want to check
         * @return      $isSet          Whether the request element is set
         */
         * @param       $element        Name of the request element we want to check
         * @return      $isSet          Whether the request element is set
         */
-       function isRequestElementSet ($element);
+       function isRequestElementSet (string $element);
 
        /**
         * Getter for request element or 'null' if element was not found
 
        /**
         * Getter for request element or 'null' if element was not found
@@ -43,7 +43,7 @@ interface Requestable extends FrameworkInterface {
         * @return      $value          Value of the found request element or 'null' if the
         *                                              element was not found
         */
         * @return      $value          Value of the found request element or 'null' if the
         *                                              element was not found
         */
-       function getRequestElement ($element);
+       function getRequestElement (string $element);
 
        /**
         * Setter for request elements
 
        /**
         * Setter for request elements
@@ -52,7 +52,7 @@ interface Requestable extends FrameworkInterface {
         * @param       $value          Value to set
         * @return      void
         */
         * @param       $value          Value to set
         * @return      void
         */
-       function setRequestElement ($element, $value);
+       function setRequestElement (string $element, $value);
 
        /**
         * Setter for request data array
 
        /**
         * Setter for request data array
index c73c46139dc86a63c920e116ded6abbe6051dc9b..68b85c2a97ede0c252b2cece8326e50e587f2cbe 100644 (file)
@@ -40,14 +40,15 @@ interface EncryptableStream extends Stream {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
-       function encryptStream ($str, $key = NULL);
+       function encryptStream (string $str, string $key = NULL);
 
        /**
         * Decrypt the string with fixed salt
         *
         * @param       $encrypted      Encrypted string
 
        /**
         * Decrypt the string with fixed salt
         *
         * @param       $encrypted      Encrypted string
+        * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $str            The unencrypted string
         */
         * @return      $str            The unencrypted string
         */
-       function decryptStream ($encrypted);
+       function decryptStream (string $encrypted, string $key = NULL);
 
 }
 
 }
index 8dd7cfebbe7ff34d5fe99c234d27342367dca7c5..7b900fd296ba12733146f4437dc15a1e9b7d4e7a 100644 (file)
@@ -77,86 +77,6 @@ class FrameworkBootstrapTest extends TestCase {
                //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
                //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
-       /**
-        * Tests setting a NULL default timezone
-        */
-       public function testSettingNullDefaultTimezone () {
-               // Will throw this exception
-               $this->expectException(NullPointerException::class);
-
-               // Test it
-               FrameworkBootstrap::setDefaultTimezone(NULL);
-       }
-
-       /**
-        * Tests setting a boolean default timezone
-        */
-       public function testSettingBooleanDefaultTimezone () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               FrameworkBootstrap::setDefaultTimezone(FALSE);
-       }
-
-       /**
-        * Tests setting a decimal default timezone
-        */
-       public function testSettingDecimalDefaultTimezone () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               FrameworkBootstrap::setDefaultTimezone(12345);
-       }
-
-       /**
-        * Tests setting a float default timezone
-        */
-       public function testSettingFloatDefaultTimezone () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               FrameworkBootstrap::setDefaultTimezone(123.45);
-       }
-
-       /**
-        * Tests setting an array default timezone
-        */
-       public function testSettingArrayDefaultTimezone () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               FrameworkBootstrap::setDefaultTimezone(array());
-       }
-
-       /**
-        * Tests setting an object default timezone
-        */
-       public function testSettingObjectDefaultTimezone () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               FrameworkBootstrap::setDefaultTimezone($this);
-       }
-
-       /**
-        * Tests setting a resource default timezone
-        */
-       public function testSettingResourceDefaultTimezone () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Init some resource
-               $resource = fopen(__FILE__, 'r');
-
-               // Test it
-               FrameworkBootstrap::setDefaultTimezone($resource);
-       }
-
        /**
         * Tests setting an empty default timezone
         */
        /**
         * Tests setting an empty default timezone
         */
index 6506e2d64d9df3ab8ec181bd74ea7ab317bf3c62..12d8e551e7d8ef3d1d07d232b0ac4e7dbbfa6e46 100644 (file)
@@ -164,28 +164,6 @@ class FrameworkConfigurationTest extends TestCase {
                $this->assertEquals($config1, $config2);
        }
 
                $this->assertEquals($config1, $config2);
        }
 
-       /**
-        * Tests if a proper exception is thrown when check for a NULL key
-        */
-       public function testCheckingNullConfigKey () {
-               // Will throw this exception
-               $this->expectException(NullPointerException::class);
-
-               // Test it
-               $dummy = self::$configInstance->isConfigurationEntrySet(NULL);
-       }
-
-       /**
-        * Tests if a proper exception is thrown when checking a boolean key
-        */
-       public function testCheckingBooleanConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               $dummy = self::$configInstance->isConfigurationEntrySet(FALSE);
-       }
-
        /**
         * Tests if a proper exception is thrown when checking an empty key
         */
        /**
         * Tests if a proper exception is thrown when checking an empty key
         */
@@ -197,64 +175,6 @@ class FrameworkConfigurationTest extends TestCase {
                $dummy = self::$configInstance->isConfigurationEntrySet('');
        }
 
                $dummy = self::$configInstance->isConfigurationEntrySet('');
        }
 
-       /**
-        * Tests if a proper exception is thrown when checking an array key
-        */
-       public function testCheckingArrayConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               $dummy = self::$configInstance->isConfigurationEntrySet(array());
-       }
-
-       /**
-        * Tests if a proper exception is thrown when checking a decimal key
-        */
-       public function testCheckingDecimalConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               $dummy = self::$configInstance->isConfigurationEntrySet(12345);
-       }
-
-       /**
-        * Tests if a proper exception is thrown when checking a float key
-        */
-       public function testCheckingFloatConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               $dummy = self::$configInstance->isConfigurationEntrySet(123.45);
-       }
-
-       /**
-        * Tests if a proper exception is thrown when checking an object key
-        */
-       public function testCheckingObjectConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               $dummy = self::$configInstance->isConfigurationEntrySet($this);
-       }
-
-       /**
-        * Tests if a proper exception is thrown when checking a resource key
-        */
-       public function testCheckingResourceConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Init some resource
-               $resource = fopen(__FILE__, 'r');
-
-               // Test it
-               $dummy = self::$configInstance->isConfigurationEntrySet($resource);
-       }
-
        /**
         * Tests if checking an existing (well-known) key can be found and returns
         * TRUE.
        /**
         * Tests if checking an existing (well-known) key can be found and returns
         * TRUE.
@@ -272,28 +192,6 @@ class FrameworkConfigurationTest extends TestCase {
                $this->assertFalse(self::$configInstance->isConfigurationEntrySet('__non_existing_key__'));
        }
 
                $this->assertFalse(self::$configInstance->isConfigurationEntrySet('__non_existing_key__'));
        }
 
-       /**
-        * Tests if a proper exception is thrown when getting a NULL key
-        */
-       public function testGettingNullConfigKey () {
-               // Will throw this exception
-               $this->expectException(NullPointerException::class);
-
-               // Test it
-               $dummy = self::$configInstance->getConfigEntry(NULL);
-       }
-
-       /**
-        * Tests if a proper exception is thrown when getting a boolean key
-        */
-       public function testGettingBooleanConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               $dummy = self::$configInstance->getConfigEntry(FALSE);
-       }
-
        /**
         * Tests if a proper exception is thrown when getting an empty key
         */
        /**
         * Tests if a proper exception is thrown when getting an empty key
         */
@@ -305,64 +203,6 @@ class FrameworkConfigurationTest extends TestCase {
                $dummy = self::$configInstance->getConfigEntry('');
        }
 
                $dummy = self::$configInstance->getConfigEntry('');
        }
 
-       /**
-        * Tests if a proper exception is thrown when getting a decimal key
-        */
-       public function testGettingDecimalConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               $dummy = self::$configInstance->getConfigEntry(12345);
-       }
-
-       /**
-        * Tests if a proper exception is thrown when getting a float key
-        */
-       public function testGettingFloatConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               $dummy = self::$configInstance->getConfigEntry(123.45);
-       }
-
-       /**
-        * Tests if a proper exception is thrown when getting an array key
-        */
-       public function testGettingArrayConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               $dummy = self::$configInstance->getConfigEntry(array());
-       }
-
-       /**
-        * Tests if a proper exception is thrown when getting an object key
-        */
-       public function testGettingObjectConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               $dummy = self::$configInstance->getConfigEntry($this);
-       }
-
-       /**
-        * Tests if a proper exception is thrown when getting a resource key
-        */
-       public function testGettingResourceConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Init some resource
-               $resource = fopen(__FILE__, 'r');
-
-               // Test it
-               $dummy = self::$configInstance->getConfigEntry($resource);
-       }
-
        /**
         * Tests if getting a non-existing key will cause a proper exception been
         * thrown.
        /**
         * Tests if getting a non-existing key will cause a proper exception been
         * thrown.
@@ -386,28 +226,6 @@ class FrameworkConfigurationTest extends TestCase {
                $this->assertDirectoryIsReadable($value);
        }
 
                $this->assertDirectoryIsReadable($value);
        }
 
-       /**
-        * Tests setting a NULL key (value doesn't matter)
-        */
-       public function testSettingNullConfigKey () {
-               // Will throw this exception
-               $this->expectException(NullPointerException::class);
-
-               // Test it
-               self::$configInstance->setConfigEntry(NULL, 'foo');
-       }
-
-       /**
-        * Tests setting a boolean key (value doesn't matter)
-        */
-       public function testSettingBooleanConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               self::$configInstance->setConfigEntry(FALSE, 'foo');
-       }
-
        /**
         * Tests setting an empty key (value doesn't matter)
         */
        /**
         * Tests setting an empty key (value doesn't matter)
         */
@@ -419,64 +237,6 @@ class FrameworkConfigurationTest extends TestCase {
                self::$configInstance->setConfigEntry('', 'foo');
        }
 
                self::$configInstance->setConfigEntry('', 'foo');
        }
 
-       /**
-        * Tests setting a decimal key (value doesn't matter)
-        */
-       public function testSettingDecimalConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               self::$configInstance->setConfigEntry(12345, 'foo');
-       }
-
-       /**
-        * Tests setting a float key (value doesn't matter)
-        */
-       public function testSettingFloatConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               self::$configInstance->setConfigEntry(123.45, 'foo');
-       }
-
-       /**
-        * Tests setting an array key (value doesn't matter)
-        */
-       public function testSettingArrayConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               self::$configInstance->setConfigEntry(array(), 'foo');
-       }
-
-       /**
-        * Tests setting an object key (value doesn't matter)
-        */
-       public function testSettingObjectConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               self::$configInstance->setConfigEntry($this, 'foo');
-       }
-
-       /**
-        * Tests setting a resource key (value doesn't matter)
-        */
-       public function testSettingResourceConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Init some resource
-               $resource = fopen(__FILE__, 'r');
-
-               // Test it
-               self::$configInstance->setConfigEntry($resource, 'foo');
-       }
-
        /**
         * Tests setting a valid key but array for value
         */
        /**
         * Tests setting a valid key but array for value
         */
@@ -513,86 +273,6 @@ class FrameworkConfigurationTest extends TestCase {
                self::$configInstance->setConfigEntry('foo', $resource);
        }
 
                self::$configInstance->setConfigEntry('foo', $resource);
        }
 
-       /**
-        * Tests unsetting NULL key
-        */
-       public function testUnsettingNullConfigKey () {
-               // Will throw this exception
-               $this->expectException(NullPointerException::class);
-
-               // Test it
-               self::$configInstance->unsetConfigEntry(NULL);
-       }
-
-       /**
-        * Tests unsetting boolean key
-        */
-       public function testUnsettingBooleanConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               self::$configInstance->unsetConfigEntry(FALSE);
-       }
-
-       /**
-        * Tests unsetting decimal key
-        */
-       public function testUnsettingDecimalConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               self::$configInstance->unsetConfigEntry(12345);
-       }
-
-       /**
-        * Tests unsetting float key
-        */
-       public function testUnsettingFloatConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               self::$configInstance->unsetConfigEntry(123.45);
-       }
-
-       /**
-        * Tests unsetting array key
-        */
-       public function testUnsettingArrayConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               self::$configInstance->unsetConfigEntry(array());
-       }
-
-       /**
-        * Tests unsetting object key
-        */
-       public function testUnsettingObjectConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Test it
-               self::$configInstance->unsetConfigEntry($this);
-       }
-
-       /**
-        * Tests unsetting resource key
-        */
-       public function testUnsettingResourceConfigKey () {
-               // Will throw this exception
-               $this->expectException(InvalidArgumentException::class);
-
-               // Init some resource
-               $resource = fopen(__FILE__, 'r');
-
-               // Test it
-               self::$configInstance->unsetConfigEntry($resource);
-       }
-
        /**
         * Tests unsetting an empty key
         */
        /**
         * Tests unsetting an empty key
         */