From 21de9c5bf04f2b63ebbe468fe1394d05e0c6f2ae Mon Sep 17 00:00:00 2001 From: Torsten Oppermann <torsten@sgalinski.de> Date: Fri, 14 Sep 2018 11:16:09 +0200 Subject: [PATCH] [TASK] Deprecate register functions --- Classes/Service/MailTemplateService.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Classes/Service/MailTemplateService.php b/Classes/Service/MailTemplateService.php index 212d7e38..8bbc37d2 100644 --- a/Classes/Service/MailTemplateService.php +++ b/Classes/Service/MailTemplateService.php @@ -802,9 +802,13 @@ class MailTemplateService { * If found, register the template(s) * * @throws \BadFunctionCallException + * @deprecated since 4.7.0 will be removed in 5.0.0 * @return array */ public static function registerExtensions(): array { + // @TODO remove this deprecated function in version 5.0.0 + self::logDeprecation('registerExtensions'); + // clear registerArray $registerArray = []; @@ -850,12 +854,16 @@ class MailTemplateService { * @param array $configArray * @param bool $transformTemplateFolder * @param string $storeTemplateExtension + * @deprecated since 4.7.0 will be removed in 5.0.0 * @return array */ private static function writeRegisterArrayEntry( array $registerArray, $extensionKey, $templateKey, array $configArray, $transformTemplateFolder = TRUE, $storeTemplateExtension = '' ) { + // @TODO remove this deprecated function in version 5.0.0 + self::logDeprecation('writeRegisterArrayEntry'); + // If it is not explicitly set in which extension the html should be located, use the extension set in the template settings if ($storeTemplateExtension === '') { $storeTemplateExtension = $extensionKey; @@ -961,4 +969,15 @@ class MailTemplateService { return $allMarker; } + + /** + * function to call a deprecation log entry (but only once per request / class) + * + * @param $function + */ + private static function logDeprecation($function) { + GeneralUtility::deprecationLog( + 'The function ' . $function . ' is deprecated since version 4.7.0 and will be removed in version 5.0.0' + ); + } } -- GitLab