-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Task #468: activate phpcs and php sniff
php-cs and php-sniff are activated and codes are fixed accordingly
- Loading branch information
Showing
35 changed files
with
322 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,8 @@ | |
/** | ||
* Container class for auxilliary functions of tx_directmail | ||
* | ||
* @author Kasper Skårhøj <kasperYYYY>@typo3.com> | ||
* @author Thorsten Kahler <[email protected]> | ||
* @author Kasper Skårhøj <kasperYYYY>@typo3.com> | ||
* @author Thorsten Kahler <[email protected]> | ||
*/ | ||
class Container | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,10 @@ | |
* Static class. | ||
* Functions in this class are used by more than one modules. | ||
* | ||
* @author Kasper Skaarhoj <[email protected]> | ||
* @author Jan-Erik Revsbech <[email protected]> | ||
* @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca> | ||
* @author Ivan-Dharma Kartolo <[email protected]> | ||
* @author Kasper Skaarhoj <[email protected]> | ||
* @author Jan-Erik Revsbech <[email protected]> | ||
* @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca> | ||
* @author Ivan-Dharma Kartolo <[email protected]> | ||
*/ | ||
class DirectMailUtility | ||
{ | ||
|
@@ -362,7 +362,6 @@ public static function substUrlsInPlainText(string $message, string $urlmode = ' | |
$lengthLimit = 0; | ||
break; | ||
case '76': | ||
|
||
default: | ||
$lengthLimit = (int)$urlmode; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,8 +29,8 @@ | |
/** | ||
* Used to generate queries for selecting users in the database | ||
* | ||
* @author Kasper Skårhøj <[email protected]> | ||
* @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca> | ||
* @author Kasper Skårhøj <[email protected]> | ||
* @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca> | ||
*/ | ||
class DmQueryGenerator extends QueryGenerator | ||
{ | ||
|
@@ -129,7 +129,7 @@ public function getQueryDM(bool $queryLimitDisabled): string | |
// Show query | ||
$this->enablePrefix = true; | ||
$queryString = $this->getQuery($this->queryConfig); | ||
if($queryLimitDisabled) { | ||
if ($queryLimitDisabled) { | ||
$this->extFieldLists['queryLimit'] = ''; | ||
} | ||
$selectQueryString = $this->getSelectQuery($queryString); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,14 +27,13 @@ | |
use TYPO3\CMS\Core\Core\Environment; | ||
use TYPO3\CMS\Core\Localization\LanguageService; | ||
use TYPO3\CMS\Core\Mail\MailMessage; | ||
use TYPO3\CMS\Core\Resource\FileReference; | ||
use TYPO3\CMS\Core\Service\MarkerBasedTemplateService; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
/** | ||
* Class, doing the sending of Direct-mails, eg. through a cron-job | ||
* | ||
* @author Kasper Skårhøj <[email protected]> | ||
* @author Kasper Skårhøj <[email protected]> | ||
* @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca> | ||
*/ | ||
class Dmailer implements LoggerAwareInterface | ||
|
@@ -461,7 +460,7 @@ public function sendSimple(array $recipients): bool | |
* @param array $cArray Array of content split by dmail boundary | ||
* @param string $userCategories The list of categories the user is subscribing to. | ||
* | ||
* @return string Content of the email, which the recipient subscribed | ||
* @return string Content of the email, which the recipient subscribed | ||
*/ | ||
protected function getBoundaryParts($cArray, $userCategories): string | ||
{ | ||
|
@@ -508,7 +507,7 @@ protected function getBoundaryParts($cArray, $userCategories): string | |
* @param string $table Tablename of the recipient | ||
* @param int $uid Uid of the recipient | ||
* | ||
* @return string list of categories | ||
* @return string list of categories | ||
*/ | ||
public function getListOfRecipentCategories(string $table, int $uid): string | ||
{ | ||
|
@@ -533,9 +532,9 @@ public function getListOfRecipentCategories(string $table, int $uid): string | |
/** | ||
* Mass send to recipient in the list | ||
* | ||
* @param array $query_info List of recipients' ID in the sys_dmail table | ||
* @param int $mid Directmail ID. UID of the sys_dmail table | ||
* @return bool | ||
* @param array $query_info List of recipients' ID in the sys_dmail table | ||
* @param int $mid Directmail ID. UID of the sys_dmail table | ||
* @return bool | ||
*/ | ||
protected function masssendList(array $query_info, int $mid): bool | ||
{ | ||
|
@@ -643,7 +642,7 @@ protected function shipOfMail(int $mid, array $recipRow, string $tableKey): void | |
'logUid' => $logUid, | ||
'html_sent' => (int)$this->sendAdvanced($recipRow, $tableKey), | ||
'parsetime' => $this->getMilliseconds() - $parseTimeStart, | ||
'size' => strlen($this->message) | ||
'size' => strlen($this->message), | ||
]; | ||
$ok = $sysDmailMaillogRepository->updateSysDmailMaillogForShipOfMail($values); | ||
|
||
|
@@ -665,7 +664,7 @@ protected function shipOfMail(int $mid, array $recipRow, string $tableKey): void | |
* Converting array key. | ||
* fe_user and tt_address are using different fieldname for the same information | ||
* | ||
* @param array $recipRow Recipient's data array | ||
* @param array $recipRow Recipient's data array | ||
* | ||
* @return array Fixed recipient's data array | ||
*/ | ||
|
@@ -934,9 +933,9 @@ protected function sendTheMail(Address $recipient, array $recipientRow = null): | |
/** | ||
* Add HTML to an email | ||
* | ||
* @param string $file String location of the HTML | ||
* @param string $file String location of the HTML | ||
* | ||
* @return mixed bool: HTML fetch status. string: if HTML is a frameset. | ||
* @return mixed bool: HTML fetch status. string: if HTML is a frameset. | ||
*/ | ||
public function addHTML(string $file) | ||
{ | ||
|
@@ -957,7 +956,7 @@ public function addHTML(string $file) | |
/** | ||
* Fetches the HTML-content from either url or local server file | ||
* | ||
* @param string $url Url of the html to fetch | ||
* @param string $url Url of the html to fetch | ||
* | ||
* @return bool Whether the data was fetched or not | ||
*/ | ||
|
@@ -1296,7 +1295,7 @@ public function extractFramesInfo(): bool | |
* Creates a regular expression out of a list of tags | ||
* | ||
* @param array $tags Array the list of tags | ||
* (either as array or string if it is one tag) | ||
* (either as array or string if it is one tag) | ||
* | ||
* @return string the regular expression | ||
*/ | ||
|
@@ -1317,7 +1316,7 @@ protected function tag_regex(array $tags): string | |
* Check it with is_set(); | ||
* | ||
* @param string $tag Tag is either like this "<TAG OPTION ATTRIB=VALUE>" or | ||
* this " OPTION ATTRIB=VALUE>" which means you can omit the tag-name | ||
* this " OPTION ATTRIB=VALUE>" which means you can omit the tag-name | ||
* @param bool $removeQuotes When TRUE (default) quotes around a value will get removed | ||
* | ||
* @return array array with attributes as keys in lower-case | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,8 @@ | |
use TYPO3\CMS\Core\DataHandling\DataHandler; | ||
use TYPO3\CMS\Core\Localization\LanguageService; | ||
use TYPO3\CMS\Core\Messaging\FlashMessage; | ||
use TYPO3\CMS\Core\Messaging\FlashMessageService; | ||
use TYPO3\CMS\Core\Messaging\FlashMessageQueue; | ||
use TYPO3\CMS\Core\Messaging\FlashMessageService; | ||
use TYPO3\CMS\Core\Resource\DuplicationBehavior; | ||
use TYPO3\CMS\Core\Resource\ResourceFactory; | ||
use TYPO3\CMS\Core\Utility\ArrayUtility; | ||
|
@@ -39,7 +39,7 @@ | |
/** | ||
* Recipient list module for tx_directmail extension | ||
* | ||
* @author Ivan-Dharma Kartolo <[email protected]> | ||
* @author Ivan-Dharma Kartolo <[email protected]> | ||
*/ | ||
class Importer | ||
{ | ||
|
@@ -76,7 +76,7 @@ public function init(&$pObj): void | |
/** | ||
* Import CSV-Data in step-by-step mode | ||
* | ||
* @return array HTML form | ||
* @return array HTML form | ||
*/ | ||
public function displayImport(): array | ||
{ | ||
|
@@ -211,7 +211,7 @@ public function displayImport(): array | |
} | ||
|
||
// check if "email" is mapped | ||
$error = []; | ||
$error = []; | ||
if (isset($stepCurrent) && $stepCurrent === 'startImport') { | ||
$map = $this->indata['map']; | ||
// check noMap | ||
|
@@ -227,9 +227,9 @@ public function displayImport(): array | |
} | ||
|
||
$out = ''; | ||
if(!isset($stepCurrent)) { | ||
$stepCurrent = ''; | ||
} | ||
if (!isset($stepCurrent)) { | ||
$stepCurrent = ''; | ||
} | ||
switch ($stepCurrent) { | ||
case 'conf': | ||
$output['conf']['show'] = true; | ||
|
@@ -269,7 +269,7 @@ public function displayImport(): array | |
// TODO: make it variable? | ||
$optUnique = [ | ||
['val' => 'email', 'text' => 'email'], | ||
['val' =>'name', 'text' => 'name'], | ||
['val' => 'name', 'text' => 'name'], | ||
]; | ||
|
||
$output['conf']['disableInput'] = ($this->params['inputDisable'] ?? 0) == 1 ? true : false; | ||
|
@@ -524,8 +524,10 @@ public function displayImport(): array | |
* use it to manipulate the steps in the import process | ||
*/ | ||
$hookObjectsArr = []; | ||
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail/mod3/class.tx_directmail_recipient_list.php']['displayImport']) && | ||
is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail/mod3/class.tx_directmail_recipient_list.php']['displayImport'])) { | ||
if ( | ||
isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail/mod3/class.tx_directmail_recipient_list.php']['displayImport']) && | ||
is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail/mod3/class.tx_directmail_recipient_list.php']['displayImport']) | ||
) { | ||
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail/mod3/class.tx_directmail_recipient_list.php']['displayImport'] as $classRef) { | ||
$hookObjectsArr[] = GeneralUtility::makeInstance($classRef); | ||
} | ||
|
@@ -562,7 +564,7 @@ public function filterCSV(array $mappedCsv): array | |
foreach ($mappedCsv as $k => $csvData) { | ||
if (!in_array($k, $remove)) { | ||
$found = 0; | ||
foreach ($cmpCsv as $kk =>$cmpData) { | ||
foreach ($cmpCsv as $kk => $cmpData) { | ||
if ($k != $kk) { | ||
if ($csvData[$this->indata['record_unique']] == $cmpData[$this->indata['record_unique']]) { | ||
$double[] = $mappedCsv[$kk]; | ||
|
@@ -769,7 +771,7 @@ public function addDataArray(array &$data, $id, array $dataArray): void | |
* Read in the given CSV file. The function is used during the final file import. | ||
* Removes first the first data row if the CSV has fieldnames. | ||
* | ||
* @return array file content in array | ||
* @return array file content in array | ||
*/ | ||
public function readCSV(): array | ||
{ | ||
|
@@ -813,9 +815,9 @@ public function readCSV(): array | |
* Read in the given CSV file. Only showed a couple of the CSV values as example | ||
* Removes first the first data row if the CSV has fieldnames. | ||
* | ||
* @param int $records Number of example values | ||
* @param int $records Number of example values | ||
* | ||
* @return array File content in array | ||
* @return array File content in array | ||
*/ | ||
public function readExampleCSV($records = 3): array | ||
{ | ||
|
@@ -865,7 +867,7 @@ public function readExampleCSV($records = 3): array | |
* | ||
* @param array $data Contains values to convert | ||
* | ||
* @return array array of charset-converted values | ||
* @return array array of charset-converted values | ||
* @see \TYPO3\CMS\Core\Charset\CharsetConverter::conv[] | ||
*/ | ||
public function convCharset(array $data): array | ||
|
@@ -883,7 +885,7 @@ public function convCharset(array $data): array | |
/** | ||
* Write CSV Data to a temporary file and will be used for the import | ||
* | ||
* @return array path and uid of the temp file | ||
* @return array path and uid of the temp file | ||
*/ | ||
public function writeTempFile(string $csv, string $newFile, int $newFileUid): array | ||
{ | ||
|
@@ -933,7 +935,7 @@ public function writeTempFile(string $csv, string $newFile, int $newFileUid): ar | |
/** | ||
* Checks if a file has been uploaded and returns the complete physical fileinfo if so. | ||
* | ||
* @return array \TYPO3\CMS\Core\Resource\File the complete physical file name, including path info. | ||
* @return array \TYPO3\CMS\Core\Resource\File the complete physical file name, including path info. | ||
* @throws \Exception | ||
*/ | ||
public function checkUpload(): array | ||
|
@@ -979,7 +981,7 @@ private function getFileById(int $fileUid) //: \TYPO3\CMS\Core\Resource\File|boo | |
$resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class); | ||
try { | ||
return $resourceFactory->getFileObject($fileUid); | ||
} catch(\TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException $e) { | ||
} catch (\TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException $e) { | ||
} | ||
return false; | ||
} | ||
|
@@ -1000,7 +1002,7 @@ private function getFileAbsolutePath(int $fileUid): string | |
/** | ||
* Returns first temporary folder of the user account | ||
* | ||
* @return string Absolute path to first "_temp_" folder of the current user, otherwise blank. | ||
* @return string Absolute path to first "_temp_" folder of the current user, otherwise blank. | ||
*/ | ||
public function userTempFolder(): string | ||
{ | ||
|
@@ -1044,11 +1046,11 @@ protected function getMessageQueue(): FlashMessageQueue | |
|
||
/** | ||
https://api.typo3.org/11.5/class_t_y_p_o3_1_1_c_m_s_1_1_core_1_1_messaging_1_1_abstract_message.html | ||
const NOTICE = -2 | ||
const INFO = -1 | ||
const OK = 0 | ||
const WARNING = 1 | ||
const ERROR = 2 | ||
const NOTICE = -2 | ||
const INFO = -1 | ||
const OK = 0 | ||
const WARNING = 1 | ||
const ERROR = 2 | ||
* @param string $messageText | ||
* @param string $messageHeader | ||
* @param int $messageType | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ | |
/** | ||
* JumpUrl processing hook on TYPO3\CMS\Frontend\Http\RequestHandler | ||
* | ||
* @author Ivan Kartolo <[email protected]> | ||
* @author Ivan Kartolo <[email protected]> | ||
*/ | ||
class JumpurlController implements MiddlewareInterface | ||
{ | ||
|
@@ -125,7 +125,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface | |
} | ||
|
||
// to count the dmailerping correctly, we need something unique | ||
$submittedAuthCode = preg_replace("/[^a-zA-Z0-9]/", "", $submittedAuthCode); | ||
$submittedAuthCode = preg_replace('/[^a-zA-Z0-9]/', '', $submittedAuthCode); | ||
} | ||
|
||
if ($this->responseType !== 0) { | ||
|
@@ -191,7 +191,7 @@ protected function getTargetUrl(int $targetIndex): string | |
['allowed_classes' => false] | ||
); | ||
|
||
if(is_array($mailContent)) { | ||
if (is_array($mailContent)) { | ||
if ($targetIndex >= 0) { | ||
// Link (number) | ||
$this->responseType = self::RESPONSE_TYPE_HREF; | ||
|
@@ -266,7 +266,7 @@ protected function substituteUserMarkersFromTargetUrl(string $targetUrl): string | |
if (isset($this->recipientRecord[$substField])) { | ||
$processedTargetUrl = str_replace( | ||
'###USER_' . $substField . '###', | ||
(string) $this->recipientRecord[$substField], | ||
(string)$this->recipientRecord[$substField], | ||
$processedTargetUrl | ||
); | ||
} | ||
|
@@ -304,11 +304,13 @@ protected function substituteSystemMarkersFromTargetUrl(string $targetUrl): stri | |
protected function performFeUserAutoLogin() | ||
{ | ||
// TODO: add a switch in Direct Mail configuration to decide if this option should be enabled by default | ||
if ($this->recipientTable === 'fe_users' && | ||
if ( | ||
$this->recipientTable === 'fe_users' && | ||
GeneralUtility::inList( | ||
$this->directMailRecord['authcode_fieldList'], | ||
'password' | ||
)) { | ||
) | ||
) { | ||
$_POST['user'] = $this->recipientRecord['username']; | ||
$_POST['pass'] = $this->recipientRecord['password']; | ||
$_POST['pid'] = $this->recipientRecord['pid']; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.