From 498e6b065ce47804bff4e1073592a2cc8e28f8ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 24 Nov 2020 05:53:21 +0100 Subject: [PATCH] Continued: - old array style mostly converted to new - added more primitive type-hints MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- application/tests/data.php | 2 +- application/tests/exceptions.php | 2 +- application/tests/starter.php | 4 +- .../bootstrap/class_FrameworkBootstrap.php | 2 +- .../config/class_FrameworkConfiguration.php | 2 +- framework/loader/class_ClassLoader.php | 22 +++---- .../classes/class_BaseFrameworkSystem.php | 10 +-- .../classes/client/http/class_HttpClient.php | 2 +- .../controller/class_BaseController.php | 2 +- .../classes/criteria/class_BaseCriteria.php | 62 +++++++++---------- .../criteria/search/class_SearchCriteria.php | 8 +-- .../class_CachedLocalFileDatabase.php | 12 ++-- .../database/class_BaseDatabaseWrapper.php | 10 +-- .../classes/factories/class_BaseFactory.php | 2 +- .../factories/objects/class_ObjectFactory.php | 4 +- .../feature/class_FrameworkFeature.php | 2 +- .../binary/class_BaseBinaryFile.php | 10 +-- .../class_FrameworkDirectoryPointer.php | 2 +- .../io_stream/class_FileIoStream.php | 4 +- .../text/input/csv/class_CsvInputFile.php | 8 +-- .../main/classes/filter/class_FilterChain.php | 4 +- .../handler/tasks/class_TaskHandler.php | 2 +- .../captcha/images/class_ImageHelper.php | 2 +- .../main/classes/helper/class_BaseHelper.php | 4 +- .../main/classes/lists/class_BaseList.php | 16 ++--- .../classes/registry/class_BaseRegistry.php | 2 +- .../classes/request/class_BaseRequest.php | 2 +- .../classes/response/class_BaseResponse.php | 8 +-- .../template/class_BaseTemplateEngine.php | 20 +++--- .../image/class_ImageTemplateEngine.php | 2 +- .../mail/class_MailTemplateEngine.php | 2 +- .../menu/class_MenuTemplateEngine.php | 2 +- .../actions/class_InvalidActionException.php | 10 +-- .../auth/class_UserAuthorizationException.php | 2 +- .../class_Base64EncodingBadException.php | 2 +- .../class_Base64EncodingModuloException.php | 2 +- .../exceptions/class_FrameworkException.php | 15 +++-- .../class_MismatchingCompressorsException.php | 2 +- ...ss_ConfigValueTypeUnsupportedException.php | 2 +- .../config/class_NoConfigEntryException.php | 2 +- ...s_ConnectionAlreadyRegisteredException.php | 2 +- .../class_DefaultControllerException.php | 2 +- .../class_InvalidControllerException.php | 12 ++-- .../class_EncryptInvalidLengthException.php | 2 +- .../crypto/class_EncryptMissingException.php | 2 +- .../database/class_DatabaseException.php | 2 +- .../database/general/class_SqlException.php | 10 +-- .../class_SavePathIsNoDirectoryException.php | 2 +- .../class_SavePathReadProtectedException.php | 2 +- .../class_SavePathWriteProtectedException.php | 2 +- .../dns/class_UnknownHostnameException.php | 8 +-- ...lass_FeatureMethodNotCallableException.php | 2 +- .../class_DirPointerNotOpenedException.php | 2 +- .../file_directory/class_FileIoException.php | 2 +- .../class_FileNotFoundException.php | 2 +- .../class_FileReadProtectedException.php | 2 +- .../class_FileWriteProtectedException.php | 2 +- .../class_InvalidDataLengthException.php | 10 +-- .../class_InvalidMD5ChecksumException.php | 10 +-- .../class_InvalidResourceException.php | 2 +- .../class_PathIsNoDirectoryException.php | 2 +- .../class_PathReadProtectedException.php | 2 +- .../class_PathWriteProtectedException.php | 2 +- .../filter/class_FilterChainException.php | 2 +- .../class_InvalidFilterChainException.php | 2 +- .../helper/class_FormClosedException.php | 2 +- .../helper/class_FormGroupClosedException.php | 2 +- .../helper/class_FormOpenedException.php | 2 +- ...ass_HelperGroupAlreadyCreatedException.php | 8 +-- ...elperNoPreviousOpenedSubGroupException.php | 8 +-- ..._HelperSubGroupAlreadyCreatedException.php | 8 +-- .../helper/class_InvalidFormNameException.php | 2 +- .../helper/class_NoGroupOpenedException.php | 8 +-- .../class_UserInstanceMissingException.php | 2 +- ...ass_InvalidLanguagePathStringException.php | 2 +- ...ass_LanguagePathIsNoDirectoryException.php | 2 +- ...ass_LanguagePathReadProtectedException.php | 2 +- .../main/class_AssertionException.php | 2 +- .../main/class_ClassMismatchException.php | 2 +- .../class_DimNotFoundInArrayException.php | 2 +- .../main/class_FatalErrorException.php | 2 +- .../main/class_IndexOutOfBoundsException.php | 2 +- .../main/class_InvalidArrayCountException.php | 2 +- .../main/class_InvalidCommandException.php | 10 +-- .../main/class_InvalidInterfaceException.php | 2 +- .../main/class_InvalidObjectException.php | 2 +- .../class_MissingArrayElementsException.php | 2 +- .../main/class_NoClassException.php | 10 +-- ...ss_ResponseHeadersAlreadySentException.php | 2 +- .../class_UnsupportedOperationException.php | 2 +- .../main/class_VariableIsNotSetException.php | 2 +- .../class_InvalidDatabaseResultException.php | 8 +-- .../result/class_ResultUpdateException.php | 2 +- .../class_InvalidServerSocketException.php | 2 +- .../socket/class_InvalidSocketException.php | 2 +- .../class_NoSocketErrorDetectedException.php | 2 +- ...class_SocketAlreadyRegisteredException.php | 2 +- .../socket/class_SocketBindingException.php | 2 +- .../class_SocketConnectionException.php | 2 +- .../socket/class_SocketCreationException.php | 2 +- .../socket/class_SocketOperationException.php | 2 +- .../socket/class_SocketOptionException.php | 2 +- ...UnsupportedSocketErrorHandlerException.php | 2 +- ...ass_AlreadyInitializedStackerException.php | 2 +- .../stacker/class_EmptyStackerException.php | 2 +- .../stacker/class_FullStackerException.php | 2 +- .../stacker/class_NoStackerException.php | 2 +- .../class_InvalidStateInstanceException.php | 6 +- .../state/class_UnexpectedStateException.php | 2 +- .../class_UnresolveableStateException.php | 12 ++-- .../class_BasePathReadProtectedException.php | 2 +- .../class_InvalidDirectoryException.php | 2 +- .../template/class_NoVariableException.php | 2 +- .../class_UnexpectedTemplateTypeException.php | 10 +-- ...ass_UnsupportedTemplateEngineException.php | 2 +- ...class_AccountPasswordMismatchException.php | 2 +- .../class_UnexpectedGuestAccountException.php | 8 +-- .../user/class_UserEmailMissingException.php | 8 +-- .../user/class_UserNoGuestException.php | 10 +-- .../class_UserPasswordMismatchException.php | 8 +-- .../user/class_UsernameMissingException.php | 8 +-- .../xml/class_InvalidXmlNodeException.php | 2 +- .../xml/class_XmlNodeMismatchException.php | 2 +- .../xml/class_XmlParserException.php | 2 +- .../interfaces/criteria/class_Criteria.php | 45 ++++++-------- .../database/class_DatabaseWrapper.php | 4 +- .../io/directory/class_FrameworkDirectory.php | 2 +- 127 files changed, 313 insertions(+), 321 deletions(-) diff --git a/application/tests/data.php b/application/tests/data.php index 97b049d6..c8eb63d1 100644 --- a/application/tests/data.php +++ b/application/tests/data.php @@ -31,7 +31,7 @@ $cfg = FrameworkConfiguration::getSelfInstance(); // Get an instance of the helper $app = call_user_func_array( array($cfg->getConfigEntry('app_helper_class'), 'getSelfInstance'), - array() + [] ); // Set application name and version diff --git a/application/tests/exceptions.php b/application/tests/exceptions.php index a140c83b..66121d2b 100644 --- a/application/tests/exceptions.php +++ b/application/tests/exceptions.php @@ -117,7 +117,7 @@ function tests_error_handler ($errno, $errstr, $errfile, $errline, array $errcon } // END - function // Assertion handler -function tests_assert_handler ($file, $line, $code) { +function tests_assert_handler (string $file, int $line, $code) { // Empty code? if ($code === '') { $code = 'Unknown'; diff --git a/application/tests/starter.php b/application/tests/starter.php index a588ec9c..ed047ad0 100644 --- a/application/tests/starter.php +++ b/application/tests/starter.php @@ -27,7 +27,7 @@ $app = call_user_func_array( array( FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_helper_class'), 'getSelfInstance' - ), array() + ), [] ); // Some sanity checks @@ -51,4 +51,4 @@ if ((empty($app)) || (is_null($app))) { } // Call user function -call_user_func_array(array($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method')), array()); +call_user_func_array(array($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method')), []); diff --git a/framework/bootstrap/class_FrameworkBootstrap.php b/framework/bootstrap/class_FrameworkBootstrap.php index ad1bf8a2..0e0cdb6a 100644 --- a/framework/bootstrap/class_FrameworkBootstrap.php +++ b/framework/bootstrap/class_FrameworkBootstrap.php @@ -347,7 +347,7 @@ final class FrameworkBootstrap { $applicationInstance = call_user_func_array( array( 'Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper', 'getSelfInstance' - ), array() + ), [] ); // Some sanity checks diff --git a/framework/config/class_FrameworkConfiguration.php b/framework/config/class_FrameworkConfiguration.php index 29fdabea..6e969ccb 100644 --- a/framework/config/class_FrameworkConfiguration.php +++ b/framework/config/class_FrameworkConfiguration.php @@ -47,7 +47,7 @@ class FrameworkConfiguration implements Registerable { * hard-coded configuration data and might be overwritten/extended by * config data from the database. */ - private static $config = array(); + private static $config = []; /** * Call-back instance (unused) diff --git a/framework/loader/class_ClassLoader.php b/framework/loader/class_ClassLoader.php index e0342963..9e0e4bac 100644 --- a/framework/loader/class_ClassLoader.php +++ b/framework/loader/class_ClassLoader.php @@ -62,12 +62,12 @@ class ClassLoader { /** * Array with all found classes */ - private $foundClasses = array(); + private $foundClasses = []; /** * List of loaded classes */ - private $loadedClasses = array(); + private $loadedClasses = []; /** * Suffix with extension for all class files @@ -83,7 +83,7 @@ class ClassLoader { * A list for directory names (no leading/trailing slashes!) which not be scanned by the path scanner * @see scanLocalPath */ - private $ignoreList = array(); + private $ignoreList = []; /** * Debug this class loader? (true = yes, false = no) @@ -134,7 +134,7 @@ class ClassLoader { * Registered paths where test classes can be found. These are all relative * to base_path . */ - private static $testPaths = array(); + private static $testPaths = []; /** * The protected constructor. Please use the factory method below, or use @@ -351,7 +351,7 @@ class ClassLoader { * @param $strictNamingConvention Whether to strictly check naming-convention * @return void */ - public static function enableStrictNamingConventionCheck ($strictNamingConvention = true) { + public static function enableStrictNamingConventionCheck (bool $strictNamingConvention = true) { self::$strictNamingConvention = $strictNamingConvention; } @@ -362,7 +362,7 @@ class ClassLoader { * @param $relativePath Relative path to test classes * @return void */ - public static function registerTestsPath ($relativePath) { + public static function registerTestsPath (string $relativePath) { // Trace message //* NOISY-DEBUG: */ printf('[%s:%d]: relativePath=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $relativePath); @@ -379,7 +379,7 @@ class ClassLoader { * @param $className Name of the class to load * @return void */ - public static function autoLoad ($className) { + public static function autoLoad (string $className) { // Trace message //* NOISY-DEBUG: */ printf('[%s:%d]: className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className); @@ -413,7 +413,7 @@ class ClassLoader { * @param $ignoreList An optional list (array forced) of directory and file names which shall be ignored * @return void */ - public function scanClassPath ($basePath, array $ignoreList = array() ) { + public function scanClassPath (string $basePath, array $ignoreList = [] ) { // Is a list has been restored from cache, don't read it again if ($this->listCached === true) { // Abort here @@ -565,11 +565,9 @@ class ClassLoader { * @return void * @throws InvalidArgumentException If strict-checking is enabled and class name is not following naming-convention */ - private function loadClassFile ($className) { - // Trace message - //* NOISY-DEBUG: */ printf('[%s:%d] className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className); - + private function loadClassFile (string $className) { // The class name should contain at least 2 back-slashes, so split at them + //* NOISY-DEBUG: */ printf('[%s:%d] className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className); $classNameParts = explode("\\", $className); // At least 3 parts should be there diff --git a/framework/main/classes/class_BaseFrameworkSystem.php b/framework/main/classes/class_BaseFrameworkSystem.php index 00dd1f3b..d1f88883 100644 --- a/framework/main/classes/class_BaseFrameworkSystem.php +++ b/framework/main/classes/class_BaseFrameworkSystem.php @@ -133,7 +133,7 @@ abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterfac /** * Generic array */ - private $genericArray = array(); + private $genericArray = []; /*********************** * Exception codes.... * @@ -1249,7 +1249,7 @@ Loaded includes: * @param $onlyKeys Only use these keys for a cache key * @return $cacheKey A cache key suitable for lookup/storage purposes */ - protected function getCacheKeyByCriteria (Criteria $criteriaInstance, array $onlyKeys = array()) { + protected function getCacheKeyByCriteria (Criteria $criteriaInstance, array $onlyKeys = []) { // Generate it //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRAMEWORK-SYSTEM: criteriaInstance=' . $criteriaInstance->__toString() . ',onlyKeys()=' . count($onlyKeys) . ' - CALLED!'); $cacheKey = sprintf('%s@%s', @@ -1566,7 +1566,7 @@ Loaded includes: } // Initialize it - $this->genericArray[$keyGroup][$subGroup] = array(); + $this->genericArray[$keyGroup][$subGroup] = []; } /** @@ -1590,7 +1590,7 @@ Loaded includes: } // Initialize it - $this->genericArray[$keyGroup][$subGroup][$key] = array(); + $this->genericArray[$keyGroup][$subGroup][$key] = []; } /** @@ -1615,7 +1615,7 @@ Loaded includes: } // Initialize it - $this->genericArray[$keyGroup][$subGroup][$key][$element] = array(); + $this->genericArray[$keyGroup][$subGroup][$key][$element] = []; } /** diff --git a/framework/main/classes/client/http/class_HttpClient.php b/framework/main/classes/client/http/class_HttpClient.php index a1b26093..eecb8955 100644 --- a/framework/main/classes/client/http/class_HttpClient.php +++ b/framework/main/classes/client/http/class_HttpClient.php @@ -112,7 +112,7 @@ class HttpClient extends BaseClient implements Client { * @param $port Port number to connect to * @return $responseArray Array with raw response */ - private function sendRawHttpRequest ($method, $host, $port, array $header = array()) { + private function sendRawHttpRequest ($method, $host, $port, array $header = []) { // Minimum raw HTTP/1.1 request $rawRequest = $method . ' ' . $host . ':' . $port . ' HTTP/1.1' . self::HTTP_EOL; $rawRequest .= 'Host: ' . $host . ':' . $port . self::HTTP_EOL; diff --git a/framework/main/classes/controller/class_BaseController.php b/framework/main/classes/controller/class_BaseController.php index ad8ab512..dc5fe704 100644 --- a/framework/main/classes/controller/class_BaseController.php +++ b/framework/main/classes/controller/class_BaseController.php @@ -53,7 +53,7 @@ abstract class BaseController extends BaseFrameworkSystem implements Registerabl /** * Generic filter chains */ - private $filterChains = array(); + private $filterChains = []; /** * Protected constructor diff --git a/framework/main/classes/criteria/class_BaseCriteria.php b/framework/main/classes/criteria/class_BaseCriteria.php index 1073cbc4..c7aff1ed 100644 --- a/framework/main/classes/criteria/class_BaseCriteria.php +++ b/framework/main/classes/criteria/class_BaseCriteria.php @@ -53,6 +53,18 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { } // END - foreach } + /** + * Count the criteria, e.g. useful to find out if a database query has no + * limitation (search criteria). + * + * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' + * @return $count Count of all criteria entries + */ + protected final function count (string $criteriaType = 'default') { + // Return it + return $this->countGenericArrayGroup('criteria', $criteriaType); + } + /** * Checks whether given key is set * @@ -60,7 +72,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaKey Criteria key * @return $isSet Whether key is set */ - public function isKeySet ($criteriaType, $criteriaKey) { + public function isKeySet (string $criteriaType, string $criteriaKey) { // Make sure no 'my-' or 'my_' passes this point assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false)); @@ -77,7 +89,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaKey Criteria key * @return $isSet Whether key is set */ - public function isChoiceKeySet ($criteriaKey) { + public function isChoiceKeySet (string $criteriaKey) { // Call inner method return $this->isKeySet('choice', $criteriaKey); } @@ -88,7 +100,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaKey Criteria key * @return $isSet Whether key is set */ - public function isExcludeKeySet ($criteriaKey) { + public function isExcludeKeySet (string $criteriaKey) { // Call inner method return $this->isKeySet('exclude', $criteriaKey); } @@ -99,8 +111,8 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $wrapperConfigEntry Configuration entry which hold the wrapper class' name * @return void */ - public final function setWrapperConfigEntry ($wrapperConfigEntry) { - $this->wrapperConfigEntry = (string) $wrapperConfigEntry; + public final function setWrapperConfigEntry (string $wrapperConfigEntry) { + $this->wrapperConfigEntry = $wrapperConfigEntry; } /** @@ -118,7 +130,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $criteria */ - public final function getCriteriaArray ($criteriaType = 'default') { + public final function getCriteriaArray (string $criteriaType = 'default') { return $this->getGenericArrayKey('criteria', $criteriaType, 'entries'); } @@ -146,7 +158,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaKey Criteria key to unset * @return void */ - public final function unsetCriteria ($criteriaKey) { + public final function unsetCriteria (string $criteriaKey) { // Make sure no 'my-' or 'my_' passes this point assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false)); @@ -169,7 +181,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return void */ - public final function addCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default') { + public final function addCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = 'default') { // Debug message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue . ',criteriaType=' . $criteriaType . ' - CALLED!'); @@ -195,7 +207,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return void */ - public final function setCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default') { + public final function setCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = 'default') { // Debug message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue . ',criteriaType=' . $criteriaType . ' - CALLED!'); @@ -220,7 +232,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaValue Criteria value * @return void */ - public final function addChoiceCriteria ($criteriaKey, $criteriaValue) { + public final function addChoiceCriteria (string $criteriaKey, $criteriaValue) { // Make sure no 'my-' or 'my_' passes this point assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue))); @@ -239,7 +251,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaValue Criteria value * @return void */ - public final function addExcludeCriteria ($criteriaKey, $criteriaValue) { + public final function addExcludeCriteria (string $criteriaKey, $criteriaValue) { // Add it with generic method $this->addCriteria($criteriaKey, $criteriaValue, 'exclude'); } @@ -252,7 +264,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return void */ - public final function addConfiguredCriteria ($criteriaKey, $configEntry, $criteriaType = 'default') { + public final function addConfiguredCriteria ($criteriaKey, $configEntry, string $criteriaType = 'default') { // Add the configuration entry as a criteria $value = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry); $this->addCriteria($criteriaKey, $value, $criteriaType); @@ -265,7 +277,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $value Whether the value of the critera or false */ - public function getCriteriaElemnent ($criteriaKey, $criteriaType = 'default') { + public function getCriteriaElemnent ($criteriaKey, string $criteriaType = 'default') { // Debug message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA: criteriaKey=' . $criteriaKey . ',criteriaType=' . $criteriaType . ' - CALLED!'); @@ -300,7 +312,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaKey The requested criteria key * @return $value Whether the value of the critera or false */ - public function getCriteriaChoiceElemnent ($criteriaKey) { + public function getCriteriaChoiceElemnent (string $criteriaKey) { // Call inner method return $this->getCriteriaElemnent($criteriaKey, 'choice'); } @@ -311,7 +323,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaKey The requested criteria key * @return $value Whether the value of the critera or false */ - public function getCriteriaExcludeElemnent ($criteriaKey) { + public function getCriteriaExcludeElemnent (string $criteriaKey) { // Call inner method return $this->getCriteriaElemnent($criteriaKey, 'exclude'); } @@ -323,7 +335,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $matches Whether the entry matches or not */ - public function ifEntryMatches (array $entryArray, $criteriaType = 'default') { + public function ifEntryMatches (array $entryArray, string $criteriaType = 'default') { // First nothing matches and nothing is counted $matches = false; $counted = 0; @@ -388,7 +400,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $cacheKey The key suitable for the cache system */ - public function getCacheKey ($onlyKeys = array(), $criteriaType = 'default') { + public function getCacheKey (array $onlyKeys = [], string $criteriaType = 'default') { // Debug message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($this->__toString() . ': criteriaType=' . $criteriaType . ',count()=' . $this->countGenericArray('criteria'))); @@ -444,7 +456,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $onlyKeys Only use these keys for a cache key * @return $cacheKey The key suitable for the cache system */ - public function getCacheKeyChoice ($onlyKeys = array()) { + public function getCacheKeyChoice (array $onlyKeys = []) { // Call inner method return $this->getCacheKey($onlyKeys, 'choice'); } @@ -455,23 +467,11 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @param $onlyKeys Only use these keys for a cache key * @return $cacheKey The key suitable for the cache system */ - public function getCacheKeyExclude ($onlyKeys = array()) { + public function getCacheKeyExclude (array $onlyKeys = []) { // Call inner method return $this->getCacheKey($onlyKeys, 'exclude'); } - /** - * Count the criteria, e.g. useful to find out if a database query has no - * limitation (search criteria). - * - * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' - * @return $count Count of all criteria entries - */ - public final function count ($criteriaType = 'default') { - // Return it - return $this->countGenericArrayGroup('criteria', $criteriaType); - } - /** * Count 'choice' criteria, e.g. useful to find out if a database query * has no limitation (search criteria). diff --git a/framework/main/classes/criteria/search/class_SearchCriteria.php b/framework/main/classes/criteria/search/class_SearchCriteria.php index 6f9f2aa5..d689be2e 100644 --- a/framework/main/classes/criteria/search/class_SearchCriteria.php +++ b/framework/main/classes/criteria/search/class_SearchCriteria.php @@ -35,7 +35,7 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria { /** * Criteria to handle */ - private $criteria = array(); + private $criteria = []; /** * Limitation for the search @@ -164,14 +164,14 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria { // 'choice' check if ((is_array($searchChoice)) && (count($valueArray) == 1)) { - // $value is a single-search value, so use in_array() + // $value is a single-search value, so use in_[] $isMatching = ((($isMatching === true) || (($searchDefault === false) && (!is_null($value)))) && (in_array($value, $searchChoice))); // Debug message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - SINGLE-MATCH'); } elseif ((is_array($searchChoice)) && (count($valueArray) > 1)) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',valueArray()=' . count($valueArray) . ',isMatching=' . intval($isMatching)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[]=' . count($valueArray) . ',isMatching=' . intval($isMatching)); // $value is choice-search value, so check all entries $isMatching = (($isMatching === true) || (($searchDefault === false) && (!is_null($value)))); @@ -188,7 +188,7 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria { } // END - foreach // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',valueArray()=' . count($valueArray) . ',idx=' . $idx . ',isMatching=' . intval($isMatching) . ' - CHOICE-MATCH'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[]=' . count($valueArray) . ',idx=' . $idx . ',isMatching=' . intval($isMatching) . ' - CHOICE-MATCH'); } else { // Choice-match is false // Debug message diff --git a/framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php b/framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php index 1171aab9..d79963d7 100644 --- a/framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php +++ b/framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php @@ -60,7 +60,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac /** * The last read file's content including header information */ - private $lastContents = array(); + private $lastContents = []; /** * Whether the "connection is already up @@ -70,7 +70,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac /** * Table information array */ - private $tableInfo = array(); + private $tableInfo = []; /** * Element for index @@ -275,7 +275,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac */ private function getContentsFromTableInfoFile (StoreableCriteria $dataSetInstance) { // Default content is no data - $infoArray = array(); + $infoArray = []; // Create FQFN for getting the table information file $infoInstance = $this->generateFileFromDataSet($dataSetInstance, 'info'); @@ -422,7 +422,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac // Initialize the result data, this need to be rewritten e.g. if a local file cannot be read $resultData = array( BaseDatabaseBackend::RESULT_INDEX_STATUS => self::RESULT_OKAY, - BaseDatabaseBackend::RESULT_INDEX_ROWS => array() + BaseDatabaseBackend::RESULT_INDEX_ROWS => [] ); // Initialize limit/skip @@ -451,7 +451,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac $isFound = true; // Search in the criteria with FMFW (First Matches, First Wins) - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: dataArray()=%d', count($dataArray))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: data[]=%d', count($dataArray))); foreach ($dataArray as $key => $value) { // Make sure value is not bool assert(!is_bool($value)); @@ -641,7 +641,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac } // END - foreach // Write the data to a local file - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: Writing dataArray()=' . count($dataArray) . ' to ' . $fileInfoInstance->getPathname() . ' ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: Writing data[]=' . count($dataArray) . ' to ' . $fileInfoInstance->getPathname() . ' ...'); $this->writeDataArrayToFqfn($fileInfoInstance, $dataArray); // Count found entries up diff --git a/framework/main/classes/database/class_BaseDatabaseWrapper.php b/framework/main/classes/database/class_BaseDatabaseWrapper.php index 31f79142..13bf4e2e 100644 --- a/framework/main/classes/database/class_BaseDatabaseWrapper.php +++ b/framework/main/classes/database/class_BaseDatabaseWrapper.php @@ -95,7 +95,7 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem { * @param $onlyKeys Only use these keys for a cache key * @return void */ - protected function queryInsertDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = array()) { + protected function queryInsertDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = []) { // Default cache key is NULL //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: dataSetInstance=%s,onlyKeys()=%d - CALLED!', $dataSetInstance->__toString(), count($onlyKeys))); $cacheKey = NULL; @@ -129,7 +129,7 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem { * @param $onlyKeys Only use these keys for a cache key * @return void */ - protected function queryUpdateDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = array()) { + protected function queryUpdateDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = []) { // Init cache key $cacheKey = NULL; @@ -176,11 +176,11 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem { * @param $onlyKeys Only use these keys for a cache key * @return $resultInstance An instance of a database result class */ - public function doSelectByCriteria (Criteria $criteriaInstance, array $onlyKeys = array()) { + public function doSelectByCriteria (Criteria $criteriaInstance, array $onlyKeys = []) { // Default cache key if cache is not enabled //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: criteriaInstance=%s,onlyKeys()=%d - CALLED!', $criteriaInstance->__toString(), count($onlyKeys))); $cacheKey = NULL; - $result = array(); + $result = []; // Is the cache enabled? if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) { @@ -234,7 +234,7 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem { * @param $onlyKeys Only use these keys for a cache key * @return $numRows Numbers of rows of database entries */ - public function doSelectCountByCriteria (Criteria $criteriaInstance, $onlyKeys = array()) { + public function doSelectCountByCriteria (Criteria $criteriaInstance, array $onlyKeys = []) { // Total numbers is -1 so we can distinglish between failed and valid queries $numRows = 0; diff --git a/framework/main/classes/factories/class_BaseFactory.php b/framework/main/classes/factories/class_BaseFactory.php index 33622e1a..1eea9ce9 100644 --- a/framework/main/classes/factories/class_BaseFactory.php +++ b/framework/main/classes/factories/class_BaseFactory.php @@ -36,7 +36,7 @@ abstract class BaseFactory extends BaseFrameworkSystem { /** * Counter of all objects */ - private static $objectCounters = array(); + private static $objectCounters = []; /** * Protected constructor diff --git a/framework/main/classes/factories/objects/class_ObjectFactory.php b/framework/main/classes/factories/objects/class_ObjectFactory.php index e453d9e8..b10907b5 100644 --- a/framework/main/classes/factories/objects/class_ObjectFactory.php +++ b/framework/main/classes/factories/objects/class_ObjectFactory.php @@ -54,7 +54,7 @@ class ObjectFactory extends BaseFactory { * @throws NoClassException If the requested class was not found * @throws InvalidArgumentException If className is empty or the name not following naming-convention */ - public static final function createObjectByName ($fullClassName, array $args = array()) { + public static final function createObjectByName ($fullClassName, array $args = []) { // Is the class name valid and is the class there? if (empty($fullClassName)) { // Throw an exception here @@ -96,7 +96,7 @@ class ObjectFactory extends BaseFactory { * @param $args Arguments in an indexed array * @return $objectInstance An instance of the requested object */ - public static final function createObjectByConfiguredName ($configEntry, array $args = array()) { + public static final function createObjectByConfiguredName ($configEntry, array $args = []) { // Read the configuration entry $fullClassName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry); diff --git a/framework/main/classes/feature/class_FrameworkFeature.php b/framework/main/classes/feature/class_FrameworkFeature.php index f5d87d95..27227aa1 100644 --- a/framework/main/classes/feature/class_FrameworkFeature.php +++ b/framework/main/classes/feature/class_FrameworkFeature.php @@ -55,7 +55,7 @@ class FrameworkFeature extends BaseFrameworkSystem { * 'instance' => NULL * ) */ - private static $enabledFeatures = array(); + private static $enabledFeatures = []; /** * Protected constructor diff --git a/framework/main/classes/file_directories/binary/class_BaseBinaryFile.php b/framework/main/classes/file_directories/binary/class_BaseBinaryFile.php index c2ac5ddf..1c4dcff6 100644 --- a/framework/main/classes/file_directories/binary/class_BaseBinaryFile.php +++ b/framework/main/classes/file_directories/binary/class_BaseBinaryFile.php @@ -110,17 +110,17 @@ abstract class BaseBinaryFile extends BaseAbstractFile { /** * File header */ - private $header = array(); + private $header = []; /** * Seek positions for gaps ("fragmentation") */ - private $gaps = array(); + private $gaps = []; /** * Seek positions for damaged entries (e.g. mismatching hash sum, ...) */ - private $damagedEntries = array(); + private $damagedEntries = []; /** * Back-buffer @@ -216,8 +216,8 @@ abstract class BaseBinaryFile extends BaseAbstractFile { $this->setSeekPosition(0); // Init arrays - $this->gaps = array(); - $this->damagedEntries = array(); + $this->gaps = []; + $this->damagedEntries = []; } /** diff --git a/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php b/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php index 23d3b6a9..52a197b1 100644 --- a/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php +++ b/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php @@ -137,7 +137,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework * @param $except Some parts of a directory we want to ignore. Valid: directory and file names, other values will be silently ignored * @return SplFileInfo An instance of a SplFileInfo class */ - public function readDirectoryExcept (array $except = array()) { + public function readDirectoryExcept (array $except = []) { // No exceptions given? //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DIRECTORY-POINTER: except()=%d - CALLED!', count($except))); if (count($except) == 0) { diff --git a/framework/main/classes/file_directories/io_stream/class_FileIoStream.php b/framework/main/classes/file_directories/io_stream/class_FileIoStream.php index d3fc82d2..854f858f 100644 --- a/framework/main/classes/file_directories/io_stream/class_FileIoStream.php +++ b/framework/main/classes/file_directories/io_stream/class_FileIoStream.php @@ -153,8 +153,8 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil // Initialize some variables and arrays $inputBuffer = ''; $lastBuffer = ''; - $header = array(); - $data = array(); + $header = []; + $data = []; $readData = ''; // This will contain our read data // Get a file input handler diff --git a/framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php b/framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php index e18ecada..cd8745f6 100644 --- a/framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php +++ b/framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php @@ -99,7 +99,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer { //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] data()=%d,columnSeparator=%s - CALLED!', __METHOD__, __LINE__, strlen($data), $columnSeparator)); // Init return array - $lineArray = array(); + $lineArray = []; // Whether the parser reads a quoted string (which may contain the column separator again) $isInQuotes = false; @@ -124,7 +124,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer { array_push($lineArray, $column); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - After add!', __METHOD__, __LINE__, count($lineArray))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] line[]=%d - After add!', __METHOD__, __LINE__, count($lineArray))); // Clear variable ... $column = ''; @@ -164,11 +164,11 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer { array_push($lineArray, $column); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - After add!', __METHOD__, __LINE__, count($lineArray))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] line[]=%d - After add!', __METHOD__, __LINE__, count($lineArray))); } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] lineArray()=%d - EXIT!', __METHOD__, __LINE__, count($lineArray))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] line[]=%d - EXIT!', __METHOD__, __LINE__, count($lineArray))); // Return it return $lineArray; diff --git a/framework/main/classes/filter/class_FilterChain.php b/framework/main/classes/filter/class_FilterChain.php index 2d3f0a60..177a2f1e 100644 --- a/framework/main/classes/filter/class_FilterChain.php +++ b/framework/main/classes/filter/class_FilterChain.php @@ -83,7 +83,7 @@ class FilterChain extends BaseFrameworkSystem implements Registerable { */ protected function getFilters () { // Default is nothing found - $filters = array(); + $filters = []; // Are some filters set? if ($this->isValidGenericArrayKey('filters', 'generic', 'dummy')) { @@ -102,7 +102,7 @@ class FilterChain extends BaseFrameworkSystem implements Registerable { */ protected function getPostFilters () { // Default is nothing found - $filters = array(); + $filters = []; // Are some filters set? if ($this->isValidGenericArrayKey('filters', 'post', 'dummy')) { diff --git a/framework/main/classes/handler/tasks/class_TaskHandler.php b/framework/main/classes/handler/tasks/class_TaskHandler.php index dfdff9a2..4c3eaaad 100644 --- a/framework/main/classes/handler/tasks/class_TaskHandler.php +++ b/framework/main/classes/handler/tasks/class_TaskHandler.php @@ -371,7 +371,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Shutting down all ' . $this->getListInstance()->count() . ' tasks...'); // Remember all tasks that has been shutdown for removal - $tasks = array(); + $tasks = []; // Instance a visitor $this->setVisitorInstance(ObjectFactory::createObjectByConfiguredName('shutdown_task_visitor_class')); diff --git a/framework/main/classes/helper/captcha/images/class_ImageHelper.php b/framework/main/classes/helper/captcha/images/class_ImageHelper.php index 3f22164c..1353efc2 100644 --- a/framework/main/classes/helper/captcha/images/class_ImageHelper.php +++ b/framework/main/classes/helper/captcha/images/class_ImageHelper.php @@ -71,7 +71,7 @@ class ImageHelper extends BaseCaptcha implements HelpableTemplate { /** * All image strings */ - private $imageStrings = array(); + private $imageStrings = []; /** * Current string name diff --git a/framework/main/classes/helper/class_BaseHelper.php b/framework/main/classes/helper/class_BaseHelper.php index 494e3cbd..d594489e 100644 --- a/framework/main/classes/helper/class_BaseHelper.php +++ b/framework/main/classes/helper/class_BaseHelper.php @@ -51,12 +51,12 @@ abstract class BaseHelper extends BaseFrameworkSystem { /** * Array with groups */ - private $groups = array(); + private $groups = []; /** * Array with sub group */ - private $subGroups = array(); + private $subGroups = []; /** * Previously opened group diff --git a/framework/main/classes/lists/class_BaseList.php b/framework/main/classes/lists/class_BaseList.php index 9f3c260c..08d60de8 100644 --- a/framework/main/classes/lists/class_BaseList.php +++ b/framework/main/classes/lists/class_BaseList.php @@ -43,17 +43,17 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate /** * List groups array */ - private $listGroups = array(); + private $listGroups = []; /** * List entries array */ - private $listEntries = array(); + private $listEntries = []; /** * List index array */ - private $listIndex = array(); + private $listIndex = []; /** * Protected constructor @@ -178,7 +178,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate } // END - if // Init array - $array = array(); + $array = []; // Is there another list? if (!is_null($list)) { @@ -200,7 +200,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate } // END - foreach // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LIST: this=' . $this->__toString() . ',list[' . gettype($list) . ']=' . $list . ',array()=' . count($array) . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LIST: this=' . $this->__toString() . ',list[' . gettype($list) . ']=' . $list . ',[]=' . count($array) . ' - EXIT!'); // Return it return $array; @@ -356,8 +356,8 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate $this->listGroups[$groupName]->clearList(); // Clear this list - $this->listIndex = array(); - $this->listEntries = array(); + $this->listIndex = []; + $this->listEntries = []; } /** @@ -436,7 +436,7 @@ abstract class BaseList extends BaseFrameworkSystem implements IteratorAggregate } // END - if // Init the entries' array - $entries = array(); + $entries = []; // Get an iterator $iteratorInstance = $this->listGroups[$groupName]->getIterator(); diff --git a/framework/main/classes/registry/class_BaseRegistry.php b/framework/main/classes/registry/class_BaseRegistry.php index 44a99f7c..4613bc1c 100644 --- a/framework/main/classes/registry/class_BaseRegistry.php +++ b/framework/main/classes/registry/class_BaseRegistry.php @@ -177,7 +177,7 @@ abstract class BaseRegistry extends BaseFrameworkSystem implements Register, Reg assert(!is_array($arrayKey)); // Init array - $entry = array(); + $entry = []; // Debug message //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY: Checking arrayKey=' . $arrayKey . ',lookFor=' . $lookFor); diff --git a/framework/main/classes/request/class_BaseRequest.php b/framework/main/classes/request/class_BaseRequest.php index 640afef1..c501680a 100644 --- a/framework/main/classes/request/class_BaseRequest.php +++ b/framework/main/classes/request/class_BaseRequest.php @@ -31,7 +31,7 @@ abstract class BaseRequest extends BaseFrameworkSystem { /** * Array for the request data */ - private $requestData = array(); + private $requestData = []; /** * Whether this request is valid and can be further processed. The default is diff --git a/framework/main/classes/response/class_BaseResponse.php b/framework/main/classes/response/class_BaseResponse.php index 3cc1807d..7d223365 100644 --- a/framework/main/classes/response/class_BaseResponse.php +++ b/framework/main/classes/response/class_BaseResponse.php @@ -41,12 +41,12 @@ abstract class BaseResponse extends BaseFrameworkSystem { /** * Array with all headers */ - private $responseHeaders = array(); + private $responseHeaders = []; /** * Cookies we shall sent out */ - private $cookies = array(); + private $cookies = []; /** * Body of the response @@ -96,7 +96,7 @@ abstract class BaseResponse extends BaseFrameworkSystem { * @return void */ public final function resetResponseHeaders () { - $this->responseHeaders = array(); + $this->responseHeaders = []; } /** @@ -208,7 +208,7 @@ abstract class BaseResponse extends BaseFrameworkSystem { header('Set-Cookie: ' . $cookieString); // Remove them all - $this->cookies = array(); + $this->cookies = []; } // END - if } diff --git a/framework/main/classes/template/class_BaseTemplateEngine.php b/framework/main/classes/template/class_BaseTemplateEngine.php index e9967765..05f39746 100644 --- a/framework/main/classes/template/class_BaseTemplateEngine.php +++ b/framework/main/classes/template/class_BaseTemplateEngine.php @@ -104,17 +104,17 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem { /** * The variable stack for the templates */ - private $varStack = array(); + private $varStack = []; /** * Loaded templates for recursive protection and detection */ - private $loadedTemplates = array(); + private $loadedTemplates = []; /** * Compiled templates for recursive protection and detection */ - private $compiledTemplates = array(); + private $compiledTemplates = []; /** * Loaded raw template data @@ -146,7 +146,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem { /** * Loaded helpers */ - private $helpers = array(); + private $helpers = []; /** * Current variable group @@ -156,7 +156,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem { /** * All template groups except "general" */ - private $variableGroups = array(); + private $variableGroups = []; /** * Code begin @@ -332,7 +332,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem { */ private function readCurrentGroup () { // Default is not found - $result = array(); + $result = []; // Is the group there? if ($this->isVarStackSet($this->currGroup)) { @@ -458,7 +458,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem { // Is the stack there? if (!isset($this->varStack[$variableGroup])) { // Then initialize it here - $this->varStack[$variableGroup] = array(); + $this->varStack[$variableGroup] = []; } // Not found, add it @@ -830,8 +830,8 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem { // Initialize some arrays if (is_null($this->loadedRawData)) { // Initialize both - $this->loadedRawData = array(); - $this->rawTemplates = array(); + $this->loadedRawData = []; + $this->rawTemplates = []; } // Load all requested templates @@ -1314,7 +1314,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem { public final function compileVariables () { // Initialize the $content array $validVar = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('tpl_valid_var'); - $dummy = array(); + $dummy = []; // Iterate through all general variables foreach ($this->getVarStack('general') as $currVariable) { diff --git a/framework/main/classes/template/image/class_ImageTemplateEngine.php b/framework/main/classes/template/image/class_ImageTemplateEngine.php index 96e8a093..d01ec650 100644 --- a/framework/main/classes/template/image/class_ImageTemplateEngine.php +++ b/framework/main/classes/template/image/class_ImageTemplateEngine.php @@ -248,7 +248,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl $methodName = sprintf('finish%s', StringUtils::convertToClassName($nodeName)); // Call the corresponding method - call_user_func_array(array($this->getImageInstance(), $methodName), array()); + call_user_func_array(array($this->getImageInstance(), $methodName), []); } /** diff --git a/framework/main/classes/template/mail/class_MailTemplateEngine.php b/framework/main/classes/template/mail/class_MailTemplateEngine.php index 22d06a0e..24261f74 100644 --- a/framework/main/classes/template/mail/class_MailTemplateEngine.php +++ b/framework/main/classes/template/mail/class_MailTemplateEngine.php @@ -219,7 +219,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla $methodName = 'finish' . StringUtils::convertToClassName($nodeName); // Call the corresponding method - call_user_func_array(array($this, $methodName), array()); + call_user_func_array(array($this, $methodName), []); } /** diff --git a/framework/main/classes/template/menu/class_MenuTemplateEngine.php b/framework/main/classes/template/menu/class_MenuTemplateEngine.php index a0f8af2c..77741274 100644 --- a/framework/main/classes/template/menu/class_MenuTemplateEngine.php +++ b/framework/main/classes/template/menu/class_MenuTemplateEngine.php @@ -355,7 +355,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla // Call the corresponding method //* DEBUG: */ echo "call: ".$methodName."
\n"; - call_user_func_array(array($this, $methodName), array()); + call_user_func_array(array($this, $methodName), []); } /** diff --git a/framework/main/exceptions/actions/class_InvalidActionException.php b/framework/main/exceptions/actions/class_InvalidActionException.php index 25f6793c..cb05d38e 100644 --- a/framework/main/exceptions/actions/class_InvalidActionException.php +++ b/framework/main/exceptions/actions/class_InvalidActionException.php @@ -31,17 +31,17 @@ class InvalidActionException extends FrameworkException { /** * The super constructor for all exceptions * - * @param $msgArray An array with message parts + * @param $messageArray An array with message parts * @param $code An optional code for better debugging * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Prepare the message $message = sprintf('[%s:%d] Cannot resolve action %s (%s).', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1], - $msgArray[0]->getClassName() + $messageArray[1], + $messageArray[0]->getClassName() ); // Call parent contructor with message diff --git a/framework/main/exceptions/auth/class_UserAuthorizationException.php b/framework/main/exceptions/auth/class_UserAuthorizationException.php index 0c103663..c2a0b2f0 100644 --- a/framework/main/exceptions/auth/class_UserAuthorizationException.php +++ b/framework/main/exceptions/auth/class_UserAuthorizationException.php @@ -36,7 +36,7 @@ class UserAuthorizationException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (Filterable $filterInstance, $code) { + public function __construct (Filterable $filterInstance, int $code) { // Construct the message $message = sprintf('[%s:%d] Authorization has failed. Error code %s', $filterInstance->__toString(), diff --git a/framework/main/exceptions/base64/class_Base64EncodingBadException.php b/framework/main/exceptions/base64/class_Base64EncodingBadException.php index 3669019e..9e7462a7 100644 --- a/framework/main/exceptions/base64/class_Base64EncodingBadException.php +++ b/framework/main/exceptions/base64/class_Base64EncodingBadException.php @@ -37,7 +37,7 @@ class Base64EncodingBadException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $messageArray, $code) { + public function __construct (array $messageArray, int $code) { // Construct message $message = sprintf('[%s:%d] Raw data %s contains invalid characters for BASE64-encoding.', $messageArray[0]->__toString(), diff --git a/framework/main/exceptions/base64/class_Base64EncodingModuloException.php b/framework/main/exceptions/base64/class_Base64EncodingModuloException.php index 9f0750e5..64bb8d9d 100644 --- a/framework/main/exceptions/base64/class_Base64EncodingModuloException.php +++ b/framework/main/exceptions/base64/class_Base64EncodingModuloException.php @@ -36,7 +36,7 @@ class Base64EncodingModuloException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $messageArray, $code) { + public function __construct (array $messageArray, int $code) { // Construct message $message = sprintf('[%s:%d] Data length %s modulo 4 is not zero: data=%s', $messageArray[0]->__toString(), diff --git a/framework/main/exceptions/class_FrameworkException.php b/framework/main/exceptions/class_FrameworkException.php index 94befb3b..e6c866fd 100644 --- a/framework/main/exceptions/class_FrameworkException.php +++ b/framework/main/exceptions/class_FrameworkException.php @@ -33,7 +33,7 @@ abstract class FrameworkException extends ReflectionException { /** * Array for the backtrace */ - private $backTrace = array(); + private $backTrace = []; /** * Extra data @@ -47,7 +47,7 @@ abstract class FrameworkException extends ReflectionException { * @param $code An optional code for better debugging * @return void */ - public function __construct ($message, $code = 0) { + public function __construct (string $message, int $code = 0) { // Make sure everything is assigned properly parent::__construct($message, $code); @@ -180,9 +180,12 @@ abstract class FrameworkException extends ReflectionException { * @param $code Integer code to encode in hex * @return $hexCode The exception code in hex-decimal format */ - public final function getHexCode ($code = NULL) { - // Get the decimal code - if (is_null($code)) $code = $this->getCode(); + public final function getHexCode (int $code = NULL) { + // Is NULL? + if (is_null($code)) { + // Get default error code + $code = $this->getCode(); + } // Format it to hex-decimal, 0x as prefix and 3 chars $hexCode = sprintf("0x%03s", dechex($code)); @@ -197,7 +200,7 @@ abstract class FrameworkException extends ReflectionException { * @param $extraData Extra data to store * @return void */ - protected final function setExtraData ($extraData) { + protected final function setExtraData (string $extraData) { $this->extraData = $extraData; } diff --git a/framework/main/exceptions/compressor/class_MismatchingCompressorsException.php b/framework/main/exceptions/compressor/class_MismatchingCompressorsException.php index 45ce14f4..64686444 100644 --- a/framework/main/exceptions/compressor/class_MismatchingCompressorsException.php +++ b/framework/main/exceptions/compressor/class_MismatchingCompressorsException.php @@ -36,7 +36,7 @@ class MismatchingCompressorsException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $array, $code) { + public function __construct (array $array, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Der Kompressor %s zu den geladenen Daten aus %s und der aktuell verwendete Kompressor %s stimmen nicht überein!', $array[0]->__toString(), diff --git a/framework/main/exceptions/config/class_ConfigValueTypeUnsupportedException.php b/framework/main/exceptions/config/class_ConfigValueTypeUnsupportedException.php index d1a855a5..c2aa476c 100644 --- a/framework/main/exceptions/config/class_ConfigValueTypeUnsupportedException.php +++ b/framework/main/exceptions/config/class_ConfigValueTypeUnsupportedException.php @@ -38,7 +38,7 @@ class ConfigValueTypeUnsupportedException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $messageArray, $code) { + public function __construct (array $messageArray, int $code) { // Construct message $message = sprintf('[%s:%d] Configuration key %s has unspported value type %s.', $messageArray[0]->__toString(), diff --git a/framework/main/exceptions/config/class_NoConfigEntryException.php b/framework/main/exceptions/config/class_NoConfigEntryException.php index eb6b98c8..d0894f07 100644 --- a/framework/main/exceptions/config/class_NoConfigEntryException.php +++ b/framework/main/exceptions/config/class_NoConfigEntryException.php @@ -36,7 +36,7 @@ class NoConfigEntryException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Configuration entry %s not found.', $classArray[0], diff --git a/framework/main/exceptions/connection/class_ConnectionAlreadyRegisteredException.php b/framework/main/exceptions/connection/class_ConnectionAlreadyRegisteredException.php index ba5bd233..f7ecf9c2 100644 --- a/framework/main/exceptions/connection/class_ConnectionAlreadyRegisteredException.php +++ b/framework/main/exceptions/connection/class_ConnectionAlreadyRegisteredException.php @@ -36,7 +36,7 @@ class ConnectionAlreadyRegisteredException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $messageData, $code) { + public function __construct (array $messageData, int $code) { // Construct the message $message = sprintf('[%s:] Connection with socket %s is already registered.', $messageData[0]->__toString(), diff --git a/framework/main/exceptions/controller/class_DefaultControllerException.php b/framework/main/exceptions/controller/class_DefaultControllerException.php index 444004b7..079e8843 100644 --- a/framework/main/exceptions/controller/class_DefaultControllerException.php +++ b/framework/main/exceptions/controller/class_DefaultControllerException.php @@ -36,7 +36,7 @@ class DefaultControllerException extends FrameworkException { * @param $code An optional code for better debugging * @return void */ - public function __construct (ControllerResolver $resolverInstance, $code) { + public function __construct (ControllerResolver $resolverInstance, int $code) { // Prepare the message $message = sprintf('[%s:%d] Cannot resolve default controller (%s). Maybe missing?', $resolverInstance->__toString(), diff --git a/framework/main/exceptions/controller/class_InvalidControllerException.php b/framework/main/exceptions/controller/class_InvalidControllerException.php index e82806a6..f64f2879 100644 --- a/framework/main/exceptions/controller/class_InvalidControllerException.php +++ b/framework/main/exceptions/controller/class_InvalidControllerException.php @@ -31,21 +31,21 @@ class InvalidControllerException extends FrameworkException { /** * The super constructor for all exceptions * - * @param $msgArray An array with message parts + * @param $messageArray An array with message parts * @param $code An optional code for better debugging * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Prepare the message $message = sprintf('[%s:%d] Cannot resolve controller %s (class name: %s).', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1], - $msgArray[0]->getClassName() + $messageArray[1], + $messageArray[0]->getClassName() ); // Set extra data - $this->setExtraData($msgArray[0]->getClassName() . ':' . $this->getLine()); + $this->setExtraData($messageArray[0]->getClassName() . ':' . $this->getLine()); // Call parent contructor with message parent::__construct($message, $code); diff --git a/framework/main/exceptions/crypto/class_EncryptInvalidLengthException.php b/framework/main/exceptions/crypto/class_EncryptInvalidLengthException.php index 0ee59605..eae853d7 100644 --- a/framework/main/exceptions/crypto/class_EncryptInvalidLengthException.php +++ b/framework/main/exceptions/crypto/class_EncryptInvalidLengthException.php @@ -38,7 +38,7 @@ class EncryptInvalidLengthException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (Filterable $filterInstance, $code) { + public function __construct (Filterable $filterInstance, int $code) { // Get length $length = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('captcha_string_length'); diff --git a/framework/main/exceptions/crypto/class_EncryptMissingException.php b/framework/main/exceptions/crypto/class_EncryptMissingException.php index 5993697c..e5bc6aaa 100644 --- a/framework/main/exceptions/crypto/class_EncryptMissingException.php +++ b/framework/main/exceptions/crypto/class_EncryptMissingException.php @@ -37,7 +37,7 @@ class EncryptMissingException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (Filterable $filterInstance, $code) { + public function __construct (Filterable $filterInstance, int $code) { // Construct message $message = sprintf('[%s:%d] Encrypt string is missing.', $filterInstance->__toString(), diff --git a/framework/main/exceptions/database/class_DatabaseException.php b/framework/main/exceptions/database/class_DatabaseException.php index a1d483be..ec6067a5 100644 --- a/framework/main/exceptions/database/class_DatabaseException.php +++ b/framework/main/exceptions/database/class_DatabaseException.php @@ -35,7 +35,7 @@ class DatabaseException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct ($message, $code) { + public function __construct ($message, int $code) { // Just call the parent constructor parent::__construct($message, $code); } diff --git a/framework/main/exceptions/database/general/class_SqlException.php b/framework/main/exceptions/database/general/class_SqlException.php index 282e5e10..74b9e359 100644 --- a/framework/main/exceptions/database/general/class_SqlException.php +++ b/framework/main/exceptions/database/general/class_SqlException.php @@ -31,17 +31,17 @@ class SqlException extends DatabaseException { /** * The constructor * - * @param $msgArray Message array + * @param $messageArray Message array * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Construct the message $message = sprintf('[%s:%d] SQL error detected. Message from database: %s, code: %s.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1], - $this->getHexCode($msgArray[2]) + $messageArray[1], + $this->getHexCode($messageArray[2]) ); // Call parent constructor diff --git a/framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php b/framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php index 47a12a6d..24577e0c 100644 --- a/framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php +++ b/framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php @@ -36,7 +36,7 @@ class SavePathIsNoDirectoryException extends DatabaseException { * @param $code Code number for the exception * @return void */ - public function __construct ($path, $code) { + public function __construct (string $path, int $code) { // Add a message around the missing class $message = sprintf('Save path %s is no directory.', $path); diff --git a/framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php b/framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php index 69dbbd1b..985b0e7e 100644 --- a/framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php +++ b/framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php @@ -36,7 +36,7 @@ class SavePathReadProtectedException extends DatabaseException { * @param $code Code number for the exception * @return void */ - public function __construct ($path, $code) { + public function __construct (string $path, int $code) { // Add a message around the missing class $message = sprintf('Path %s is not readable. Please fix your file access rights.', $path); diff --git a/framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php b/framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php index bcdef61d..994dba5e 100644 --- a/framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php +++ b/framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php @@ -36,7 +36,7 @@ class SavePathWriteProtectedException extends DatabaseException { * @param $code Code number for the exception * @return void */ - public function __construct ($path, $code) { + public function __construct (string $path, int $code) { // Add a message around the missing class $message = sprintf('Save path %s is write-protected. Please fix your file permissions.', $path); diff --git a/framework/main/exceptions/dns/class_UnknownHostnameException.php b/framework/main/exceptions/dns/class_UnknownHostnameException.php index 76a26602..729bc262 100644 --- a/framework/main/exceptions/dns/class_UnknownHostnameException.php +++ b/framework/main/exceptions/dns/class_UnknownHostnameException.php @@ -31,16 +31,16 @@ class UnknownHostnameException extends FrameworkException { /** * The constructor * - * @param $msgArray Message array holding all needed data + * @param $messageArray Message array holding all needed data * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the host name $message = sprintf('[%s:%d] Host name "%s" cannot be resolved (NXDOMAIN).', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1] + $messageArray[1] ); // Call parent constructor diff --git a/framework/main/exceptions/feature/class_FeatureMethodNotCallableException.php b/framework/main/exceptions/feature/class_FeatureMethodNotCallableException.php index caaa927c..01f36785 100644 --- a/framework/main/exceptions/feature/class_FeatureMethodNotCallableException.php +++ b/framework/main/exceptions/feature/class_FeatureMethodNotCallableException.php @@ -35,7 +35,7 @@ class FeatureMethodNotCallableException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $messageArray, $code) { + public function __construct (array $messageArray, int $code) { // Construct message $message = sprintf('[%s:%d] Method %s cannot be called.', $messageArray[0], diff --git a/framework/main/exceptions/file_directory/class_DirPointerNotOpenedException.php b/framework/main/exceptions/file_directory/class_DirPointerNotOpenedException.php index cbafa2db..dcdb3e58 100644 --- a/framework/main/exceptions/file_directory/class_DirPointerNotOpenedException.php +++ b/framework/main/exceptions/file_directory/class_DirPointerNotOpenedException.php @@ -35,7 +35,7 @@ class DirPointerNotOpenedException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct ($path, $code) { + public function __construct (string $path, int $code) { // Add a message around the missing class $message = sprintf('No pointer could be initialized for path "%s".', $path); diff --git a/framework/main/exceptions/file_directory/class_FileIoException.php b/framework/main/exceptions/file_directory/class_FileIoException.php index 86cb63f7..a1be8612 100644 --- a/framework/main/exceptions/file_directory/class_FileIoException.php +++ b/framework/main/exceptions/file_directory/class_FileIoException.php @@ -39,7 +39,7 @@ class FileIoException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (SplFileInfo $infoInstance, $code) { + public function __construct (SplFileInfo $infoInstance, int $code) { // Add a message around the missing class $message = sprintf('A problem has been detected reading or writing to/from %s.', $infoInstance->getPathname()); diff --git a/framework/main/exceptions/file_directory/class_FileNotFoundException.php b/framework/main/exceptions/file_directory/class_FileNotFoundException.php index 1db8b70a..0658298f 100644 --- a/framework/main/exceptions/file_directory/class_FileNotFoundException.php +++ b/framework/main/exceptions/file_directory/class_FileNotFoundException.php @@ -38,7 +38,7 @@ class FileNotFoundException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (SplFileInfo $infoInstance, $code) { + public function __construct (SplFileInfo $infoInstance, int $code) { // Add a message around the missing class $message = sprintf('File "%s" not found.', $infoInstance->getPathname()); diff --git a/framework/main/exceptions/file_directory/class_FileReadProtectedException.php b/framework/main/exceptions/file_directory/class_FileReadProtectedException.php index 7de24da2..47272db3 100644 --- a/framework/main/exceptions/file_directory/class_FileReadProtectedException.php +++ b/framework/main/exceptions/file_directory/class_FileReadProtectedException.php @@ -38,7 +38,7 @@ class FileReadProtectedException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (SplFileInfo $infoInstance, $code) { + public function __construct (SplFileInfo $infoInstance, int $code) { // Add a message around the missing class $message = sprintf('File %s is read-protected. Please set read access rights (CHMOD).', $infoInstance->getPathname()); diff --git a/framework/main/exceptions/file_directory/class_FileWriteProtectedException.php b/framework/main/exceptions/file_directory/class_FileWriteProtectedException.php index 202ba1fa..d440737f 100644 --- a/framework/main/exceptions/file_directory/class_FileWriteProtectedException.php +++ b/framework/main/exceptions/file_directory/class_FileWriteProtectedException.php @@ -38,7 +38,7 @@ class FileWriteProtectedException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (SplFileInfo $infoInstance, $code) { + public function __construct (SplFileInfo $infoInstance, int $code) { // Add a message around the missing class $message = sprintf('File %s cannot be written. Please check file and/or directory permissions.', $infoInstance->getPathname()); diff --git a/framework/main/exceptions/file_directory/class_InvalidDataLengthException.php b/framework/main/exceptions/file_directory/class_InvalidDataLengthException.php index 090644d3..83b57582 100644 --- a/framework/main/exceptions/file_directory/class_InvalidDataLengthException.php +++ b/framework/main/exceptions/file_directory/class_InvalidDataLengthException.php @@ -32,17 +32,17 @@ class InvalidDataLengthException extends FrameworkException { /** * The constructor * - * @param $msgArray Message from the exception + * @param $messageArray Message from the exception * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Unexpected data length of %s bytes has been detected, %s bytes were expected.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1], - $msgArray[2] + $messageArray[1], + $messageArray[2] ); // Call parent constructor diff --git a/framework/main/exceptions/file_directory/class_InvalidMD5ChecksumException.php b/framework/main/exceptions/file_directory/class_InvalidMD5ChecksumException.php index c8872c09..251c0513 100644 --- a/framework/main/exceptions/file_directory/class_InvalidMD5ChecksumException.php +++ b/framework/main/exceptions/file_directory/class_InvalidMD5ChecksumException.php @@ -32,17 +32,17 @@ class InvalidMD5ChecksumException extends FrameworkException { /** * The constructor * - * @param $msgArray Message from the exception + * @param $messageArray Message from the exception * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] MD5 hashes %s and %s doesnt match.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1], - $msgArray[2] + $messageArray[1], + $messageArray[2] ); // Call parent constructor diff --git a/framework/main/exceptions/file_directory/class_InvalidResourceException.php b/framework/main/exceptions/file_directory/class_InvalidResourceException.php index f056e24c..ad279d49 100644 --- a/framework/main/exceptions/file_directory/class_InvalidResourceException.php +++ b/framework/main/exceptions/file_directory/class_InvalidResourceException.php @@ -36,7 +36,7 @@ class InvalidResourceException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (FrameworkInterface $class, $code) { + public function __construct (FrameworkInterface $class, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Has an invalid resource.', $class->__toString(), diff --git a/framework/main/exceptions/file_directory/class_PathIsNoDirectoryException.php b/framework/main/exceptions/file_directory/class_PathIsNoDirectoryException.php index fa9d5f22..1aefbeb1 100644 --- a/framework/main/exceptions/file_directory/class_PathIsNoDirectoryException.php +++ b/framework/main/exceptions/file_directory/class_PathIsNoDirectoryException.php @@ -36,7 +36,7 @@ class PathIsNoDirectoryException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct ($path, $code) { + public function __construct (string $path, int $code) { // Add a message around the missing class $message = sprintf('Der angegebene Pfad %s ist ungütig (kein Pfad).', $path); diff --git a/framework/main/exceptions/file_directory/class_PathReadProtectedException.php b/framework/main/exceptions/file_directory/class_PathReadProtectedException.php index 4437e736..3f9a1e42 100644 --- a/framework/main/exceptions/file_directory/class_PathReadProtectedException.php +++ b/framework/main/exceptions/file_directory/class_PathReadProtectedException.php @@ -36,7 +36,7 @@ class PathReadProtectedException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct ($path, $code) { + public function __construct (string $path, int $code) { // Add a message around the missing class $message = sprintf('The path %s appears to be read-protected. Please fix your CHMOD rights.', $path); diff --git a/framework/main/exceptions/file_directory/class_PathWriteProtectedException.php b/framework/main/exceptions/file_directory/class_PathWriteProtectedException.php index 3d9945e1..7812f2a1 100644 --- a/framework/main/exceptions/file_directory/class_PathWriteProtectedException.php +++ b/framework/main/exceptions/file_directory/class_PathWriteProtectedException.php @@ -39,7 +39,7 @@ class PathWriteProtectedException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (SplFileInfo $infoInstance, $code) { + public function __construct (SplFileInfo $infoInstance, int $code) { // Add a message around the missing class $message = sprintf('Path "%s" cannot be written to. Please check permissions.', $infoInstance->getPath()); diff --git a/framework/main/exceptions/filter/class_FilterChainException.php b/framework/main/exceptions/filter/class_FilterChainException.php index aadb0a57..8a69da7f 100644 --- a/framework/main/exceptions/filter/class_FilterChainException.php +++ b/framework/main/exceptions/filter/class_FilterChainException.php @@ -36,7 +36,7 @@ class FilterChainException extends FrameworkException { * @param $code Exception code for better debugging * @return void */ - public function __construct (Filterable $filterInstance, $code) { + public function __construct (Filterable $filterInstance, int $code) { // Construct the message $message = sprintf('[%s:%d] Filter chain interruppted by fatal error in filter.', $filterInstance->__toString(), diff --git a/framework/main/exceptions/filter/class_InvalidFilterChainException.php b/framework/main/exceptions/filter/class_InvalidFilterChainException.php index 583216e2..93057a89 100644 --- a/framework/main/exceptions/filter/class_InvalidFilterChainException.php +++ b/framework/main/exceptions/filter/class_InvalidFilterChainException.php @@ -36,7 +36,7 @@ class InvalidFilterChainException extends FrameworkException { * @param $code Exception code for better debugging * @return void */ - public function __construct (array $filterArray, $code) { + public function __construct (array $filterArray, int $code) { // Construct the message $message = sprintf('[%s:%d] Filter chain %s is not initialized.', $filterArray[0]->__toString(), diff --git a/framework/main/exceptions/helper/class_FormClosedException.php b/framework/main/exceptions/helper/class_FormClosedException.php index 9aeb0d61..ea9db629 100644 --- a/framework/main/exceptions/helper/class_FormClosedException.php +++ b/framework/main/exceptions/helper/class_FormClosedException.php @@ -37,7 +37,7 @@ class FormClosedException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Could not add form element %s because form is closed.', $classArray[0]->__toString(), diff --git a/framework/main/exceptions/helper/class_FormGroupClosedException.php b/framework/main/exceptions/helper/class_FormGroupClosedException.php index 9be2ed6e..5bf7ebe5 100644 --- a/framework/main/exceptions/helper/class_FormGroupClosedException.php +++ b/framework/main/exceptions/helper/class_FormGroupClosedException.php @@ -36,7 +36,7 @@ class FormGroupClosedException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Could not add sub group %s because no form group has been opened before.', $classArray[0]->__toString(), diff --git a/framework/main/exceptions/helper/class_FormOpenedException.php b/framework/main/exceptions/helper/class_FormOpenedException.php index 74fa1d9b..a2d97b08 100644 --- a/framework/main/exceptions/helper/class_FormOpenedException.php +++ b/framework/main/exceptions/helper/class_FormOpenedException.php @@ -38,7 +38,7 @@ class FormOpenedException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (BaseHelper $helperInstance, $code) { + public function __construct (BaseHelper $helperInstance, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Form is not yet closed. Close it with method %s::addFormTag() and add no parameters.', $helperInstance->__toString(), diff --git a/framework/main/exceptions/helper/class_HelperGroupAlreadyCreatedException.php b/framework/main/exceptions/helper/class_HelperGroupAlreadyCreatedException.php index 744f2136..91714a85 100644 --- a/framework/main/exceptions/helper/class_HelperGroupAlreadyCreatedException.php +++ b/framework/main/exceptions/helper/class_HelperGroupAlreadyCreatedException.php @@ -32,16 +32,16 @@ class HelperGroupAlreadyCreatedException extends FrameworkException { /** * The constructor * - * @param $msgArray Array containing exception data + * @param $messageArray Array containing exception data * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Group %s already opened before.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1] + $messageArray[1] ); // Call parent constructor diff --git a/framework/main/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php b/framework/main/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php index b8a1353d..55bcdccd 100644 --- a/framework/main/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php +++ b/framework/main/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php @@ -32,16 +32,16 @@ class HelperNoPreviousOpenedSubGroupException extends FrameworkException { /** * The constructor * - * @param $msgArray Array containing exception data + * @param $messageArray Array containing exception data * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Sub group not opened before. Raw text follows: %s', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1] + $messageArray[1] ); // Call parent constructor diff --git a/framework/main/exceptions/helper/class_HelperSubGroupAlreadyCreatedException.php b/framework/main/exceptions/helper/class_HelperSubGroupAlreadyCreatedException.php index 7bf2281d..dc417e1e 100644 --- a/framework/main/exceptions/helper/class_HelperSubGroupAlreadyCreatedException.php +++ b/framework/main/exceptions/helper/class_HelperSubGroupAlreadyCreatedException.php @@ -32,16 +32,16 @@ class HelperSubGroupAlreadyCreatedException extends FrameworkException { /** * The constructor * - * @param $msgArray Array containing exception data + * @param $messageArray Array containing exception data * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Sub group %s already opened before.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1] + $messageArray[1] ); // Call parent constructor diff --git a/framework/main/exceptions/helper/class_InvalidFormNameException.php b/framework/main/exceptions/helper/class_InvalidFormNameException.php index d87676a1..687c350f 100644 --- a/framework/main/exceptions/helper/class_InvalidFormNameException.php +++ b/framework/main/exceptions/helper/class_InvalidFormNameException.php @@ -37,7 +37,7 @@ class InvalidFormNameException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (BaseHelper $helperInstance, $code) { + public function __construct (BaseHelper $helperInstance, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Form name not set.', $helperInstance->__toString(), diff --git a/framework/main/exceptions/helper/class_NoGroupOpenedException.php b/framework/main/exceptions/helper/class_NoGroupOpenedException.php index 4643f9f0..92ad7f61 100644 --- a/framework/main/exceptions/helper/class_NoGroupOpenedException.php +++ b/framework/main/exceptions/helper/class_NoGroupOpenedException.php @@ -32,16 +32,16 @@ class NoGroupOpenedException extends FrameworkException { /** * The constructor * - * @param $msgArray Array containing exception data + * @param $messageArray Array containing exception data * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Group not opened before. Raw text follows: %s', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1] + $messageArray[1] ); // Call parent constructor diff --git a/framework/main/exceptions/helper/class_UserInstanceMissingException.php b/framework/main/exceptions/helper/class_UserInstanceMissingException.php index ee695122..83317cf8 100644 --- a/framework/main/exceptions/helper/class_UserInstanceMissingException.php +++ b/framework/main/exceptions/helper/class_UserInstanceMissingException.php @@ -36,7 +36,7 @@ class UserInstanceMissingException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Registry key %s does not include a class with implemented interface Manageable(User|Guest).', $classArray[0]->__toString(), diff --git a/framework/main/exceptions/language/class_InvalidLanguagePathStringException.php b/framework/main/exceptions/language/class_InvalidLanguagePathStringException.php index 36c93051..fc49eeb6 100644 --- a/framework/main/exceptions/language/class_InvalidLanguagePathStringException.php +++ b/framework/main/exceptions/language/class_InvalidLanguagePathStringException.php @@ -36,7 +36,7 @@ class InvalidLanguagePathStringException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] %s is not a string with path.', $classArray[0]->__toString(), diff --git a/framework/main/exceptions/language/class_LanguagePathIsNoDirectoryException.php b/framework/main/exceptions/language/class_LanguagePathIsNoDirectoryException.php index bc6f6106..60c6565b 100644 --- a/framework/main/exceptions/language/class_LanguagePathIsNoDirectoryException.php +++ b/framework/main/exceptions/language/class_LanguagePathIsNoDirectoryException.php @@ -36,7 +36,7 @@ class LanguagePathIsNoDirectoryException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Language base path %s does not exist or is not a directory.', $classArray[0]->__toString(), diff --git a/framework/main/exceptions/language/class_LanguagePathReadProtectedException.php b/framework/main/exceptions/language/class_LanguagePathReadProtectedException.php index e97dd703..9b740438 100644 --- a/framework/main/exceptions/language/class_LanguagePathReadProtectedException.php +++ b/framework/main/exceptions/language/class_LanguagePathReadProtectedException.php @@ -36,7 +36,7 @@ class LanguagePathReadProtectedException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Base language path %s is read-protected. Please change access rights (CHMOD).', $classArray[0]->__toString(), diff --git a/framework/main/exceptions/main/class_AssertionException.php b/framework/main/exceptions/main/class_AssertionException.php index 12b60831..523f20d1 100644 --- a/framework/main/exceptions/main/class_AssertionException.php +++ b/framework/main/exceptions/main/class_AssertionException.php @@ -35,7 +35,7 @@ class AssertionException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct ($message, $code) { + public function __construct (string $message, int $code) { // Call parent constructor parent::__construct($message, $code); } diff --git a/framework/main/exceptions/main/class_ClassMismatchException.php b/framework/main/exceptions/main/class_ClassMismatchException.php index bea27a15..22a1a870 100644 --- a/framework/main/exceptions/main/class_ClassMismatchException.php +++ b/framework/main/exceptions/main/class_ClassMismatchException.php @@ -35,7 +35,7 @@ class ClassMismatchException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Add a message around the missing class $message = sprintf('The class %s does not match class %s.', $classArray[0], diff --git a/framework/main/exceptions/main/class_DimNotFoundInArrayException.php b/framework/main/exceptions/main/class_DimNotFoundInArrayException.php index 95fa7556..151fe27f 100644 --- a/framework/main/exceptions/main/class_DimNotFoundInArrayException.php +++ b/framework/main/exceptions/main/class_DimNotFoundInArrayException.php @@ -37,7 +37,7 @@ class DimNotFoundInArrayException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (FrameworkInterface $class, $code) { + public function __construct (FrameworkInterface $class, int $code) { if (is_object($class)) { // Add a message around the missing class $message = sprintf('[%s:%d] Dimensions not found in array, array is invalid!', diff --git a/framework/main/exceptions/main/class_FatalErrorException.php b/framework/main/exceptions/main/class_FatalErrorException.php index 2178c32b..8a5b7ff8 100644 --- a/framework/main/exceptions/main/class_FatalErrorException.php +++ b/framework/main/exceptions/main/class_FatalErrorException.php @@ -35,7 +35,7 @@ class FatalErrorException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct ($message, $code) { + public function __construct (string $message, int $code) { // Call parent constructor parent::__construct($message, $code); } diff --git a/framework/main/exceptions/main/class_IndexOutOfBoundsException.php b/framework/main/exceptions/main/class_IndexOutOfBoundsException.php index 05f4c121..e8f6aee5 100644 --- a/framework/main/exceptions/main/class_IndexOutOfBoundsException.php +++ b/framework/main/exceptions/main/class_IndexOutOfBoundsException.php @@ -35,7 +35,7 @@ class IndexOutOfBoundsException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct ($message, $code) { + public function __construct (string $message, int $code) { // Add a message around the missing class $message = sprintf('%s is out of bounds.', $message diff --git a/framework/main/exceptions/main/class_InvalidArrayCountException.php b/framework/main/exceptions/main/class_InvalidArrayCountException.php index 3bfff925..d962564b 100644 --- a/framework/main/exceptions/main/class_InvalidArrayCountException.php +++ b/framework/main/exceptions/main/class_InvalidArrayCountException.php @@ -36,7 +36,7 @@ class InvalidArrayCountException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $array, $code) { + public function __construct (array $array, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] %s has %d elements, expected arre %d.', $array[0]->__toString(), diff --git a/framework/main/exceptions/main/class_InvalidCommandException.php b/framework/main/exceptions/main/class_InvalidCommandException.php index 90136e21..bf26dcb5 100644 --- a/framework/main/exceptions/main/class_InvalidCommandException.php +++ b/framework/main/exceptions/main/class_InvalidCommandException.php @@ -35,17 +35,17 @@ class InvalidCommandException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Invalid command %s (class %s) detected.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1], - $msgArray[0]->getClassName() + $messageArray[1], + $messageArray[0]->getClassName() ); // Set extra data - $this->setExtraData($msgArray[0]->getClassName() . ':' . $this->getLine()); + $this->setExtraData($messageArray[0]->getClassName() . ':' . $this->getLine()); // Call parent constructor parent::__construct($message, $code); diff --git a/framework/main/exceptions/main/class_InvalidInterfaceException.php b/framework/main/exceptions/main/class_InvalidInterfaceException.php index 63814d0e..1009583a 100644 --- a/framework/main/exceptions/main/class_InvalidInterfaceException.php +++ b/framework/main/exceptions/main/class_InvalidInterfaceException.php @@ -35,7 +35,7 @@ class InvalidInterfaceException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Object does not implement expected interface %s.', $classArray[0]->__toString(), diff --git a/framework/main/exceptions/main/class_InvalidObjectException.php b/framework/main/exceptions/main/class_InvalidObjectException.php index 16dc9cbb..7b55f5e9 100644 --- a/framework/main/exceptions/main/class_InvalidObjectException.php +++ b/framework/main/exceptions/main/class_InvalidObjectException.php @@ -37,7 +37,7 @@ class InvalidObjectException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (FrameworkInterface $class, $code) { + public function __construct (FrameworkInterface $class, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Object is not allowed here.', $class->__toString(), diff --git a/framework/main/exceptions/main/class_MissingArrayElementsException.php b/framework/main/exceptions/main/class_MissingArrayElementsException.php index 91323522..25e2d394 100644 --- a/framework/main/exceptions/main/class_MissingArrayElementsException.php +++ b/framework/main/exceptions/main/class_MissingArrayElementsException.php @@ -35,7 +35,7 @@ class MissingArrayElementsException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Extract all elements $elements = ''; if ((isset($classArray[2])) && (is_array($classArray[2]))) { diff --git a/framework/main/exceptions/main/class_NoClassException.php b/framework/main/exceptions/main/class_NoClassException.php index c993e96d..0b768a93 100644 --- a/framework/main/exceptions/main/class_NoClassException.php +++ b/framework/main/exceptions/main/class_NoClassException.php @@ -31,20 +31,20 @@ class NoClassException extends FrameworkException { /** * The constructor * - * @param $msgArray Message from the exception + * @param $messageArray Message from the exception * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Class %s not found.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1] + $messageArray[1] ); // Set extra data - $this->setExtraData($msgArray[1]); + $this->setExtraData($messageArray[1]); // Call parent constructor parent::__construct($message, $code); diff --git a/framework/main/exceptions/main/class_ResponseHeadersAlreadySentException.php b/framework/main/exceptions/main/class_ResponseHeadersAlreadySentException.php index f475e3fa..4cd01601 100644 --- a/framework/main/exceptions/main/class_ResponseHeadersAlreadySentException.php +++ b/framework/main/exceptions/main/class_ResponseHeadersAlreadySentException.php @@ -36,7 +36,7 @@ class ResponseHeadersAlreadySentException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (FrameworkInterface $class, $code) { + public function __construct (FrameworkInterface $class, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Headers are already sent.', $class->__toString(), diff --git a/framework/main/exceptions/main/class_UnsupportedOperationException.php b/framework/main/exceptions/main/class_UnsupportedOperationException.php index b8b2741e..1de612a5 100644 --- a/framework/main/exceptions/main/class_UnsupportedOperationException.php +++ b/framework/main/exceptions/main/class_UnsupportedOperationException.php @@ -37,7 +37,7 @@ class UnsupportedOperationException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Init extra class name $extraClassName = ''; diff --git a/framework/main/exceptions/main/class_VariableIsNotSetException.php b/framework/main/exceptions/main/class_VariableIsNotSetException.php index 372fa629..4f882002 100644 --- a/framework/main/exceptions/main/class_VariableIsNotSetException.php +++ b/framework/main/exceptions/main/class_VariableIsNotSetException.php @@ -36,7 +36,7 @@ class VariableIsNotSetException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $array, $code) { + public function __construct (array $array, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] While the application %s was initialized, a variable %s was not created.', $array[0]->__toString(), diff --git a/framework/main/exceptions/result/class_InvalidDatabaseResultException.php b/framework/main/exceptions/result/class_InvalidDatabaseResultException.php index 891dba14..127e1cc3 100644 --- a/framework/main/exceptions/result/class_InvalidDatabaseResultException.php +++ b/framework/main/exceptions/result/class_InvalidDatabaseResultException.php @@ -31,16 +31,16 @@ class InvalidDatabaseResultException extends FrameworkException { /** * The super constructor for all exceptions * - * @param $msgArray Error message array + * @param $messageArray Error message array * @param $code Error code * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Construct the message $message = sprintf('[%s:%d] Database instance %s contains invalid entries.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1]->__toString() + $messageArray[1]->__toString() ); // Call parent exception constructor diff --git a/framework/main/exceptions/result/class_ResultUpdateException.php b/framework/main/exceptions/result/class_ResultUpdateException.php index f4bc3ce2..f08a59f6 100644 --- a/framework/main/exceptions/result/class_ResultUpdateException.php +++ b/framework/main/exceptions/result/class_ResultUpdateException.php @@ -36,7 +36,7 @@ class ResultUpdateException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (UpdateableResult $resultInstance, $code) { + public function __construct (UpdateableResult $resultInstance, int $code) { // Construct the message $message = sprintf('[%s:%d] Update of result instance has nothing changed.', $resultInstance->__toString(), diff --git a/framework/main/exceptions/socket/class_InvalidServerSocketException.php b/framework/main/exceptions/socket/class_InvalidServerSocketException.php index 1d5be59e..94cb9ff8 100644 --- a/framework/main/exceptions/socket/class_InvalidServerSocketException.php +++ b/framework/main/exceptions/socket/class_InvalidServerSocketException.php @@ -32,7 +32,7 @@ class InvalidServerSocketException extends AbstractSocketException { * @param $code Error code * @return void */ - public function __construct (array $messageData, $code) { + public function __construct (array $messageData, int $code) { // Construct the message $message = sprintf('[%s:] Socket resource %s is not a server socket.', $messageData[0]->__toString(), diff --git a/framework/main/exceptions/socket/class_InvalidSocketException.php b/framework/main/exceptions/socket/class_InvalidSocketException.php index d53a4571..25e70d2e 100644 --- a/framework/main/exceptions/socket/class_InvalidSocketException.php +++ b/framework/main/exceptions/socket/class_InvalidSocketException.php @@ -33,7 +33,7 @@ class InvalidSocketException extends AbstractSocketException { * @param $code Error code * @return void */ - public function __construct (array $messageData, $code) { + public function __construct (array $messageData, int $code) { // Construct the message $message = sprintf('[%s:] Invalid socketResource[%s]=%s, errno=%s, errstr=%s', $messageData[0]->__toString(), diff --git a/framework/main/exceptions/socket/class_NoSocketErrorDetectedException.php b/framework/main/exceptions/socket/class_NoSocketErrorDetectedException.php index 2340339c..42280d16 100644 --- a/framework/main/exceptions/socket/class_NoSocketErrorDetectedException.php +++ b/framework/main/exceptions/socket/class_NoSocketErrorDetectedException.php @@ -35,7 +35,7 @@ class NoSocketErrorDetectedException extends AbstractSocketException { * @param $code Error code * @return void */ - public function __construct (array $messageData, $code) { + public function __construct (array $messageData, int $code) { // Construct the message $message = sprintf('[%s:] Socket %s has no error reported.', $messageData[0]->__toString(), diff --git a/framework/main/exceptions/socket/class_SocketAlreadyRegisteredException.php b/framework/main/exceptions/socket/class_SocketAlreadyRegisteredException.php index 3ea97ae7..05a2f17d 100644 --- a/framework/main/exceptions/socket/class_SocketAlreadyRegisteredException.php +++ b/framework/main/exceptions/socket/class_SocketAlreadyRegisteredException.php @@ -33,7 +33,7 @@ class SocketAlreadyRegisteredException extends AbstractSocketException { * @param $code Error code * @return void */ - public function __construct (array $messageData, $code) { + public function __construct (array $messageData, int $code) { // Construct the message $message = sprintf('[%s:] Socket %s is already registered.', $messageData[0]->__toString(), diff --git a/framework/main/exceptions/socket/class_SocketBindingException.php b/framework/main/exceptions/socket/class_SocketBindingException.php index facf4682..b4376054 100644 --- a/framework/main/exceptions/socket/class_SocketBindingException.php +++ b/framework/main/exceptions/socket/class_SocketBindingException.php @@ -31,7 +31,7 @@ class SocketBindingException extends AbstractSocketException { * @param $code Error code * @return void */ - public function __construct (array $messageData, $code) { + public function __construct (array $messageData, int $code) { // Construct the message $message = sprintf('[%s:] Could not bind to socket %s: Type=%s, errno=%s, errstr=%s', $messageData[0]->__toString(), diff --git a/framework/main/exceptions/socket/class_SocketConnectionException.php b/framework/main/exceptions/socket/class_SocketConnectionException.php index 456b0c3e..39ef8b95 100644 --- a/framework/main/exceptions/socket/class_SocketConnectionException.php +++ b/framework/main/exceptions/socket/class_SocketConnectionException.php @@ -34,7 +34,7 @@ class SocketConnectionException extends AbstractSocketException { * @param $code Error code * @return void */ - public function __construct (array $messageData, $code) { + public function __construct (array $messageData, int $code) { // Construct the message $message = sprintf('[%s:] Could not make a connection, type=%s, errno=%s, errstr=%s', $messageData[0]->__toString(), diff --git a/framework/main/exceptions/socket/class_SocketCreationException.php b/framework/main/exceptions/socket/class_SocketCreationException.php index 0d7a34ec..2955d024 100644 --- a/framework/main/exceptions/socket/class_SocketCreationException.php +++ b/framework/main/exceptions/socket/class_SocketCreationException.php @@ -34,7 +34,7 @@ class SocketCreationException extends AbstractSocketException { * @param $code Error code * @return void */ - public function __construct (array $messageData, $code) { + public function __construct (array $messageData, int $code) { // Construct the message $message = sprintf('[%s:] Cannot create socket, type=%s, errno=%s, errstr=%s', $messageData[0]->__toString(), diff --git a/framework/main/exceptions/socket/class_SocketOperationException.php b/framework/main/exceptions/socket/class_SocketOperationException.php index 3c189b51..8e607fe3 100644 --- a/framework/main/exceptions/socket/class_SocketOperationException.php +++ b/framework/main/exceptions/socket/class_SocketOperationException.php @@ -32,7 +32,7 @@ class SocketOperationException extends AbstractSocketException { * @param $code Error code * @return void */ - public function __construct (array $messageData, $code) { + public function __construct (array $messageData, int $code) { // Construct the message $message = sprintf('[%s:] Socket operation failed, type=%s, errno=%s, errstr=%s', $messageData[0]->__toString(), diff --git a/framework/main/exceptions/socket/class_SocketOptionException.php b/framework/main/exceptions/socket/class_SocketOptionException.php index 13fa65ae..0060bbbf 100644 --- a/framework/main/exceptions/socket/class_SocketOptionException.php +++ b/framework/main/exceptions/socket/class_SocketOptionException.php @@ -34,7 +34,7 @@ class SocketOptionException extends AbstractSocketException { * @param $code Error code * @return void */ - public function __construct (array $messageData, $code) { + public function __construct (array $messageData, int $code) { // Construct the message $message = sprintf('[%s:] Changing option on socket failed, type=%s, errno=%s, errstr=%s', $messageData[0]->__toString(), diff --git a/framework/main/exceptions/socket/class_UnsupportedSocketErrorHandlerException.php b/framework/main/exceptions/socket/class_UnsupportedSocketErrorHandlerException.php index f8efb245..f7d2ec31 100644 --- a/framework/main/exceptions/socket/class_UnsupportedSocketErrorHandlerException.php +++ b/framework/main/exceptions/socket/class_UnsupportedSocketErrorHandlerException.php @@ -33,7 +33,7 @@ class UnsupportedSocketErrorHandlerException extends AbstractSocketException { * @param $code Error code * @return void */ - public function __construct (array $messageData, $code) { + public function __construct (array $messageData, int $code) { // Construct the message $message = sprintf('[%s:] Socket error handler %s is not yet implemented, errorCode=%s, message=%s', $messageData[0]->__toString(), diff --git a/framework/main/exceptions/stacker/class_AlreadyInitializedStackerException.php b/framework/main/exceptions/stacker/class_AlreadyInitializedStackerException.php index 8650fd3a..940bee1f 100644 --- a/framework/main/exceptions/stacker/class_AlreadyInitializedStackerException.php +++ b/framework/main/exceptions/stacker/class_AlreadyInitializedStackerException.php @@ -35,7 +35,7 @@ class AlreadyInitializedStackerException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $messageArray, $code) { + public function __construct (array $messageArray, int $code) { // Construct message $message = sprintf('[%s:%d] Stacker %s already initialized, forceReInit=%d.', $messageArray[0]->__toString(), diff --git a/framework/main/exceptions/stacker/class_EmptyStackerException.php b/framework/main/exceptions/stacker/class_EmptyStackerException.php index 931caac0..08415615 100644 --- a/framework/main/exceptions/stacker/class_EmptyStackerException.php +++ b/framework/main/exceptions/stacker/class_EmptyStackerException.php @@ -36,7 +36,7 @@ class EmptyStackerException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $messageArray, $code) { + public function __construct (array $messageArray, int $code) { // Construct message $message = sprintf('[%s:%d] Stacker %s is empty.', $messageArray[0]->__toString(), diff --git a/framework/main/exceptions/stacker/class_FullStackerException.php b/framework/main/exceptions/stacker/class_FullStackerException.php index 03d7ea2a..d543a62f 100644 --- a/framework/main/exceptions/stacker/class_FullStackerException.php +++ b/framework/main/exceptions/stacker/class_FullStackerException.php @@ -35,7 +35,7 @@ class FullStackerException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $messageArray, $code) { + public function __construct (array $messageArray, int $code) { // Construct message $message = sprintf('[%s:%d] Stacker %s is full.', $messageArray[0]->__toString(), diff --git a/framework/main/exceptions/stacker/class_NoStackerException.php b/framework/main/exceptions/stacker/class_NoStackerException.php index f52069e9..ba1a99b1 100644 --- a/framework/main/exceptions/stacker/class_NoStackerException.php +++ b/framework/main/exceptions/stacker/class_NoStackerException.php @@ -35,7 +35,7 @@ class NoStackerException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $messageArray, $code) { + public function __construct (array $messageArray, int $code) { // Construct message $message = sprintf('[%s:%d] Stacker %s is not initialized.', $messageArray[0]->__toString(), diff --git a/framework/main/exceptions/state/class_InvalidStateInstanceException.php b/framework/main/exceptions/state/class_InvalidStateInstanceException.php index c5e0ea6a..4992cd68 100644 --- a/framework/main/exceptions/state/class_InvalidStateInstanceException.php +++ b/framework/main/exceptions/state/class_InvalidStateInstanceException.php @@ -35,12 +35,12 @@ class InvalidStateInstanceException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Invalid state %s of type %s detected.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1], + $messageArray[1], gettype($mgArray[2]) ); diff --git a/framework/main/exceptions/state/class_UnexpectedStateException.php b/framework/main/exceptions/state/class_UnexpectedStateException.php index 64f67930..9cef99e9 100644 --- a/framework/main/exceptions/state/class_UnexpectedStateException.php +++ b/framework/main/exceptions/state/class_UnexpectedStateException.php @@ -36,7 +36,7 @@ class UnexpectedStateException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (Stateable $stateInstance, $code) { + public function __construct (Stateable $stateInstance, int $code) { // Construct the message $message = sprintf('[%s:%d] Unexpected state detected.', $stateInstance->__toString(), diff --git a/framework/main/exceptions/state/class_UnresolveableStateException.php b/framework/main/exceptions/state/class_UnresolveableStateException.php index cbc0e580..38d3b0f1 100644 --- a/framework/main/exceptions/state/class_UnresolveableStateException.php +++ b/framework/main/exceptions/state/class_UnresolveableStateException.php @@ -31,21 +31,21 @@ class UnresolveableStateException extends FrameworkException { /** * The super constructor for all exceptions * - * @param $msgArray An array with message parts + * @param $messageArray An array with message parts * @param $code An optional code for better debugging * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Prepare the message $message = sprintf('[%s:%d] Cannot resolve state %s (class name: %s).', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1], - $msgArray[0]->getClassName() + $messageArray[1], + $messageArray[0]->getClassName() ); // Set extra data - $this->setExtraData($msgArray[0]->getClassName() . ':' . $this->getLine()); + $this->setExtraData($messageArray[0]->getClassName() . ':' . $this->getLine()); // Call parent contructor with message parent::__construct($message, $code); diff --git a/framework/main/exceptions/template/class_BasePathReadProtectedException.php b/framework/main/exceptions/template/class_BasePathReadProtectedException.php index 255451c4..b9fa675e 100644 --- a/framework/main/exceptions/template/class_BasePathReadProtectedException.php +++ b/framework/main/exceptions/template/class_BasePathReadProtectedException.php @@ -36,7 +36,7 @@ class BasePathReadProtectedException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Der Template-Basispfad %s ist lesegeschützt! Bitte Zugriffsrechte (CHMOD) ändern.', $classArray[0]->__toString(), diff --git a/framework/main/exceptions/template/class_InvalidDirectoryException.php b/framework/main/exceptions/template/class_InvalidDirectoryException.php index db3abcf2..d87cfbef 100644 --- a/framework/main/exceptions/template/class_InvalidDirectoryException.php +++ b/framework/main/exceptions/template/class_InvalidDirectoryException.php @@ -35,7 +35,7 @@ class InvalidDirectoryException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Path "%s" is no directory.', $classArray[0]->__toString(), diff --git a/framework/main/exceptions/template/class_NoVariableException.php b/framework/main/exceptions/template/class_NoVariableException.php index 17e05f24..30fd5542 100644 --- a/framework/main/exceptions/template/class_NoVariableException.php +++ b/framework/main/exceptions/template/class_NoVariableException.php @@ -36,7 +36,7 @@ class NoVariableException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (array $messageArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Variable %s is not set, cannot modify(?) its value to %s.', $messageArray[0]->__toString(), diff --git a/framework/main/exceptions/template/class_UnexpectedTemplateTypeException.php b/framework/main/exceptions/template/class_UnexpectedTemplateTypeException.php index 11f52768..3225203c 100644 --- a/framework/main/exceptions/template/class_UnexpectedTemplateTypeException.php +++ b/framework/main/exceptions/template/class_UnexpectedTemplateTypeException.php @@ -32,17 +32,17 @@ class UnexpectedTemplateTypeException extends FrameworkException { /** * The constructor * - * @param $msgArray An array holding our informations + * @param $messageArray An array holding our informations * @param $code Code number for the exception * @return void */ - public function __construct (array $msgArray, $code) { + public function __construct (array $messageArray, int $code) { // Add a message around the missing class $message = sprintf('[%s:%d] Der Template-Typ %s entspricht nicht dem erwartetem Template-Typ %s.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1], - $msgArray[2] + $messageArray[1], + $messageArray[2] ); // Call parent constructor diff --git a/framework/main/exceptions/template/class_UnsupportedTemplateEngineException.php b/framework/main/exceptions/template/class_UnsupportedTemplateEngineException.php index 3423bc75..c46db67e 100644 --- a/framework/main/exceptions/template/class_UnsupportedTemplateEngineException.php +++ b/framework/main/exceptions/template/class_UnsupportedTemplateEngineException.php @@ -36,7 +36,7 @@ class UnsupportedTemplateEngineException extends FrameworkException { * @param $code Code number for the exception * @return void */ - public function __construct (FrameworkInterface $class, $code) { + public function __construct (FrameworkInterface $class, int $code) { // Add a message around the missing class $message = sprintf('Template-Engine %s not (yet) supported.', $class->__toString() diff --git a/framework/main/exceptions/user/class_AccountPasswordMismatchException.php b/framework/main/exceptions/user/class_AccountPasswordMismatchException.php index 81c1062b..e942fe0d 100644 --- a/framework/main/exceptions/user/class_AccountPasswordMismatchException.php +++ b/framework/main/exceptions/user/class_AccountPasswordMismatchException.php @@ -36,7 +36,7 @@ class AccountPasswordMismatchException extends FrameworkException { * @param $code An optional code for better debugging * @return void */ - public function __construct (Filterable $filterInstance, $code) { + public function __construct (Filterable $filterInstance, int $code) { // Create the message $message = sprintf('[%s:%d] Supplied account password did not match with stored.', $filterInstance->__toString(), diff --git a/framework/main/exceptions/user/class_UnexpectedGuestAccountException.php b/framework/main/exceptions/user/class_UnexpectedGuestAccountException.php index d654f945..f817e4ae 100644 --- a/framework/main/exceptions/user/class_UnexpectedGuestAccountException.php +++ b/framework/main/exceptions/user/class_UnexpectedGuestAccountException.php @@ -31,16 +31,16 @@ class UnexpectedGuestAccountException extends FrameworkException { /** * The super constructor for all exceptions * - * @param $msgArray The non-optional message for the exception + * @param $messageArray The non-optional message for the exception * @param $code An optional code for better debugging * @return void */ - public function __construct (array $msgArray, $code = 0) { + public function __construct (array $messageArray, $code = 0) { // Create the message $message = sprintf('[%s:%d] User %s is a guest account.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1] + $messageArray[1] ); // Make sure everything is assigned properly diff --git a/framework/main/exceptions/user/class_UserEmailMissingException.php b/framework/main/exceptions/user/class_UserEmailMissingException.php index 4f49adbd..19d57367 100644 --- a/framework/main/exceptions/user/class_UserEmailMissingException.php +++ b/framework/main/exceptions/user/class_UserEmailMissingException.php @@ -31,16 +31,16 @@ class UserEmailMissingException extends FrameworkException { /** * The super constructor for all exceptions * - * @param $msgArray The non-optional message for the exception + * @param $messageArray The non-optional message for the exception * @param $code An optional code for better debugging * @return void */ - public function __construct (array $msgArray, $code = 0) { + public function __construct (array $messageArray, $code = 0) { // Create the message $message = sprintf('[%s:%d] User email %s was not found.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1] + $messageArray[1] ); // Make sure everything is assigned properly diff --git a/framework/main/exceptions/user/class_UserNoGuestException.php b/framework/main/exceptions/user/class_UserNoGuestException.php index 689b0c78..7f1f5121 100644 --- a/framework/main/exceptions/user/class_UserNoGuestException.php +++ b/framework/main/exceptions/user/class_UserNoGuestException.php @@ -33,17 +33,17 @@ class UserNoGuestException extends FrameworkException { /** * The super constructor for all exceptions * - * @param $msgArray The non-optional message for the exception + * @param $messageArray The non-optional message for the exception * @param $code An optional code for better debugging * @return void */ - public function __construct (array $msgArray, $code = 0) { + public function __construct (array $messageArray, $code = 0) { // Create the message $message = sprintf('[%s:%d] User %s is not a guest account: %s', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1], - $msgArray[0]->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) + $messageArray[1], + $messageArray[0]->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) ); // Make sure everything is assigned properly diff --git a/framework/main/exceptions/user/class_UserPasswordMismatchException.php b/framework/main/exceptions/user/class_UserPasswordMismatchException.php index 775d45df..62b787d0 100644 --- a/framework/main/exceptions/user/class_UserPasswordMismatchException.php +++ b/framework/main/exceptions/user/class_UserPasswordMismatchException.php @@ -31,16 +31,16 @@ class UserPasswordMismatchException extends FrameworkException { /** * The super constructor for all exceptions * - * @param $msgArray The non-optional message for the exception + * @param $messageArray The non-optional message for the exception * @param $code An optional code for better debugging * @return void */ - public function __construct (array $msgArray, $code = 0) { + public function __construct (array $messageArray, $code = 0) { // Create the message $message = sprintf('[%s:%d] Supplied password for user %s did not match with stored password.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1]->getUserName() + $messageArray[1]->getUserName() ); // Make sure everything is assigned properly diff --git a/framework/main/exceptions/user/class_UsernameMissingException.php b/framework/main/exceptions/user/class_UsernameMissingException.php index 56cdfd44..aad7c357 100644 --- a/framework/main/exceptions/user/class_UsernameMissingException.php +++ b/framework/main/exceptions/user/class_UsernameMissingException.php @@ -31,16 +31,16 @@ class UsernameMissingException extends FrameworkException { /** * The super constructor for all exceptions * - * @param $msgArray The non-optional message for the exception + * @param $messageArray The non-optional message for the exception * @param $code An optional code for better debugging * @return void */ - public function __construct (array $msgArray, $code = 0) { + public function __construct (array $messageArray, $code = 0) { // Create the message $message = sprintf('[%s:%d] Username %s was not found.', - $msgArray[0]->__toString(), + $messageArray[0]->__toString(), $this->getLine(), - $msgArray[1] + $messageArray[1] ); // Make sure everything is assigned properly diff --git a/framework/main/exceptions/xml/class_InvalidXmlNodeException.php b/framework/main/exceptions/xml/class_InvalidXmlNodeException.php index d86a29e9..454c8d5c 100644 --- a/framework/main/exceptions/xml/class_InvalidXmlNodeException.php +++ b/framework/main/exceptions/xml/class_InvalidXmlNodeException.php @@ -35,7 +35,7 @@ class InvalidXmlNodeException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Extract attributes $attributes = 'None'; if ((is_array($classArray[2])) && (count($classArray[2]) > 0)) { diff --git a/framework/main/exceptions/xml/class_XmlNodeMismatchException.php b/framework/main/exceptions/xml/class_XmlNodeMismatchException.php index 8c3e879e..9d37f151 100644 --- a/framework/main/exceptions/xml/class_XmlNodeMismatchException.php +++ b/framework/main/exceptions/xml/class_XmlNodeMismatchException.php @@ -35,7 +35,7 @@ class XmlNodeMismatchException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Construct our message $message = sprintf('[%s:%d] XML nodes mismatch. Given: %s, Expected: %s', $classArray[0]->__toString(), diff --git a/framework/main/exceptions/xml/class_XmlParserException.php b/framework/main/exceptions/xml/class_XmlParserException.php index e01226f6..c9ca3e0f 100644 --- a/framework/main/exceptions/xml/class_XmlParserException.php +++ b/framework/main/exceptions/xml/class_XmlParserException.php @@ -35,7 +35,7 @@ class XmlParserException extends FrameworkException { * @param $code Error code * @return void */ - public function __construct (array $classArray, $code) { + public function __construct (array $classArray, int $code) { // Construct our message $message = sprintf('[%s:%d] XML Error: %s at line %d.', $classArray[0]->__toString(), diff --git a/framework/main/interfaces/criteria/class_Criteria.php b/framework/main/interfaces/criteria/class_Criteria.php index 30fb3ab5..964d6394 100644 --- a/framework/main/interfaces/criteria/class_Criteria.php +++ b/framework/main/interfaces/criteria/class_Criteria.php @@ -34,7 +34,7 @@ interface Criteria extends FrameworkInterface { * @param $wrapperConfigEntry Configuration entry which hold the wrapper class' name * @return void */ - function setWrapperConfigEntry ($wrapperConfigEntry); + function setWrapperConfigEntry (string $wrapperConfigEntry); /** * Getter for wrapper class name @@ -50,7 +50,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey Criteria key * @return $isSet Whether key is set */ - function isKeySet ($criteriaType, $criteriaKey); + function isKeySet (string $criteriaType, string $criteriaKey); /** * Checks whether given key is set for 'choice' type @@ -58,7 +58,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey Criteria key * @return $isSet Whether key is set */ - function isChoiceKeySet ($criteriaKey); + function isChoiceKeySet (string $criteriaKey); /** * Checks whether given key is set for 'exclude' type @@ -66,7 +66,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey Criteria key * @return $isSet Whether key is set */ - function isExcludeKeySet ($criteriaKey); + function isExcludeKeySet (string $criteriaKey); /** * Getter for criteria array @@ -74,7 +74,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $criteria */ - function getCriteriaArray ($criteriaType = 'default'); + function getCriteriaArray (string $criteriaType = 'default'); /** * Getter for criteria array 'choice' type @@ -96,7 +96,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey Criteria key to unset * @return void */ - function unsetCriteria ($criteriaKey); + function unsetCriteria (string $criteriaKey); /** * Add criteria, this method converts dashes to underscores because dashes @@ -107,7 +107,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return void */ - function addCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default'); + function addCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = 'default'); /** * Sets criteria, this method converts dashes to underscores because dashes @@ -118,7 +118,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return void */ - function setCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default'); + function setCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = 'default'); /** * Add "choice" criteria, this method converts dashes to underscores because @@ -128,7 +128,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaValue Criteria value * @return void */ - function addChoiceCriteria ($criteriaKey, $criteriaValue); + function addChoiceCriteria (string $criteriaKey, $criteriaValue); /** * Add "exclude" criteria, this method converts dashes to underscores because @@ -138,7 +138,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaValue Criteria value * @return void */ - function addExcludeCriteria ($criteriaKey, $criteriaValue); + function addExcludeCriteria (string $criteriaKey, $criteriaValue); /** * Add configured criteria @@ -148,7 +148,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return void */ - function addConfiguredCriteria ($criteriaKey, $configEntry, $criteriaType = 'default'); + function addConfiguredCriteria (string $criteriaKey, string $configEntry, string $criteriaType = 'default'); /** * Get criteria element or false if not found @@ -157,7 +157,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $value Whether the value of the critera or false */ - function getCriteriaElemnent ($criteriaKey, $criteriaType = 'default'); + function getCriteriaElemnent (string $criteriaKey, string $criteriaType = 'default'); /** * Get criteria element or false if not found for 'choice' type @@ -165,7 +165,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey The requested criteria key * @return $value Whether the value of the critera or false */ - function getCriteriaChoiceElemnent ($criteriaKey); + function getCriteriaChoiceElemnent (string $criteriaKey); /** * Get criteria element or false if not found for 'exclude' type @@ -173,7 +173,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaKey The requested criteria key * @return $value Whether the value of the critera or false */ - function getCriteriaExcludeElemnent ($criteriaKey); + function getCriteriaExcludeElemnent (string $criteriaKey); /** * Checks whether given array entry matches @@ -182,7 +182,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $matches Whether the entry matches or not */ - function ifEntryMatches (array $entryArray, $criteriaType = 'default'); + function ifEntryMatches (array $entryArray, string $criteriaType = 'default'); /** * Checks whether given array 'choice' entry matches @@ -207,7 +207,7 @@ interface Criteria extends FrameworkInterface { * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' * @return $cacheKey The key suitable for the cache system */ - function getCacheKey ($onlyKeys = array(), $criteriaType = 'default'); + function getCacheKey (array $onlyKeys = [], string $criteriaType = 'default'); /** * "Getter" for a cache key ('choice' type) @@ -215,7 +215,7 @@ interface Criteria extends FrameworkInterface { * @param $onlyKeys Only use these keys for a cache key * @return $cacheKey The key suitable for the cache system */ - function getCacheKeyChoice ($onlyKeys = array()); + function getCacheKeyChoice (array $onlyKeys = []); /** * "Getter" for a cache key ('exclude' type) @@ -223,16 +223,7 @@ interface Criteria extends FrameworkInterface { * @param $onlyKeys Only use these keys for a cache key * @return $cacheKey The key suitable for the cache system */ - function getCacheKeyExclude ($onlyKeys = array()); - - /** - * Count the criteria, e.g. useful to find out if a database query has no - * limitation (search criteria). - * - * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude' - * @return $count Count of all criteria entries - */ - function count ($criteriaType = 'default'); + function getCacheKeyExclude (array $onlyKeys = []); /** * Count 'choice' criteria, e.g. useful to find out if a database query diff --git a/framework/main/interfaces/database/class_DatabaseWrapper.php b/framework/main/interfaces/database/class_DatabaseWrapper.php index c45908bb..87352f00 100644 --- a/framework/main/interfaces/database/class_DatabaseWrapper.php +++ b/framework/main/interfaces/database/class_DatabaseWrapper.php @@ -51,7 +51,7 @@ interface DatabaseWrapper extends FrameworkInterface { * @param $onlyKeys Only use these keys for a cache key * @return $resultInstance An instance of a database result class */ - function doSelectByCriteria(Criteria $criteriaInstance, array $onlyKeys = array()); + function doSelectByCriteria(Criteria $criteriaInstance, array $onlyKeys = []); /** * Count the numbers of rows we shall receive @@ -60,7 +60,7 @@ interface DatabaseWrapper extends FrameworkInterface { * @param $onlyKeys Only use these keys for a cache key * @return $numRows Numbers of rows of database entries */ - function doSelectCountByCriteria(Criteria $criteriaInstance, $onlyKeys = array()); + function doSelectCountByCriteria(Criteria $criteriaInstance, array $onlyKeys = []); /** * Getter for primary key used in wrapped table diff --git a/framework/main/interfaces/io/directory/class_FrameworkDirectory.php b/framework/main/interfaces/io/directory/class_FrameworkDirectory.php index 52a7af62..a26a4591 100644 --- a/framework/main/interfaces/io/directory/class_FrameworkDirectory.php +++ b/framework/main/interfaces/io/directory/class_FrameworkDirectory.php @@ -41,7 +41,7 @@ interface FrameworkDirectory extends FrameworkInterface { * @param $except Some parts of a directory we want to ignore. Valid: directory and file names, other values will be silently ignored * @return SplFileInfo An instance of a SplFileInfo class */ - function readDirectoryExcept (array $except = array()); + function readDirectoryExcept (array $except = []); /** * Close a directory source and set it's instance to null and the path name -- 2.39.2