From 60f9b6bef3b79c8369ee47c2c9f709c5e209f1b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 1 Feb 2025 00:08:12 +0100 Subject: [PATCH] Continued: - more scalar type-hints - lesser debugOutput() deprecated) method invocations - updated composer.lock --- composer.lock | 148 ++++++++++++------ .../main/classes/auth/class_CookieAuth.php | 14 +- .../main/classes/cache/class_MemoryCache.php | 14 +- .../classes/client/http/class_HttpClient.php | 12 +- .../main/classes/filter/class_FilterChain.php | 11 +- .../index/file/class_BaseFileIndex.php | 18 +-- .../index/file/stack/class_FileStackIndex.php | 8 +- .../iterator/file/class_FileIterator.php | 2 +- .../classes/parser/xml/class_XmlParser.php | 8 +- .../crypto/null/class_NullCryptoStream.php | 2 +- .../crypto/openssl/class_OpenSslStream.php | 4 +- .../template/class_BaseTemplateEngine.php | 16 +- .../interfaces/auth/class_Authorizeable.php | 30 ++++ .../main/interfaces/cache/class_Cacheable.php | 8 +- 14 files changed, 192 insertions(+), 103 deletions(-) diff --git a/composer.lock b/composer.lock index e2ea515b..49adea96 100644 --- a/composer.lock +++ b/composer.lock @@ -69,16 +69,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.3.1", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -121,9 +121,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-10-08T18:51:32+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "phar-io/manifest", @@ -245,16 +245,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "11.0.7", + "version": "11.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f7f08030e8811582cc459871d28d6f5a1a4d35ca" + "reference": "418c59fd080954f8c4aa5631d9502ecda2387118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f7f08030e8811582cc459871d28d6f5a1a4d35ca", - "reference": "f7f08030e8811582cc459871d28d6f5a1a4d35ca", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/418c59fd080954f8c4aa5631d9502ecda2387118", + "reference": "418c59fd080954f8c4aa5631d9502ecda2387118", "shasum": "" }, "require": { @@ -273,7 +273,7 @@ "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^11.4.1" + "phpunit/phpunit": "^11.5.0" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -311,7 +311,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.7" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.8" }, "funding": [ { @@ -319,7 +319,7 @@ "type": "github" } ], - "time": "2024-10-09T06:21:38+00:00" + "time": "2024-12-11T12:34:27+00:00" }, { "name": "phpunit/php-file-iterator", @@ -568,16 +568,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.4.3", + "version": "11.5.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e8e8ed1854de5d36c088ec1833beae40d2dedd76" + "reference": "3c3ae14c90f244cdda95028c3e469028e8d1c02c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e8e8ed1854de5d36c088ec1833beae40d2dedd76", - "reference": "e8e8ed1854de5d36c088ec1833beae40d2dedd76", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3c3ae14c90f244cdda95028c3e469028e8d1c02c", + "reference": "3c3ae14c90f244cdda95028c3e469028e8d1c02c", "shasum": "" }, "require": { @@ -587,25 +587,26 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.2", - "phpunit/php-code-coverage": "^11.0.7", + "phpunit/php-code-coverage": "^11.0.8", "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-invoker": "^5.0.1", "phpunit/php-text-template": "^4.0.1", "phpunit/php-timer": "^7.0.1", "sebastian/cli-parser": "^3.0.2", - "sebastian/code-unit": "^3.0.1", - "sebastian/comparator": "^6.1.1", + "sebastian/code-unit": "^3.0.2", + "sebastian/comparator": "^6.3.0", "sebastian/diff": "^6.0.2", "sebastian/environment": "^7.2.0", - "sebastian/exporter": "^6.1.3", + "sebastian/exporter": "^6.3.0", "sebastian/global-state": "^7.0.2", "sebastian/object-enumerator": "^6.0.1", "sebastian/type": "^5.1.0", - "sebastian/version": "^5.0.2" + "sebastian/version": "^5.0.2", + "staabm/side-effects-detector": "^1.0.5" }, "suggest": { "ext-soap": "To be able to generate mocks based on WSDL files" @@ -616,7 +617,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "11.4-dev" + "dev-main": "11.5-dev" } }, "autoload": { @@ -648,7 +649,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.4.3" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.6" }, "funding": [ { @@ -664,7 +665,7 @@ "type": "tidelift" } ], - "time": "2024-10-28T13:07:50+00:00" + "time": "2025-01-31T07:03:30+00:00" }, { "name": "sebastian/cli-parser", @@ -725,23 +726,23 @@ }, { "name": "sebastian/code-unit", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "6bb7d09d6623567178cf54126afa9c2310114268" + "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/6bb7d09d6623567178cf54126afa9c2310114268", - "reference": "6bb7d09d6623567178cf54126afa9c2310114268", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", + "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", "shasum": "" }, "require": { "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^11.5" }, "type": "library", "extra": { @@ -770,7 +771,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", "security": "https://github.com/sebastianbergmann/code-unit/security/policy", - "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.2" }, "funding": [ { @@ -778,7 +779,7 @@ "type": "github" } ], - "time": "2024-07-03T04:44:28+00:00" + "time": "2024-12-12T09:59:06+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -838,16 +839,16 @@ }, { "name": "sebastian/comparator", - "version": "6.2.1", + "version": "6.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739" + "reference": "d4e47a769525c4dd38cea90e5dcd435ddbbc7115" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/43d129d6a0f81c78bee378b46688293eb7ea3739", - "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/d4e47a769525c4dd38cea90e5dcd435ddbbc7115", + "reference": "d4e47a769525c4dd38cea90e5dcd435ddbbc7115", "shasum": "" }, "require": { @@ -860,6 +861,9 @@ "require-dev": { "phpunit/phpunit": "^11.4" }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" + }, "type": "library", "extra": { "branch-alias": { @@ -903,7 +907,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/6.2.1" + "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.0" }, "funding": [ { @@ -911,7 +915,7 @@ "type": "github" } ], - "time": "2024-10-31T05:30:08+00:00" + "time": "2025-01-06T10:28:19+00:00" }, { "name": "sebastian/complexity", @@ -1104,16 +1108,16 @@ }, { "name": "sebastian/exporter", - "version": "6.1.3", + "version": "6.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e" + "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", - "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/3473f61172093b2da7de1fb5782e1f24cc036dc3", + "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3", "shasum": "" }, "require": { @@ -1122,7 +1126,7 @@ "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^11.2" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { @@ -1170,7 +1174,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/6.1.3" + "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.0" }, "funding": [ { @@ -1178,7 +1182,7 @@ "type": "github" } ], - "time": "2024-07-03T04:56:19+00:00" + "time": "2024-12-05T09:17:50+00:00" }, { "name": "sebastian/global-state", @@ -1589,6 +1593,58 @@ ], "time": "2024-10-09T05:16:32+00:00" }, + { + "name": "staabm/side-effects-detector", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" + }, + "funding": [ + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2024-10-20T05:08:20+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.3", diff --git a/framework/main/classes/auth/class_CookieAuth.php b/framework/main/classes/auth/class_CookieAuth.php index e14fd5df..5ea4d9dc 100644 --- a/framework/main/classes/auth/class_CookieAuth.php +++ b/framework/main/classes/auth/class_CookieAuth.php @@ -47,7 +47,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera * @param $responseInstance An instance of a Responseable class * @return $loginInstance An instance of this login class */ - public static final function createCookieAuth (Responseable $responseInstance) { + public static final function createCookieAuth (Responseable $responseInstance): Authorizeable { // Get a new instance $loginInstance = new CookieAuth(); @@ -61,7 +61,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera * @param $userName The username from request we shall set * @return void */ - public function setUserAuth (string $userName) { + public function setUserAuth (string $userName): void { FrameworkBootstrap::getResponseInstance()->addCookie('username', $userName); } @@ -71,7 +71,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera * @param $passHash The hashed password from request we shall set * @return void */ - public function setPasswordAuth (string $passHash) { + public function setPasswordAuth (string $passHash): void { FrameworkBootstrap::getResponseInstance()->addCookie('u_hash', $passHash); } @@ -80,7 +80,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera * * @return $userName Username to get from cookie */ - public function getUserAuth () { + public function getUserAuth (): string { // Get the username from cookie $userName = FrameworkBootstrap::getRequestInstance()->readCookie('username'); @@ -93,7 +93,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera * * @return $passHash Password hash to get from cookie */ - public function getPasswordAuth () { + public function getPasswordAuth (): string { // Get the username from cookie $passHash = FrameworkBootstrap::getRequestInstance()->readCookie('u_hash'); @@ -106,7 +106,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera * * @return void */ - public function destroyAuthData () { + public function destroyAuthData (): void { // Expire both cookies FrameworkBootstrap::getResponseInstance()->expireCookie('username'); FrameworkBootstrap::getResponseInstance()->expireCookie('u_hash'); @@ -117,7 +117,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera * * @return void */ - public function updateAuthData () { + public function updateAuthData (): void { FrameworkBootstrap::getResponseInstance()->refreshCookie('username'); FrameworkBootstrap::getResponseInstance()->refreshCookie('u_hash'); } diff --git a/framework/main/classes/cache/class_MemoryCache.php b/framework/main/classes/cache/class_MemoryCache.php index 2294ba7e..a5b06bbe 100644 --- a/framework/main/classes/cache/class_MemoryCache.php +++ b/framework/main/classes/cache/class_MemoryCache.php @@ -51,7 +51,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable { * * @return $cacheInstance An instance of this cache class */ - public static final function createMemoryCache () { + public static final function createMemoryCache (): Cacheable { // Get a new instance $cacheInstance = new MemoryCache(); @@ -67,7 +67,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable { * * @return void */ - protected function initCache () { + protected function initCache (): void { // Now create the "data cache" $this->dataCache = new FrameworkArrayObject('FakedDataCache'); } @@ -80,7 +80,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable { * @param $minimumCount If array element is found then this count must at least match * @return $exists Whether the offset exists */ - public function offsetExists ($offset, $arrayElement = NULL, $minimumCount = 0) { + public function offsetExists (int $offset, $arrayElement = NULL, int $minimumCount = 0): bool { // Is it there? $exists = $this->dataCache->offsetExists($offset); @@ -110,7 +110,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable { * @param $data Data to store in cache * @return void */ - public function offsetSet ($offset, $data) { + public function offsetSet (int $offset, $data): void { $this->dataCache->offsetSet($offset, $data); } @@ -120,7 +120,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable { * @param $offset The offset we shall set * @return $data Data to store in cache */ - public function offsetGet ($offset) { + public function offsetGet (int $offset): mixed { // Default is offset not found $data = NULL; @@ -140,11 +140,11 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable { * @param $offset The offset we shall set * @return void */ - public function purgeOffset ($offset) { + public function purgeOffset (int $offset): mixed { // Is the offset there? if ($this->offsetExists($offset)) { // Purge only existing keys - //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHE: Unsetting cache ' . $offset); + //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CACHE: Unsetting cache ' . $offset); $this->dataCache->offsetUnset($offset); } } diff --git a/framework/main/classes/client/http/class_HttpClient.php b/framework/main/classes/client/http/class_HttpClient.php index 4864ef6d..0fa97051 100644 --- a/framework/main/classes/client/http/class_HttpClient.php +++ b/framework/main/classes/client/http/class_HttpClient.php @@ -117,7 +117,7 @@ class HttpClient extends BaseClient implements Client { $responseArray = $this->doConnectRequest($host, $port); // Check array - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: responseArray()=%d', count($responseArray))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('HTTP-CLIENT: responseArray()=%d', count($responseArray))); if (count($responseArray) < 2) { // Not expected count throw new UnexpectedValueException(sprintf('responseArray()=%d must have at least two elements', count($responseArray)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE); @@ -161,15 +161,15 @@ class HttpClient extends BaseClient implements Client { //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HTTP-CLIENT: rawRequest=' . $rawRequest); // Write request - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: Sending %d bytes to this->socketResource=%s ...', strlen($rawRequest), $this->getSocketResource())); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('HTTP-CLIENT: Sending %d bytes to this->socketResource=%s ...', strlen($rawRequest), $this->getSocketResource())); fwrite($this->getSocketResource(), $rawRequest); // Got response? $feof = feof($this->getSocketResource()); - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: this->socketResource=%s,feof=%d', $this->getSocketResource(), intval($feof))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('HTTP-CLIENT: this->socketResource=%s,feof=%d', $this->getSocketResource(), intval($feof))); if ($feof) { // No response received - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: this->socketResource=%s has reached EOF - EXIT!', $this->getSocketResource())); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('HTTP-CLIENT: this->socketResource=%s has reached EOF - EXIT!', $this->getSocketResource())); return $response; } @@ -177,7 +177,7 @@ class HttpClient extends BaseClient implements Client { $rawResponse = trim(fgets($this->getSocketResource(), 10240)); // "Explode" the string to an array - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: Received %d bytes back from this->socketResource=%s ...', strlen($rawResponse), $this->getSocketResource())); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('HTTP-CLIENT: Received %d bytes back from this->socketResource=%s ...', strlen($rawResponse), $this->getSocketResource())); $responseArray = explode(' ', $rawResponse); // And return it @@ -210,7 +210,7 @@ class HttpClient extends BaseClient implements Client { ]; // Prepare raw request - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: Invoking this->sendRawHttpRequest(CONNECT,%s,%d,headers()=%d) ...', $host, $port, count($headers))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('HTTP-CLIENT: Invoking this->sendRawHttpRequest(CONNECT,%s,%d,headers()=%d) ...', $host, $port, count($headers))); $responseArray = $this->sendRawHttpRequest('CONNECT', $host, $port, $headers); // Return response array diff --git a/framework/main/classes/filter/class_FilterChain.php b/framework/main/classes/filter/class_FilterChain.php index c783d189..a58bfef5 100644 --- a/framework/main/classes/filter/class_FilterChain.php +++ b/framework/main/classes/filter/class_FilterChain.php @@ -124,19 +124,22 @@ class FilterChain extends BaseFrameworkSystem implements Registerable { */ public function processFilters (Requestable $requestInstance, Responseable $responseInstance) { // Run all filters - //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('COUNT=' . $this->countGenericArray('filters')); + //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('COUNT=' . $this->countGenericArray('filters')); foreach ($this->getFilters() as $filterInstance) { // Try to execute this filter try { - //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing started.'); + //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('FILTER: ' . $filterInstance->__toString() . ': Processing started.'); $filterInstance->execute($requestInstance, $responseInstance); - //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing ended.'); + //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('FILTER: ' . $filterInstance->__toString() . ': Processing ended.'); } catch (FilterChainException $e) { // This exception can be thrown to just skip any further processing - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage()); + self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage()); break; } } + + // Trace message + /* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('EXIT!'); } } diff --git a/framework/main/classes/index/file/class_BaseFileIndex.php b/framework/main/classes/index/file/class_BaseFileIndex.php index 8b67d7e0..126a93f3 100644 --- a/framework/main/classes/index/file/class_BaseFileIndex.php +++ b/framework/main/classes/index/file/class_BaseFileIndex.php @@ -72,11 +72,11 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer { $headerSize = $this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize(); // Then read it (see constructor for calculation) - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: headerSize=%d', $headerSize)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: headerSize=%d', $headerSize)); $data = $this->getIteratorInstance()->getBinaryFileInstance()->read($headerSize); // Have all requested bytes been read? - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Read %d bytes (%d wanted).', strlen($data), $this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize())); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: Read %d bytes (%d wanted).', strlen($data), $this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize())); if (strlen($data) != $this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()) { // Invalid header length throw new UnexpectedValueException(sprintf('data(%d)=%s is not expected length %d', @@ -112,15 +112,15 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer { $header = explode(chr(BinaryFile::SEPARATOR_HEADER_DATA), $data); // Map numeric entries to associative (alpha-numeric) elements - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header))); - //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: header(%d)=%s', count($header), print_r($header, true))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: Invoking ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header))); + //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: header(%d)=%s', count($header), print_r($header, true))); $header = ArrayUtils::mapNumericKeysToAssociative($header, [ BinaryFile::HEADER_NAME_MAGIC, BinaryFile::HEADER_NAME_TOTAL_ENTRIES, ]); // Check if the array has only 2 elements - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: HEADER_INDEX_ELEMENT_COUNT=%d,header()=%d', BinaryFile::HEADER_INDEX_ELEMENT_COUNT, count($header))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: HEADER_INDEX_ELEMENT_COUNT=%d,header()=%d', BinaryFile::HEADER_INDEX_ELEMENT_COUNT, count($header))); if (count($header) != BinaryFile::HEADER_INDEX_ELEMENT_COUNT) { // Bad header throw new UnexpectedValueException(sprintf('header()=%d is not expected value %d', count($header), BinaryFile::HEADER_INDEX_ELEMENT_COUNT), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE); @@ -165,7 +165,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer { ); // Write it to disk (header is always at seek position 0) - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(0, header=%s) ...', $header)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(0, header=%s) ...', $header)); $this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition(0, $header); // Trace message @@ -199,7 +199,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer { ); // Set it - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Setting headerSize=%d ...', $headerSize)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: Setting headerSize=%d ...', $headerSize)); $this->getIteratorInstance()->getBinaryFileInstance()->setHeaderSize($headerSize); // Init counters and gaps array @@ -228,7 +228,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer { $this->readIndexHeader(); // Freshly created? - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: created=%d', intval($created))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: created=%d', intval($created))); if (!$created) { // Analyze file structure /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->analyzeFileStructure() ...'); @@ -320,7 +320,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer { } // Call iterated object's method - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(%d, %s) ...', $seekPosition, $dataStream)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(%d, %s) ...', $seekPosition, $dataStream)); $status = $this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition($seekPosition, $dataStream); // Return status diff --git a/framework/main/classes/index/file/stack/class_FileStackIndex.php b/framework/main/classes/index/file/stack/class_FileStackIndex.php index f47f423c..ea8ef7ca 100644 --- a/framework/main/classes/index/file/stack/class_FileStackIndex.php +++ b/framework/main/classes/index/file/stack/class_FileStackIndex.php @@ -106,21 +106,21 @@ class FileStackIndex extends BaseFileIndex implements IndexableStack, Registerab Indexable::SEPARATOR_GAP_LENGTH, $data[StackableFile::ARRAY_NAME_DATA_LENGTH] ); - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,rawData(%d)=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), strlen($rawData), $rawData)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,rawData(%d)=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), strlen($rawData), $rawData)); // Search for next free gap - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->searchNextGap(%d) ...', strlen($rawData))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->searchNextGap(%d) ...', strlen($rawData))); $gapPosition = $this->getIteratorInstance()->getBinaryFileInstance()->searchNextGap(strlen($rawData)); // Gap position cannot be smaller or equal than header length - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,gapPosition=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), $gapPosition)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,gapPosition=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), $gapPosition)); if ($gapPosition <= ($this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize() + 1)) { // Not valid gap position returned throw new UnexpectedValueException(sprintf('gapPosition[%s]=%d is smaller or equal headerSize+1=%d', gettype($gapPosition), $gapPosition, ($this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize() + 1)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE); } // Then write the data at that gap - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeData(%d,%s) ...', $gapPosition, $rawData)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeData(%d,%s) ...', $gapPosition, $rawData)); $this->getIteratorInstance()->getBinaryFileInstance()->writeData($gapPosition, $rawData); // Trace message diff --git a/framework/main/classes/iterator/file/class_FileIterator.php b/framework/main/classes/iterator/file/class_FileIterator.php index 02554538..305f7c59 100644 --- a/framework/main/classes/iterator/file/class_FileIterator.php +++ b/framework/main/classes/iterator/file/class_FileIterator.php @@ -166,7 +166,7 @@ class FileIterator extends BaseIterator implements SeekableIterator { */ public function seek (int $seekPosition): void { // Validate parameter - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-ITERATOR: seekPosition=%d,whence=%d - CALLED!', $seekPosition, $whence)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-ITERATOR: seekPosition=%d,whence=%d - CALLED!', $seekPosition, $whence)); if ($seekPosition < 0) { // Throw IAE throw new OutOfBoundsException(sprintf('seekPosition=%d is not valid', $seekPosition)); diff --git a/framework/main/classes/parser/xml/class_XmlParser.php b/framework/main/classes/parser/xml/class_XmlParser.php index 8e2584be..c0409130 100644 --- a/framework/main/classes/parser/xml/class_XmlParser.php +++ b/framework/main/classes/parser/xml/class_XmlParser.php @@ -90,7 +90,7 @@ class XmlParser extends BaseParser implements Parseable { $xmlParser = xml_parser_create(); // Force case-folding to on - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('XML-PARSER: Created xmlParser=%s ...', $xmlParser)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('XML-PARSER: Created xmlParser=%s ...', $xmlParser)); xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, TRUE); // Set UTF-8 @@ -104,7 +104,7 @@ class XmlParser extends BaseParser implements Parseable { xml_set_character_data_handler($xmlParser, 'characterHandler'); // Now parse the XML tree - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('XML-PARSER: Invoking xml_parse(%s, content()=%d) ...', $xmlParser, strlen($content))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('XML-PARSER: Invoking xml_parse(%s, content()=%d) ...', $xmlParser, strlen($content))); if (!xml_parse($xmlParser, $content)) { // Error found in XML //* DEBUG: */ exit(__METHOD__ . ':
'.htmlentities($content).'
'); @@ -112,11 +112,11 @@ class XmlParser extends BaseParser implements Parseable { } // Free the parser - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('XML-PARSER: Freeing xmlParser=%s ...', $xmlParser)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('XML-PARSER: Freeing xmlParser=%s ...', $xmlParser)); xml_parser_free($xmlParser); // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('XML-PARSER: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('XML-PARSER: EXIT!'); } } diff --git a/framework/main/classes/streams/crypto/null/class_NullCryptoStream.php b/framework/main/classes/streams/crypto/null/class_NullCryptoStream.php index ed7f37aa..9c950ef2 100644 --- a/framework/main/classes/streams/crypto/null/class_NullCryptoStream.php +++ b/framework/main/classes/streams/crypto/null/class_NullCryptoStream.php @@ -87,7 +87,7 @@ class NullCryptoStream extends BaseCryptoStream implements EncryptableStream { * @throws UnsupportedOperationException If this method is called (which is a mistake) */ public function streamData (string $data) { - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); + self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('Unhandled ' . strlen($data) . ' bytes in this stream.'); throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/framework/main/classes/streams/crypto/openssl/class_OpenSslStream.php b/framework/main/classes/streams/crypto/openssl/class_OpenSslStream.php index e69c4a1f..bcc56ce8 100644 --- a/framework/main/classes/streams/crypto/openssl/class_OpenSslStream.php +++ b/framework/main/classes/streams/crypto/openssl/class_OpenSslStream.php @@ -71,7 +71,7 @@ class OpenSslStream extends BaseCryptoStream implements EncryptableStream { return $str; // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('OPENSSL-STREAM: key[' . gettype($key) . ']=' . $key); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('OPENSSL-STREAM: key[' . gettype($key) . ']=' . $key); // Init crypto module $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); @@ -177,7 +177,7 @@ class OpenSslStream extends BaseCryptoStream implements EncryptableStream { * @throws UnsupportedOperationException If this method is called (which is a mistake) */ public function streamData (string $data) { - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.'); + self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('Unhandled ' . strlen($data) . ' bytes in this stream.'); throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION); } diff --git a/framework/main/classes/template/class_BaseTemplateEngine.php b/framework/main/classes/template/class_BaseTemplateEngine.php index c29e0644..e854c172 100644 --- a/framework/main/classes/template/class_BaseTemplateEngine.php +++ b/framework/main/classes/template/class_BaseTemplateEngine.php @@ -1007,14 +1007,14 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem { // RECURSIVE PROTECTION! BE CAREFUL HERE! if ((!isset($this->loadedRawData[$template])) && (!in_array($template, $this->loadedTemplates))) { // Template not found, but maybe variable assigned? - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: template=%s not loaded yet', $template)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: template=%s not loaded yet', $template)); if ($this->getVariableIndex($template) !== false) { // Use that content here - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Assigning this->loadedTemplateData[%s] from variable template=%s ...', $template, $template)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Assigning this->loadedTemplateData[%s] from variable template=%s ...', $template, $template)); $this->loadedRawData[$template] = $this->readVariable($template); // Recursive protection: - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template)); array_push($this->loadedTemplates, $template); } else { // Then try to search for code-templates @@ -1025,16 +1025,16 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem { $this->loadCodeTemplate($template); // ... and remember it's contents - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Setting this->loadedRawData[%s] from this->rawTemplateData ...', $template)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Setting this->loadedRawData[%s] from this->rawTemplateData ...', $template)); $this->loadedRawData[$template] = $this->getRawTemplateData(); // Remember this template for recursion detection // RECURSIVE PROTECTION! - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template)); array_push($this->loadedTemplates, $template); } catch (FileNotFoundException $e) { // Even this is not done... :/ - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template)); array_push($this->rawTemplates, $template); } } @@ -1084,7 +1084,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem { $this->compileTemplate(); // 4. Remember it's contents - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Setting this->loadedRawData[%s] from this->rawTemplateData ...', $template)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Setting this->loadedRawData[%s] from this->rawTemplateData ...', $template)); $this->loadedRawData[$template] = $this->getRawTemplateData(); // 5. Restore the previous raw content from backup variable @@ -1608,7 +1608,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem { // Goes something wrong? if ((!isset($result)) || (empty($result))) { // Output eval command - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Failed eval() code:
%s
', $this->markupCode($eval, true)), true); + self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('Failed eval() code:
%s
', $this->markupCode($eval, true)), true); // Output backtrace here $this->debugBackTrace(); diff --git a/framework/main/interfaces/auth/class_Authorizeable.php b/framework/main/interfaces/auth/class_Authorizeable.php index 00f291f0..472ef98b 100644 --- a/framework/main/interfaces/auth/class_Authorizeable.php +++ b/framework/main/interfaces/auth/class_Authorizeable.php @@ -29,6 +29,36 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface; * along with this program. If not, see . */ interface Authorizeable extends FrameworkInterface { + /** + * "Setter" for username auth data + * + * @param $userName The username from request we shall set + * @return void + */ + function setUserAuth (string $userName): void; + + /** + * "Setter" for password hash auth data + * + * @param $passHash The hashed password from request we shall set + * @return void + */ + function setPasswordAuth (string $passHash): void; + + /** + * Getter for user auth cookie + * + * @return $userName Username to get from cookie + */ + function getUserAuth (): string; + + /** + * Getter for password hash auth cookie + * + * @return $passHash Password hash to get from cookie + */ + function getPasswordAuth (): string; + /** * Destroy the authorization data * diff --git a/framework/main/interfaces/cache/class_Cacheable.php b/framework/main/interfaces/cache/class_Cacheable.php index 51a62878..66e815e2 100644 --- a/framework/main/interfaces/cache/class_Cacheable.php +++ b/framework/main/interfaces/cache/class_Cacheable.php @@ -36,7 +36,7 @@ interface Cacheable extends FrameworkInterface { * @param $minimumCount If array element is found then this count must at least match * @return $exists Whether the offset exists */ - function offsetExists($offset, $arrayElement = NULL, $minimumCount = 0); + function offsetExists(int $offset, $arrayElement = NULL, int $minimumCount = 0): bool; /** * Setter for cache offset @@ -45,7 +45,7 @@ interface Cacheable extends FrameworkInterface { * @param $data Data to store in cache * @return void */ - function offsetSet($offset, $data); + function offsetSet(int $offset, $data): void; /** * Getter for cache offset or "null" if not found @@ -53,7 +53,7 @@ interface Cacheable extends FrameworkInterface { * @param $offset The offset we shall set * @return $data Data to store in cache */ - function offsetGet($offset); + function offsetGet(int $offset): mixed; /** * Purges the given cache entry @@ -61,6 +61,6 @@ interface Cacheable extends FrameworkInterface { * @param $offset The offset we shall set * @return void */ - function purgeOffset($offset); + function purgeOffset(int $offset): mixed; } -- 2.39.5