From 459cd1e4a034a19861afba09178c16aafc8b8d7b Mon Sep 17 00:00:00 2001 From: Torsten Oppermann <torsten@sgalinski.de> Date: Tue, 11 Jun 2019 08:29:11 +0200 Subject: [PATCH] [TASK] Smaller cleanups --- Classes/Service/PlaintextService.php | 2 +- Classes/Service/RegisterService.php | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Classes/Service/PlaintextService.php b/Classes/Service/PlaintextService.php index 196186ad..57b963cb 100644 --- a/Classes/Service/PlaintextService.php +++ b/Classes/Service/PlaintextService.php @@ -99,7 +99,7 @@ class PlaintextService { * @param string $content * @return array */ - protected function addLineBreaks($content) { + protected function addLineBreaks($content): array { $tags2LineBreaks = [ '</p>', '</tr>', diff --git a/Classes/Service/RegisterService.php b/Classes/Service/RegisterService.php index 99695873..0bb10eb4 100644 --- a/Classes/Service/RegisterService.php +++ b/Classes/Service/RegisterService.php @@ -130,9 +130,9 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface { $pathAsArray = GeneralUtility::trimExplode('/', $pathToRegistrationFile); $filename = $pathAsArray[\count($pathAsArray) - 1]; $filenameWithoutHash = GeneralUtility::trimExplode('_', $filename, FALSE, 2)[1]; - $hash = md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . '|' . $filenameWithoutHash); + $hash = \md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . '|' . $filenameWithoutHash); // if the filename doesn't start with the hash value, ignore it - if (strpos($filename, $hash) !== 0) { + if (\strpos($filename, $hash) !== 0) { continue; } @@ -240,7 +240,7 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface { $registerFolder = GeneralUtility::getFileAbsFileName($configurationLocation); GeneralUtility::mkdir_deep($registerFolder); - $hashPrefix = md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . '|' . $templateKey . '.php'); + $hashPrefix = \md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . '|' . $templateKey . '.php'); $registerFile = GeneralUtility::getFileAbsFileName( $registerFolder . '/' . $hashPrefix . '_' . $templateKey . '.php' ); @@ -268,7 +268,7 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface { ]; } - file_put_contents($registerFile, '<?php return ' . var_export($newRegisterArray, TRUE) . ';'); + \file_put_contents($registerFile, '<?php return ' . \var_export($newRegisterArray, TRUE) . ';'); return $registerFile; } @@ -283,11 +283,11 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface { $registerFolder = GeneralUtility::getFileAbsFileName($configurationLocation); GeneralUtility::mkdir_deep($registerFolder); - $hashPrefix = md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . '|' . $templateKey . '.php'); + $hashPrefix = \md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . '|' . $templateKey . '.php'); $registerFile = GeneralUtility::getFileAbsFileName( $registerFolder . '/' . $hashPrefix . '_' . $templateKey . '.php' ); - if (file_exists($registerFile)) { + if (\file_exists($registerFile)) { \unlink($registerFile); } } @@ -340,13 +340,13 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface { GeneralUtility::mkdir_deep($registerFolder); if ($filePath === '') { - $hashPrefix = md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . '|' . $templateName . '.php'); + $hashPrefix = \md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . '|' . $templateName . '.php'); $filePath = GeneralUtility::getFileAbsFileName( $registerFolder . '/' . $hashPrefix . '_' . $templateName . '.php' ); } - if (file_exists($filePath)) { + if (\file_exists($filePath)) { $success = \unlink($filePath); } else { return FALSE; @@ -383,7 +383,7 @@ class RegisterService implements \TYPO3\CMS\Core\SingletonInterface { $registerFolder = GeneralUtility::getFileAbsFileName($configurationLocation); GeneralUtility::mkdir_deep($registerFolder); - $hashPrefix = md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . '|' . $templateName . '.php'); + $hashPrefix = \md5($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] . '|' . $templateName . '.php'); $filePath = GeneralUtility::getFileAbsFileName( $registerFolder . '/' . $hashPrefix . '_' . $templateName . '.php' ); -- GitLab