]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 21 Aug 2025 22:22:20 +0000 (00:22 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 21 Aug 2025 22:40:59 +0000 (00:40 +0200)
- yet even more type-hints ...

25 files changed:
framework/main/classes/file_directories/binary/class_BaseBinaryFile.php
framework/main/classes/file_directories/input/raw/class_FrameworkRawFileInputPointer.php
framework/main/classes/file_directories/input/text/class_FrameworkTextFileInputPointer.php
framework/main/classes/file_directories/io/class_FrameworkFileInputOutputPointer.php
framework/main/classes/file_directories/io_stream/class_FileIoStream.php
framework/main/classes/file_directories/output/raw/class_FrameworkRawFileOutputPointer.php
framework/main/classes/file_directories/output/text/class_FrameworkTextFileOutputPointer.php
framework/main/classes/handler/class_BaseHandler.php
framework/main/classes/index/file/class_BaseFileIndex.php
framework/main/classes/index/file/stack/class_FileStackIndex.php
framework/main/classes/iterator/file/class_FileIterator.php
framework/main/classes/output/class_
framework/main/classes/request/class_BaseRequest.php
framework/main/classes/stacker/file/class_BaseFileStack.php
framework/main/interfaces/handler/class_HandleableDataSet.php
framework/main/interfaces/handler/task/class_HandleableTask.php
framework/main/interfaces/index/class_Indexable.php
framework/main/interfaces/index/file/class_FileIndexer.php
framework/main/interfaces/io/class_CloseableFile.php
framework/main/interfaces/io/class_StreamableInput.php
framework/main/interfaces/io/pointer/class_InputPointer.php
framework/main/interfaces/io/pointer/class_OutputPointer.php
framework/main/interfaces/reader/class_ReadableNews.php
framework/main/interfaces/request/class_Requestable.php
framework/main/middleware/io/class_FileIoHandler.php

index dfcce1b7a3d20454a1d4343dfb02fe62e00ce6dd..f38b417d5c05929557ce393d3c4af0b193c294f0 100644 (file)
@@ -664,7 +664,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         * @return      $status         Status of file seek: 0 = success, -1 = failed
         * @throws      OutOfBoundsException    If the position is not seekable
         */
-       public function seek (int $offset, int $whence = SEEK_SET) {
+       public function seek (int $offset, int $whence = SEEK_SET): int {
                // Validate parameter
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: offset=%d,whence=%d - CALLED!', $offset, $whence));
                if ($offset < 0) {
@@ -687,7 +687,7 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
         * @return      $data   Data read from file
         * @throws      OutOfBoundsException    If the position is not seekable
         */
-       public function read (int $bytes = 0) {
+       public function read (int $bytes = 0): string {
                // Validate parameter
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: bytes=%d - CALLED!', $bytes));
                if ($bytes < 0) {
@@ -921,7 +921,8 @@ abstract class BaseBinaryFile extends BaseAbstractFile implements BinaryFile {
 
                // Now simply write a NUL there. This will pre-allocate the file.
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-BINARY-FILE: Invoking this->writeAtPosition(%d,NUL) ...', $seekPosition));
-               $this->writeAtPosition($seekPosition, chr(0));
+               $status = $this->writeAtPosition($seekPosition, chr(0));
+               // @TODO Handle $status properly
 
                // Is the seek position zero?
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-BINARY-FILE: fileSize=%d', $fileSize));
index 734b97b7e390563877d499bb29f303e327addfea..edbf2ffce96a740127590f3ea6edaadcc5b0fa12 100644 (file)
@@ -141,7 +141,7 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
         * @throws      InvalidArgumentException        If a parameter is not valid
         * @throws      UnexpectedValueException        If fread() returns a non-string value
         */
-       public function read (int $bytes = 0) {
+       public function read (int $bytes = 0): string {
                // Trace message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-INPUT-POINTER: bytes=%d - CALLED!', $bytes));
                if ($bytes < 0) {
index 311829781d699c9ad870e297153bc85e10401065..acfd75ad1c87eb560beb36bfed88e959fc4dc1e1 100644 (file)
@@ -126,7 +126,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
         * @throws      NullPointerException    If the file pointer instance is not set by setFileObject()
         * @throws      LogicException  If $fileObject is not an object
         */
-       public function read (int $bytes = 0) {
+       public function read (int $bytes = 0): string {
                // Some sanity checks
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('RAW-FILE-INPUT-POINTER: bytes=%d - CALLED!', $bytes));
                if ($bytes < 0) {
index b3b4e56eb2f3f246925c7e6978b8a11333e8026e..02fa81a08209ef91251224a7d8fa20e789b61b17 100644 (file)
@@ -239,7 +239,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         * @return      $data   Data read from file
         * @throws      OutOfBoundsException    If the position is not seekable
         */
-       public function read (int $bytes = 0) {
+       public function read (int $bytes = 0): string {
                // Validatre parameter
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-INPUT-OUTPUT-POINTER: bytes=%d - CALLED!', $bytes));
                if ($bytes < 0) {
index b47eb023e4a34af1c496157fcdce8b244ac8b25a..34d16fafca3441b3a722a486af902e0f48af4092 100644 (file)
@@ -317,7 +317,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
         * @return      $data   The data (string mostly) to "stream"
         * @throws      UnsupportedOperationException   If this method is called
         */
-       public function streamData (string $data) {
+       public function streamData (string $data): string {
                // Not supported
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-STREAM: data=()=%d - CALLED!', strlen($data)));
                throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
index 2563475597e4060e598a5355bd6757523ed93428..6517c55c169f6b6d42ce2cd5972feb6578f606a5 100644 (file)
@@ -137,7 +137,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         * @return      mixed                   Number of writes bytes or false on error
         * @throws      UnsupportedOperationException   If this method is called
         */
-       public function writeAtPosition (int $seedPosition, string $data): void {
+       public function writeAtPosition (int $seedPosition, string $data): mixed {
                throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
index fa968671af01412ec0ce0d3fd54aa11b128294b6..754b5ed2644fc7809ae7da052afb2948c8d9c4e4 100644 (file)
@@ -133,7 +133,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
         * @return      mixed                   Number of writes bytes or false on error
         * @throws      UnsupportedOperationException   If this method is called
         */
-       public function writeAtPosition (int $seedPosition, string $data) {
+       public function writeAtPosition (int $seedPosition, string $data): mixed {
                throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
index ef63de38226bf07a293610a68cf33dd010a4af5e..3dd8a67d039c20be2e90682d09cdbfafe9c38886 100644 (file)
@@ -59,7 +59,7 @@ abstract class BaseHandler extends BaseFrameworkSystem implements HandleableData
         *
         * @return      $handlerName    Name of this handler
         */
-       public final function getHandlerName () {
+       public final function getHandlerName (): string {
                return $this->handlerName;
        }
 
@@ -69,7 +69,7 @@ abstract class BaseHandler extends BaseFrameworkSystem implements HandleableData
         * @param       $handlerName    Name of this handler
         * @return      void
         */
-       protected final function setHandlerName (string $handlerName) {
+       protected final function setHandlerName (string $handlerName): void {
                $this->handlerName = $handlerName;
        }
 
@@ -81,7 +81,7 @@ abstract class BaseHandler extends BaseFrameworkSystem implements HandleableData
         * @return      void
         * @todo        Rewrite this to use DHT
         */
-       public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData) {
+       public function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData): void {
                // Check parameter
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HANDLER: dataSetInstance=%s,messageData()=%d - CALLED!', $dataSetInstance->__toString(), count($messageData)));
                if (count($messageData) == 0) {
index 126a93f36e85c199e83ad4fdfc9cf64a9bf072f8..f332c3bff458b77afe831faac9ac69fa05a793f6 100644 (file)
@@ -287,7 +287,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
         * @throws      InvalidArgumentException        If the parameter is not valid
         * @todo        Unfinished work
         */
-       public function searchNextGap (int $length) {
+       public function searchNextGap (int $length): int {
                // Validate parameter
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FILE-INDEX: length=%d - CALLED!', $length));
                if ($length <= 0) {
@@ -308,7 +308,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
         * @throws      OutOfBoundsException    If the position is not seekable
         * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       public function writeAtPosition (int $seekPosition, string $dataStream) {
+       public function writeAtPosition (int $seekPosition, string $dataStream): mixed {
                // Validate parameter
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-FILE-INDEX: seekPosition=%d,dataStream(%d)=%s - CALLED!', $seekPosition, strlen($dataStream), $dataStream));
                if ($seekPosition < 0) {
@@ -333,7 +333,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
         *
         * @return      $isLoaded       Whether this index has been loaded
         */
-       public function isIndexLoaded () {
+       public function isIndexLoaded (): bool {
                // Is the file gaps-only?
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: CALLED!');
                if ($this->getIteratorInstance()->getBinaryFileInstance()->isFileGapsOnly()) {
index ea8ef7ca087ec359e99fba1cd276c98531a126f1..7e538626df73c3ed32c8404e283f7f077c895886 100644 (file)
@@ -54,7 +54,7 @@ class FileStackIndex extends BaseFileIndex implements IndexableStack, Registerab
         * @param       $fileInfoInstance       An instance of a SplFileInfo class
         * @return      $indexInstance  An instance of this Index class
         */
-       public final static function createFileStackIndex (SplFileInfo $fileInfoInstance) {
+       public final static function createFileStackIndex (SplFileInfo $fileInfoInstance): IndexableStack {
                // Get a new instance
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: fileInfoInstance[%s]=%s - CALLED!', get_class($fileInfoInstance), $fileInfoInstance));
                $indexInstance = new FileStackIndex();
@@ -76,7 +76,7 @@ class FileStackIndex extends BaseFileIndex implements IndexableStack, Registerab
         * @throws      InvalidArgumentException        If a parameter is not valid
         * @throws      UnexpectedValueException        If an invalid gap position is being returned
         */
-       public function addHashedDataToIndex (string $stackName, array $data) {
+       public function addHashedDataToIndex (string $stackName, array $data): void {
                // Validate parameter
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: stackName=%s,data()=%d - CALLED!', $stackName, count($data)));
                if (empty($stackName)) {
index 759e6ed110e131bcf42d1009d354bd8a907ec9da..5915427c0eb21a05d66cf941a76174d87fe475ea 100644 (file)
@@ -164,7 +164,7 @@ class FileIterator extends BaseIterator implements SeekableIterator {
         * @return      void
         * @throws      OutOfBoundsException    If the position is not seekable
         */
-       public function seek (int $seekPosition): seek {
+       public function seek (int $seekPosition): int {
                // Validate parameter
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-ITERATOR: seekPosition=%d,whence=%d - CALLED!', $seekPosition, $whence));
                if ($seekPosition < 0) {
index 9d6a07e25953dbff2946e4615a07ef1ef7cbaf30..1dfe10855dfd8208dc8d5a34dc7946f98f1cb897 100644 (file)
@@ -51,11 +51,11 @@ class ???Output extends BaseOutput implements OutputStreamer, Registerable {
         * @param       $applicationInstance    An instance of a ManageableApplication class
         * @return      $debugInstance                  An instance of this middleware class
         */
-       public static final function createWebOutput (ManageableApplication $applicationInstance) {
+       public static final function create???Output (ManageableApplication $applicationInstance): OutputStreamer {
                // Is the self-instance already set?
                if (is_null(self::$!!!Instance)) {
                        // Get a new instance and set it
-                       self::$!!!Instance = new WebOutput();
+                       self::$!!!Instance = new ???Output();
 
                        // Get the content type
                        $contentType = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('!!!_content_type');
@@ -79,7 +79,7 @@ class ???Output extends BaseOutput implements OutputStreamer, Registerable {
         * @return      void
         * @todo        0% done
         */
-       public final function output ($outStream = false, $stripTags = false) {
+       public final function output ($outStream = false, $stripTags = false): void {
                DebugMiddleware::getSelfInstance()->partialStub('Please implement this method. outStream()=' . strlen($outStream) . ',stripTags=' . intval($stripTags));
        }
 
@@ -89,7 +89,7 @@ class ???Output extends BaseOutput implements OutputStreamer, Registerable {
         * @return      $seekPosition   Current seek position
         * @throws      UnsupportedOperationException   If this method is called
         */
-       public function determineSeekPosition () {
+       public function determineSeekPosition (): int {
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
@@ -112,7 +112,7 @@ class ???Output extends BaseOutput implements OutputStreamer, Registerable {
         * @return      $size   Size (in bytes) of file
         * @throws      UnsupportedOperationException   If this method is called
         */
-       public function size () {
+       public function size (): int {
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
index 26b18d891cf7b85c63f29777874582d94ea2449f..5c1269584297dff4a45f166a7125bc45273aff51 100644 (file)
@@ -56,7 +56,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @param       $element        Name of the request element we want to check
         * @return      $isSet          Whether the request element is set
         */
-       public function isRequestElementSet (string $element) {
+       public function isRequestElementSet (string $element): bool {
                // Is this element found?
                $isSet = isset($this->requestData[$element]);
 
@@ -71,7 +71,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @return      $value          Value of the found request element or 'null' if the
         *                                              element was not found
         */
-       public function getRequestElement (string $element) {
+       public function getRequestElement (string $element): mixed {
                // Initialize value
                $value = NULL;
 
@@ -95,7 +95,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @param       $value          Value to set
         * @return      void
         */
-       public function setRequestElement (string $element, $value) {
+       public function setRequestElement (string $element, mixed $value): void {
                $this->requestData[$element] = $value;
        }
 
@@ -105,7 +105,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @param       $requestData    Request element to se
         * @return      void
         */
-       public function setRequestData (array $requestData) {
+       public function setRequestData (array $requestData): void {
                $this->requestData = $requestData;
        }
 
@@ -114,7 +114,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         *
         * @return      $array  An array containing all array keys to return
         */
-       public function getParameterNames () {
+       public function getParameterNames (): array {
                return array_keys($this->requestData);
        }
 
@@ -124,7 +124,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @param       $isValid        Whether the request is valid
         * @return      void
         */
-       public final function setIsRequestValid (bool $isValid) {
+       public final function setIsRequestValid (bool $isValid): void {
                $this->isRequestValid = $isValid;
        }
 
@@ -133,7 +133,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         *
         * @return      $isRequestValid         Whether this request is valid
         */
-       public final function isRequestValid () {
+       public final function isRequestValid (): bool {
                return $this->isRequestValid;
        }
 
index 17af2c39bf2902ceb1d2375b5d78468b8f7676d3..1a34a2c678531b9eadc79140e21bc10f7665b53e 100644 (file)
@@ -208,7 +208,8 @@ abstract class BaseFileStack extends BaseStacker {
 
                // Write it to disk (header is always at seek position 0)
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Invoking this->iteratorInstance->writeAtPosition(0, header=%s) ...', $header));
-               $this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition(0, $header);
+               $status = $this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition(0, $header);
+               // @TODO Handle $status
 
                // Trace message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: EXIT!');
index 42be03fba6c897ecc975db25d7d8fc5dc6b5a8c2..237b2337821157ae7e2a133f93afb440dd49d80f 100644 (file)
@@ -36,6 +36,13 @@ interface HandleableDataSet extends Handleable {
         * @param       $messageData            An array with all message data
         * @return      void
         */
-       function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData);
+       function addArrayToDataSet (StoreableCriteria $dataSetInstance, array $messageData): void;
+
+       /**
+        * Getter for handler name
+        *
+        * @return<>$handlerNameName of this handler
+        */
+       function getHandlerName (): string;
 
 }
index c7ace208d456b190401279e8f9365d70724c1262..1e7fa600cca15e6226506c177b5dc4b29595b057 100644 (file)
@@ -37,7 +37,7 @@ interface HandleableTask extends HandleableDataSet {
         * @param       $taskInstanc    An instanceof a Taskable class
         * @return      $taskName               Name of the task as used while registration
         */
-       function searchTask (Taskable $taskInstance);
+       function searchTask (Taskable $taskInstance): string;
 
        /**
         * Registers a task with a task handler.
@@ -46,7 +46,7 @@ interface HandleableTask extends HandleableDataSet {
         * @param       $taskInstance   An instance of a Taskable class
         * @return      void
         */
-       function registerTask (string $taskName, Taskable $taskInstance);
+       function registerTask (string $taskName, Taskable $taskInstance): void;
 
        /**
         * Checks whether tasks are left including idle task
@@ -63,7 +63,7 @@ interface HandleableTask extends HandleableDataSet {
         *
         * @return      void
         */
-       function handleTasks ();
+       function handleTasks (): void;
 
        /**
         * Shuts down all tasks and the task handler itself. This method should be
@@ -71,6 +71,6 @@ interface HandleableTask extends HandleableDataSet {
         * 
         * @return      void
         */
-       function doShutdown ();
+       function doShutdown (): void;
 
 }
index f5da8e4f45b394e830a6de363d54c709c0a17ccc..9e1724e53cac985ae142c11e6257ebce9a19c4e8 100644 (file)
@@ -53,6 +53,6 @@ interface Indexable extends FrameworkInterface {
         *
         * @return      $isLoaded       Whether the index has been loaded
         */
-       function isIndexLoaded ();
+       function isIndexLoaded (): bool;
 
 }
index e2d85910510b5f628bfae869cba1d01c7a01f1bf..1eae3bf7ef6f15d06a4537c6529e50f6a5c2e9e1 100644 (file)
@@ -36,7 +36,7 @@ interface FileIndexer extends Indexable {
         * @return      void
         * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       function addHashedDataToIndex (string $stackName, array $data);
+       function addHashedDataToIndex (string $stackName, array $data): void;
 
        /**
         * Searches for next suitable gap the given length of data can fit in
@@ -46,7 +46,7 @@ interface FileIndexer extends Indexable {
         * @return      $seekPosition   Found next gap's seek position
         * @throws      InvalidArgumentException        If the parameter is not valid
         */
-       function searchNextGap (int $length);
+       function searchNextGap (int $length): int;
 
        /**
         * Writes at given position by seeking to it.
@@ -56,6 +56,6 @@ interface FileIndexer extends Indexable {
         * @return      mixed                   Number of writes bytes or false on error
         * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       function writeAtPosition (int $seekPosition, string $dataStream);
+       function writeAtPosition (int $seekPosition, string $dataStream): mixed;
 
 }
index dc98cb21dbdb07e20fddd9bf2029bc03d33f50dd..0732fd9327a58b591d5b23e5fbe1e392345ae0e8 100644 (file)
@@ -37,6 +37,6 @@ interface CloseableFile extends FrameworkInterface {
         * @throws      NullPointerException    If the file pointer instance is not set by setFileObject()
         * @throws      InvalidResourceException        If there is being set
         */
-       function closeFile ();
+       function closeFile (): void;
 
 }
index b372335141245c041a37e910ae6b95eabd83752c..7066ad3ea448188f3910649dbc65f0e663d46fee 100644 (file)
@@ -33,14 +33,14 @@ interface StreamableInput extends Streamable {
         *
         * @return      $seekPosition   Current seek position
         */
-       function determineSeekPosition ();
+       function determineSeekPosition (): int;
 
        /**
         * Seek to given offset (default) or other possibilities as fseek() gives.
         *
         * @param       $offset         Offset to seek to (or used as "base" for other seeks)
         * @param       $whence         Added to offset (default: only use offset to seek to)
-        * @return      void
+        * @return      $position       Position after seeking (?)
         * @throws      OutOfBoundsException    If the position is not seekable
         */
        function seek (int $offset, int $whence = SEEK_SET): int;
@@ -50,6 +50,6 @@ interface StreamableInput extends Streamable {
         *
         * @return      $size   Size (in bytes) of file
         */
-       function size ();
+       function size (): int;
 
 }
index d0e355d07613f2da9d7bf00bbee21e22a218e88f..7b2f151432f4bfbe8a4992689b21cab0e5799c25 100644 (file)
@@ -52,6 +52,6 @@ interface InputPointer extends StreamableInput, FilePointer {
         *                                                                      is not set by setFileObject()
         * @throws      InvalidResourceException        If there is being set
         */
-       function read (int $bytes = 0);
+       function read (int $bytes = 0): string;
 
 }
index 039d1757022dc54e28afcd75379f416ecd4c8546..5306c0e17802e4e522b5aefd0b43b47f8c8cc6cd 100644 (file)
@@ -48,6 +48,6 @@ interface OutputPointer extends StreamableOutput, FilePointer {
         * @param       $data                   Data to be written
         * @return      mixed                   Number of writes bytes or false on error
         */
-       function writeAtPosition (int $seedPosition, string $data);
+       function writeAtPosition (int $seedPosition, string $data): mixed;
 
 }
index a0ec486c62497d2026feb6abf67c25b3ce36c52e..274178381d3539f13c9834f935d086b1496c27ce 100644 (file)
@@ -33,6 +33,6 @@ interface ReadableNews extends FrameworkInterface {
         *
         * @return      void
         */
-       function initializeReader();
+       function initializeReader(): void;
 
 }
index 13b8c3641e8c771409f1d28962293ff93b7ff097..c3ae75fbdd2b34dbadb992af0bb3dccf398d4b6f 100644 (file)
@@ -34,7 +34,7 @@ interface Requestable extends FrameworkInterface {
         * @param       $element        Name of the request element we want to check
         * @return      $isSet          Whether the request element is set
         */
-       function isRequestElementSet (string $element);
+       function isRequestElementSet (string $element): bool;
 
        /**
         * Getter for request element or 'null' if element was not found
@@ -43,7 +43,7 @@ interface Requestable extends FrameworkInterface {
         * @return      $value          Value of the found request element or 'null' if the
         *                                              element was not found
         */
-       function getRequestElement (string $element);
+       function getRequestElement (string $element): mixed;
 
        /**
         * Setter for request elements
@@ -52,7 +52,7 @@ interface Requestable extends FrameworkInterface {
         * @param       $value          Value to set
         * @return      void
         */
-       function setRequestElement (string $element, $value);
+       function setRequestElement (string $element, mixed $value): void;
 
        /**
         * Setter for request data array
@@ -60,14 +60,14 @@ interface Requestable extends FrameworkInterface {
         * @param       $requestData    Request element to se
         * @return      void
         */
-       function setRequestData (array $requestData);
+       function setRequestData (array $requestData): void;
 
        /**
         * Wrapper method for array_key() function for the request data array
         *
         * @return      $array  An array containing all array keys to return
         */
-       function getParameterNames ();
+       function getParameterNames (): array;
 
        /**
         * Sets whether the request was valid
@@ -75,13 +75,13 @@ interface Requestable extends FrameworkInterface {
         * @param       $isValid        Whether the request is valid
         * @return      void
         */
-       function setIsRequestValid (bool $isValid);
+       function setIsRequestValid (bool $isValid): void;
 
        /**
         * Returns whether this request is valid
         *
         * @return      $isRequestValid         Whether this request is valid
         */
-       function isRequestValid ();
+       function isRequestValid (): bool;
 
 }
index 2c62addadb00c618e055b52016bc7dcd81fabf9c..24506c26cb7fd6b1e559fc63d6e861451822cc2a 100644 (file)
@@ -106,7 +106,7 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         * @return      void
         * @throws      UnsupportedOperationException   If this method is called
         */
-       public function saveFile (SplFileInfo $infoInstance, array $dataArray) {
+       public function saveFile (SplFileInfo $infoInstance, array $dataArray): void {
                // Trace message for logging parameters
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-HANDLER: infoInstance.pathname=%s,dataArray()=%d - CALLED!', $infoInstance->getPathname(), count($dataArray)));
                throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
@@ -155,7 +155,7 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         * @param       $infoInstance   An instance of a SplFileInfo class
         * @return      $array  Array with the file contents
         */
-       public function loadFileContents (SplFileInfo $infoInstance) {
+       public function loadFileContents (SplFileInfo $infoInstance): array {
                // Read from the input handler
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-HANDLER: infoInstance=%s - CALLED!', $infoInstance->__toString()));
                return $this->getInputStreamerInstance()->loadFileContents($infoInstance);
@@ -167,7 +167,7 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         * @return      $seekPosition   Current seek position
         * @todo        0% done
         */
-       public function determineSeekPosition () {
+       public function determineSeekPosition (): int {
                // Trace message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: CALLED!');
                DebugMiddleware::getSelfInstance()->partialStub();
@@ -205,7 +205,7 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         * @return      $size   Size (in bytes) of file
         * @todo        0% done
         */
-       public function size () {
+       public function size (): int {
                // @TODO: Unfinished method:
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: CALLED!');
                DebugMiddleware::getSelfInstance()->partialStub();
@@ -220,7 +220,7 @@ class FileIoHandler extends BaseMiddleware implements IoHandler {
         * @return      $seekPosition   Current seek position
         * @todo        0% done
         */
-       public function getPosition () {
+       public function getPosition (): int {
                // @TODO: Unfinished method:
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('FILE-IO-HANDLER: CALLED!');
                DebugMiddleware::getSelfInstance()->partialStub();