]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 21 Aug 2025 23:10:00 +0000 (01:10 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 21 Aug 2025 23:15:20 +0000 (01:15 +0200)
- more type-hints added

12 files changed:
framework/main/classes/lists/class_
framework/main/classes/lists/groups/class_ListGroupList.php
framework/main/classes/lists/tasks/class_TaskList.php
framework/main/classes/mailer/class_
framework/main/classes/mailer/class_BaseMailer.php
framework/main/classes/mailer/debug/class_DebugMailer.php
framework/main/classes/menu/class_BaseMenu.php
framework/main/interfaces/lists/class_Listable.php
framework/main/interfaces/logging/class_Logger.php
framework/main/interfaces/login/class_LoginableUser.php
framework/main/interfaces/mailer/class_DeliverableMail.php
framework/main/interfaces/menu/class_RenderableMenu.php

index 93cc43ddad82967780a7dffcbeb050ebd513ffc5..14d69614ffc439f15d7b84b4ddb09d2421f4b0f5 100644 (file)
@@ -2,6 +2,9 @@
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
+// Import SPL stuff
+use \Iterator;
+
 /**
  * A ??? list
  *
@@ -40,7 +43,7 @@ class ???List extends BaseList implements Listable {
         *
         * @return      $listInstance           An instance a Listable class
         */
-       public final static function create???List () {
+       public final static function create???List (): Listable {
                // Get new instance
                $listInstance = new ???List();
 
@@ -54,7 +57,7 @@ class ???List extends BaseList implements Listable {
         * @return      $iteratorInstance       An instance of a Iterator class
         * @todo        0% done
         */
-       public function getListIterator () {
+       public function getListIterator (): Iterator {
                DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
@@ -64,7 +67,7 @@ class ???List extends BaseList implements Listable {
         * @return      void
         * @todo        0% done
         */
-       public function clearList () {
+       public function clearList (): void {
                DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
index 8587b88962a677b068826882566de8d5f7e37698..339e6085297c7f438e9895cf1c3bda6bf75783b5 100644 (file)
@@ -7,6 +7,9 @@ use Org\Mxchange\CoreFramework\Lists\BaseList;
 use Org\Mxchange\CoreFramework\Lists\Listable;
 use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 
+// Import SPL stuff
+use \Iterator;
+
 /**
  * A ListGroup list
  *
@@ -58,7 +61,7 @@ class ListGroupList extends BaseList implements Listable {
         *
         * @return      $iteratorInstance       An instance of a Iterator class
         */
-       public function getListIterator () {
+       public function getListIterator (): Iterator{
                $this->debugInstance($this->__toString() . ' uses the default iterator. Please call getIterator() instead!');
        }
 
index be75722e73dc09d0ceb27650e7b07399a3b12738..2432e7549f4b32f7adf7cb9eccdcea9cb4ec4232 100644 (file)
@@ -6,6 +6,9 @@ namespace Org\Mxchange\CoreFramework\Lists\Task;
 use Org\Mxchange\CoreFramework\Lists\BaseList;
 use Org\Mxchange\CoreFramework\Lists\Listable;
 
+// Import SPL stuff
+use \Iterator;
+
 /**
  * A Task list
  *
@@ -60,7 +63,7 @@ class TaskList extends BaseList implements Listable {
         *
         * @return      $iteratorInstance       An instance of a Iterator class
         */
-       public function getListIterator () {
+       public function getListIterator (): Iterator {
                $this->debugInstance($this->__toString() . ' uses the default iterator. Please call getIterator() instead!');
        }
 
index 55b566a36e5019c2de8461a7842f579ccb105f8f..e4ac36517cce1ddcd7f8525bab4747cf03061899 100644 (file)
@@ -45,7 +45,7 @@ class ???Mailer extends BaseMailer implements DeliverableMail {
         *
         * @return      $mailerInstance         An instance of this mailer class
         */
-       public final static function create???Mailer () {
+       public final static function create???Mailer (): DeliverableMail {
                // Get a new instance
                $mailerInstance = new ???Mailer();
 
@@ -59,7 +59,7 @@ class ???Mailer extends BaseMailer implements DeliverableMail {
         * @return      void
         * @todo        0% done
         */
-       public function deliverEmail() {
+       public function deliverEmail(): void {
                DebugMiddleware::getSelfInstance()->partialStub("You have to implement this method.");
        }
 
@@ -69,7 +69,7 @@ class ???Mailer extends BaseMailer implements DeliverableMail {
         * @return      void
         * @todo        0% done
         */
-       public function sendAdminNotification() {
+       public function sendAdminNotification(): void {
                DebugMiddleware::getSelfInstance()->partialStub("You have to implement this method.");
        }
 
index 840bb616b8bdafb4a5ae340ca4d9491e54a81268..b54130ccca8b4f73dad7a907670dade18d76820f 100644 (file)
@@ -57,7 +57,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         * @param       $templateName   Name of the template we shall load
         * @return      void
         */
-       protected final function loadTemplate (string $templateName) {
+       protected final function loadTemplate (string $templateName): void {
                // Set template name
                $this->setTemplateName($templateName);
 
@@ -74,7 +74,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         * @param       $userInstance   An instance of a user class
         * @return      void
         */
-       public function addRecipientByUserInstance (ManageableMember $userInstance) {
+       public function addRecipientByUserInstance (ManageableMember $userInstance): void {
                // Get template name
                $templateName = $this->getTemplateName();
 
@@ -89,7 +89,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         * @param       $variableName   Template variable name to add
         * @return      void
         */
-       private function addTemplateVariable ($section, $variableName) {
+       private function addTemplateVariable ($section, $variableName): void {
                // Get template name
                $templateName = $this->getTemplateName();
 
@@ -106,7 +106,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         * @param       $variableName   Template variable name to add
         * @return      void
         */
-       public final function addConfigTemplateVariable ($variableName) {
+       public final function addConfigTemplateVariable (string $variableName): void {
                $this->addTemplateVariable('config', $variableName);
        }
 
@@ -116,7 +116,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         * @param       $variableName   Template variable name to add
         * @return      void
         */
-       public final function addValueTemplateVariable ($variableName) {
+       public final function addValueTemplateVariable (string $variableName): void {
                $this->addTemplateVariable('value', $variableName);
        }
 
@@ -127,7 +127,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         * @param       $valueInstance  An object instance which can provide "field values"
         * @return      void
         */
-       public final function addValueInstance (string $variableName, FrameworkInterface $valueInstance) {
+       public final function addValueInstance (string $variableName, FrameworkInterface $valueInstance): void {
                $this->setGenericArrayElement('recipients', $this->getTemplateName(), 'values', $variableName, $valueInstance);
        }
 
@@ -137,7 +137,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         * @param       $templateName   Name of email template
         * @return      void
         */
-       public final function setTemplateName (string $templateName) {
+       public final function setTemplateName (string $templateName): void {
                $this->templateName = $templateName;
        }
 
@@ -146,7 +146,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         *
         * @return      $templateName   Name of email template
         */
-       protected final function getTemplateName () {
+       protected final function getTemplateName (): string {
                return $this->templateName;
        }
 
@@ -156,7 +156,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         * @param       $subjectLine    Subject line to set
         * @return      void
         */
-       public final function setSubjectLine (string $subjectLine) {
+       public final function setSubjectLine (string $subjectLine): void {
                $this->setGenericArrayElement('recipients', $this->getTemplateName(), 'generic', 'subject', $subjectLine);
        }
 
@@ -165,7 +165,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         *
         * @return      $subjectLine    Subject line to set
         */
-       public final function getSubjectLine () {
+       public final function getSubjectLine (): string {
                // Default subject is null
                $subjectLine = NULL;
 
@@ -187,7 +187,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         *
         * @return      void
         */
-       public function useSubjectFromTemplate () {
+       public function useSubjectFromTemplate (): void {
                // Set the subject line
                $this->setSubjectLine('{?subject?}');
        }
@@ -197,7 +197,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         *
         * @return      $recipientList  Array with reciepients
         */
-       public final function getRecipientList () {
+       public final function getRecipientList (): array {
                return $this->getGenericArray('recipients');
        }
 
index 884b385877b1fe035a661b291bd9d79a6534c5b8..61dfd93558e75107555c459b8491483bb7dec4dc 100644 (file)
@@ -57,7 +57,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
         * @param       $templateName                   Name of email template to set
         * @return      $mailerInstance                 An instance of this mailer class
         */
-       public static final function createDebugMailer (CompileableTemplate $templateInstance, string $templateName) {
+       public static final function createDebugMailer (CompileableTemplate $templateInstance, string $templateName): DeliverableMail {
                // Get a new instance
                $mailerInstance = new DebugMailer();
 
@@ -77,7 +77,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
         * @return      void
         * @throws      UnexpectedValueException        If the recipient instance does not implement ManageableMember
         */
-       public function deliverEmail () {
+       public function deliverEmail (): void {
                // Get template instance
                $templateInstance = $this->getTemplateInstance();
 
@@ -136,7 +136,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
         * @return      void
         * @todo        0% done
         */
-       public function sendAdminNotification () {
+       public function sendAdminNotification (): void {
                // Unfinished work
        }
 
@@ -145,7 +145,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
         *
         * @return      void
         */
-       public function invokeMailDelivery () {
+       public function invokeMailDelivery (): void {
                // Get template instance
                $templateInstance = $this->getTemplateInstance();
 
index 72ed27cff811fd84e77b477ecc6666e42d1e7405..57a5a01076d12ab7bc8f7bf121c032dc2f9e20bc 100644 (file)
@@ -54,7 +54,7 @@ abstract class BaseMenu extends BaseFrameworkSystem {
         *
         * @return      void
         */
-       public function renderMenu () {
+       public function renderMenu (): void {
                // Initialize the menu system by preparing it's template instance
                $templateInstance = ObjectFactory::createObjectByConfiguredName('menu_template_class', [$this]);
 
@@ -93,7 +93,7 @@ abstract class BaseMenu extends BaseFrameworkSystem {
         * @param       $templateInstance       An instance of a CompileableTemplate class
         * @return      void
         */
-       public function transferContentToTemplateEngine (CompileableTemplate $templateInstance) {
+       public function transferContentToTemplateEngine (CompileableTemplate $templateInstance): void {
                // Assign menu content to variable
                $templateInstance->assignVariable('menu', $this->getTemplateInstance()->getMenuContent());
                //* DEBUG */ $templateInstance->debugInstance();
index ce6087e4f34ca1448352cc6511adf9c686bd35a9..fc514b72f57933604b45b469bff9999765fb11fb 100644 (file)
@@ -7,6 +7,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
 
 // Import SPL stuff
+use \Iterator;
 use \IteratorAggregate;
 
 /**
@@ -38,7 +39,7 @@ interface Listable extends FrameworkInterface, IteratorAggregate {
         * @param       $groupName      Group to check if found in list
         * @return      $isset          Whether the group is valid
         */
-       function isGroupSet (string $groupName);
+       function isGroupSet (string $groupName): bool;
 
        /**
         * Adds the given group or if already added issues a BadMethodCallException
@@ -47,7 +48,7 @@ interface Listable extends FrameworkInterface, IteratorAggregate {
         * @return      void
         * @throws      BadMethodCallException  If the given group is already added
         */
-       function addGroup (string $groupName);
+       function addGroup (string $groupName): void;
 
        /**
         * Adds the given instance to list group and sub group
@@ -58,7 +59,7 @@ interface Listable extends FrameworkInterface, IteratorAggregate {
         * @return      void
         * @throws      BadMethodCallException  If the given group is not found
         */
-       function addInstance (string $groupName, string $subGroup, Visitable $visitableInstance);
+       function addInstance (string $groupName, string $subGroup, Visitable $visitableInstance): void;
 
        /**
         * Adds the given entry to list group
@@ -68,7 +69,7 @@ interface Listable extends FrameworkInterface, IteratorAggregate {
         * @return      void
         * @throws      BadMethodCallException  If the given group is not found
         */
-       function addEntry (string $groupName, $entry);
+       function addEntry (string $groupName, mixed $entry): void;
 
        /**
         * Updates the given entry by hash with given array
@@ -78,21 +79,21 @@ interface Listable extends FrameworkInterface, IteratorAggregate {
         * @return      void
         * @throws      InvalidListHashException        If the solved hash index is invalid
         */
-       function updateCurrentEntryByHash (string $hash, array $entryArray);
+       function updateCurrentEntryByHash (string $hash, array $entryArray): void;
 
        /**
         * "Getter" for an iterator instance of this list
         *
         * @return      $iteratorInstance       An instance of a Iterator class
         */
-       function getListIterator ();
+       function getListIterator (): Iterator;
 
        /**
         * Clears this list (mostly by clearing all groups together)
         *
         * @return      void
         */
-       function clearList ();
+       function clearList (): void;
 
        /**
         * Setter for call-back instance
@@ -100,6 +101,6 @@ interface Listable extends FrameworkInterface, IteratorAggregate {
         * @param       $callbackInstance       An instance of a FrameworkInterface class
         * @return      void
         */
-       function setCallbackInstance (FrameworkInterface $callbackInstance);
+       function setCallbackInstance (FrameworkInterface $callbackInstance): void;
 
 }
index 2e7a2cf8a7fec734fbd128f55a89cbc85d1da77f..1c9e9c05d49b850c8c7e70f536d1f1c65a734fd8 100644 (file)
@@ -49,7 +49,7 @@ interface Logger extends FrameworkInterface {
         * @throws      NullPointerException    If this->outputInstance is NULL
         * @todo        Remove $doPrint parameter
         */
-       public function traceMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+       public function traceMessage (string $message, bool $doPrint = true, bool $stripTags = false): void;
 
        /**
         * Outputs a debug message whether to debug instance (should be set!) or
@@ -64,7 +64,7 @@ interface Logger extends FrameworkInterface {
         * @throws      NullPointerException    If this->outputInstance is NULL
         * @todo        Remove $doPrint parameter
         */
-       public function debugMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+       public function debugMessage (string $message, bool $doPrint = true, bool $stripTags = false): void;
 
        /**
         * Outputs an informational message whether to debug instance (should be set!) or
@@ -79,7 +79,7 @@ interface Logger extends FrameworkInterface {
         * @throws      NullPointerException    If this->outputInstance is NULL
         * @todo        Remove $doPrint parameter
         */
-       public function infoMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+       public function infoMessage (string $message, bool $doPrint = true, bool $stripTags = false): void;
 
        /**
         * Outputs a warning message whether to debug instance (should be set!) or
@@ -94,7 +94,7 @@ interface Logger extends FrameworkInterface {
         * @throws      NullPointerException    If this->outputInstance is NULL
         * @todo        Remove $doPrint parameter
         */
-       public function warningMessage (string $message, bool $doPrint = true, bool $stripTags = false);
+       public function warningMessage (string $message, bool $doPrint = true, bool $stripTags = false): void;
 
        /**
         * Output a partial stub message for the caller method
@@ -102,7 +102,7 @@ interface Logger extends FrameworkInterface {
         * @param       $message        An optional message to display
         * @return      void
         */
-       public function partialStub (string $message = '');
+       public function partialStub (string $message = ''): void;
 
        /**
         * Outputs a deprecated message whether to debug instance (should be set!) or
@@ -118,6 +118,6 @@ interface Logger extends FrameworkInterface {
         * @todo        Remove $doPrint parameter
         * @todo        When all old method invocations are fixed, renamed this do deprecatedMessage
         */
-       public function debugOutput (string $message, bool $doPrint = true, bool $stripTags = false);
+       public function debugOutput (string $message, bool $doPrint = true, bool $stripTags = false): void;
 
 }
index 8baeff5dea6e9ff0989df1c7edccd96ed28d34aa..79884a37ba781b32d9419251135a2cfb8c2f0336 100644 (file)
@@ -39,15 +39,15 @@ interface LoginableUser extends FrameworkInterface {
         * @param       $responseInstance       An instance of a Responseable class
         * @return      void
         */
-       function doLogin (Requestable $requestInstance, Responseable $responseInstance);
+       function doLogin (Requestable $requestInstance, Responseable $responseInstance): void;
 
        /**
         * Check if the implementation is correct. Only the request instance is
         * needed as no redirect is done here.
         *
         * @param       $requestInstance        An instance of a Requestable class
-        * @return
+        * @return      void
         */
-       function testLogin (Requestable $requestInstance);
+       function testLogin (Requestable $requestInstance): void;
 
 }
index cf8b28ec9d7058d3e5d21369685a47528fc43483..7ece1452b77f017ace20b25c4ebc3d10530580f6 100644 (file)
@@ -35,27 +35,27 @@ interface DeliverableMail extends FrameworkInterface {
         * @param       $userInstance   An instance of a user class
         * @return      void
         */
-       function addRecipientByUserInstance (ManageableMember $userInstance);
+       function addRecipientByUserInstance (ManageableMember $userInstance): void;
 
        /**
         * Use subject line provided by the (XML) template otherwise a subject line must be set
         *
         * @return      void
         */
-       function useSubjectFromTemplate ();
+       function useSubjectFromTemplate (): void;
 
        /**
         * Deliver email to the recipient(s)
         *
         * @return      void
         */
-       function deliverEmail ();
+       function deliverEmail (): void;
 
        /**
         * Send notification to the admin
         *
         * @return      void
         */
-       function sendAdminNotification ();
+       function sendAdminNotification (): void;
 
 }
index dc2d567a73f2eba5c8cf415f208f7d90ea44197b..77d20ff666406c9fe69c197bf274ac0f624c9178 100644 (file)
@@ -35,7 +35,7 @@ interface RenderableMenu extends FrameworkInterface {
         *
         * @return      void
         */
-       function renderMenu ();
+       function renderMenu (): void;
 
        /**
         * Transfers the rendered menu to a given template engine by assigning
@@ -44,6 +44,6 @@ interface RenderableMenu extends FrameworkInterface {
         * @2param      $templateInstance       An instance of a CompileableTemplate class
         * @return      void
         */
-       function transferContentToTemplateEngine (CompileableTemplate $templateInstance);
+       function transferContentToTemplateEngine (CompileableTemplate $templateInstance): void;
 
 }