Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 2 Dec 2020 05:54:59 +0000 (06:54 +0100)
committerRoland Häder <roland@mxchange.org>
Wed, 2 Dec 2020 05:54:59 +0000 (06:54 +0100)
- MenuTemplateEnggine requires a StackableTrait
- added type-hints for primitive variables

Signed-off-by: Roland Häder <roland@mxchange.org>
framework/main/classes/mailer/class_BaseMailer.php
framework/main/classes/mailer/debug/class_DebugMailer.php
framework/main/classes/template/menu/class_MenuTemplateEngine.php

index 43d92ec075a842095e9aa4eb7772c6aa6b33c316..5e10bc195c5c89c921d0cf76abda83b41882a120 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 ($templateName) {
+       protected final function loadTemplate (string $templateName) {
                // Set template name
                $this->setTemplateName($templateName);
 
@@ -137,8 +137,8 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         * @param       $templateName   Name of email template
         * @return      void
         */
-       public final function setTemplateName ($templateName) {
-               $this->templateName = (string) $templateName;
+       public final function setTemplateName (string $templateName) {
+               $this->templateName = $templateName;
        }
 
        /**
@@ -156,7 +156,7 @@ abstract class BaseMailer extends BaseFrameworkSystem {
         * @param       $subjectLine    Subject line to set
         * @return      void
         */
-       public final function setSubjectLine ($subjectLine) {
+       public final function setSubjectLine (string $subjectLine) {
                $this->setGenericArrayElement('recipients', $this->getTemplateName(), 'generic', 'subject', $subjectLine);
        }
 
index b9b5a76b8a3780860b62d10b67265a4be949f795..810163f8467c1848a2504adb8e29f0f2da1e66a9 100644 (file)
@@ -53,7 +53,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, $templateName) {
+       public static final function createDebugMailer (CompileableTemplate $templateInstance, string $templateName) {
                // Get a new instance
                $mailerInstance = new DebugMailer();
 
index 5df5e14f1eb8d33b1bbaa01a9908e0f5f0f97b5e..442f929072709ad26e68317a9dd80e123614623a 100644 (file)
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Parser\Parseable;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
-use Org\Mxchange\CoreFramework\Traits\Template\CompileableTemplateTrait;
+use Org\Mxchange\CoreFramework\Traits\Stacker\StackableTrait;
 use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
 
 // Import SPL stuff
@@ -41,6 +41,9 @@ use \UnexpectedValueException;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTemplate {
+       // Load traits
+       use StackableTrait;
+
        /**
         * Main nodes in the XML tree ('menu' is ignored)
         */