From: Roland Häder Date: Fri, 22 Aug 2025 01:44:38 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d6b073816d68736e5dd2f26ca1a7cb9dc3a8c406;p=core.git Continued: - proper returned type --- diff --git a/framework/main/classes/factories/xml/class_XmlTemplateEngineFactory.php b/framework/main/classes/factories/xml/class_XmlTemplateEngineFactory.php index 81f4468e..d862020c 100644 --- a/framework/main/classes/factories/xml/class_XmlTemplateEngineFactory.php +++ b/framework/main/classes/factories/xml/class_XmlTemplateEngineFactory.php @@ -3,6 +3,7 @@ namespace Org\Mxchange\CoreFramework\Factory\Template; // Import framework stuff +use Org\Mxchange\CoreFramework\Template\Xml\CompileableXmlTemplate; use Org\Mxchange\CoreFramework\Factory\BaseFactory; use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory; use Org\Mxchange\CoreFramework\Generic\FrameworkInterface; @@ -54,7 +55,7 @@ class XmlTemplateEngineFactory extends BaseFactory { * @param $configKey Config entry name for the template engine * @return $templateInstance A template engine instance */ - public static final function createXmlTemplateEngineInstance (string $configKey): XmlTemplateEngineFactory { + public static final function createXmlTemplateEngineInstance (string $configKey): CompileableXmlTemplate { // Validate parameter //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('XML-TEMPLATE-ENGINE-FACTORY: configKey=%s - CALLED!', $configKey)); if (empty($configKey)) { 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 34d16faf..6c31d0ab 100644 --- a/framework/main/classes/file_directories/io_stream/class_FileIoStream.php +++ b/framework/main/classes/file_directories/io_stream/class_FileIoStream.php @@ -167,10 +167,10 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil * Reads from a local file * * @param $infoInstance An instance of a SplFileInfo class - * @return $array An array with the element 'header' and 'data' + * @return $content Raw file content * @see FileInputStreamer */ - public final function loadFileContents (SplFileInfo $infoInstance): array { + public final function loadFileContents (SplFileInfo $infoInstance): string { // Initialize some variables and arrays /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('FILE-IO-STREAM: infoInstance=%s - CALLED!', $infoInstance)); $inputBuffer = ''; diff --git a/framework/main/classes/file_directories/text/class_BaseTextFile.php b/framework/main/classes/file_directories/text/class_BaseTextFile.php index bfb00fb0..5637f5cb 100644 --- a/framework/main/classes/file_directories/text/class_BaseTextFile.php +++ b/framework/main/classes/file_directories/text/class_BaseTextFile.php @@ -71,11 +71,11 @@ abstract class BaseTextFile extends BaseAbstractFile { * Reads from a local or remote file * * @param $infoInstance An instance of a SplFileInfo class - * @return $array An array containing all read lines + * @return $content Raw file content * @throws InvalidArrayCountException If an array has not the expected size * @throws InvalidMD5ChecksumException If two MD5 hashes did not match */ - public function loadFileContents (SplFileInfo $infoInstance): array { + public function loadFileContents (SplFileInfo $infoInstance): string { /* * This class (or its implementations) are special file readers/writers. * There is no need to read/write the whole file. diff --git a/framework/main/interfaces/io/file/class_FileInputStreamer.php b/framework/main/interfaces/io/file/class_FileInputStreamer.php index 3c4bac18..8676e370 100644 --- a/framework/main/interfaces/io/file/class_FileInputStreamer.php +++ b/framework/main/interfaces/io/file/class_FileInputStreamer.php @@ -35,10 +35,10 @@ interface FileInputStreamer extends StreamableInput { * Reads from a local or remote file * * @param $infoInstance An instance of a SplFileInfo class - * @return $array An array containing all read lines + * @return $content Raw file content * @throws InvalidArrayCountException If an array has not the expected size * @throws InvalidMD5ChecksumException If two MD5 hashes did not match */ - function loadFileContents (SplFileInfo $infoInstance); + function loadFileContents (SplFileInfo $infoInstance): string; } diff --git a/framework/main/middleware/io/class_FileIoHandler.php b/framework/main/middleware/io/class_FileIoHandler.php index 24506c26..f122923d 100644 --- a/framework/main/middleware/io/class_FileIoHandler.php +++ b/framework/main/middleware/io/class_FileIoHandler.php @@ -153,9 +153,9 @@ class FileIoHandler extends BaseMiddleware implements IoHandler { /** Loads data from a file over the input handler * * @param $infoInstance An instance of a SplFileInfo class - * @return $array Array with the file contents + * @return $content Raw file content */ - public function loadFileContents (SplFileInfo $infoInstance): array { + public function loadFileContents (SplFileInfo $infoInstance): string { // 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);