From c30a6ccdc03524b116628847622cf88c25952540 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 2 Dec 2020 06:54:59 +0100 Subject: [PATCH] Continued: - MenuTemplateEnggine requires a StackableTrait - added type-hints for primitive variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- framework/main/classes/mailer/class_BaseMailer.php | 8 ++++---- framework/main/classes/mailer/debug/class_DebugMailer.php | 2 +- .../classes/template/menu/class_MenuTemplateEngine.php | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/framework/main/classes/mailer/class_BaseMailer.php b/framework/main/classes/mailer/class_BaseMailer.php index 43d92ec0..5e10bc19 100644 --- a/framework/main/classes/mailer/class_BaseMailer.php +++ b/framework/main/classes/mailer/class_BaseMailer.php @@ -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); } diff --git a/framework/main/classes/mailer/debug/class_DebugMailer.php b/framework/main/classes/mailer/debug/class_DebugMailer.php index b9b5a76b..810163f8 100644 --- a/framework/main/classes/mailer/debug/class_DebugMailer.php +++ b/framework/main/classes/mailer/debug/class_DebugMailer.php @@ -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(); diff --git a/framework/main/classes/template/menu/class_MenuTemplateEngine.php b/framework/main/classes/template/menu/class_MenuTemplateEngine.php index 5df5e14f..442f9290 100644 --- a/framework/main/classes/template/menu/class_MenuTemplateEngine.php +++ b/framework/main/classes/template/menu/class_MenuTemplateEngine.php @@ -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 . */ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTemplate { + // Load traits + use StackableTrait; + /** * Main nodes in the XML tree ('menu' is ignored) */ -- 2.39.5