Skip to content

Commit

Permalink
[TASK] Fix phpstan checkFunctionArgumentTypes errors in ext:recycler
Browse files Browse the repository at this point in the history
This patch fixes incompatible type usage in function arguments
and is preparatory work for introducing native type hints and
strict mode in all core files.

Releases: master, 10.4
Resolves: #92173
Change-Id: I7cfd566e0dbaf0b7f2d48664a4451b8892b2aa1c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65917
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
alexanderschnitzler authored and andreaskienast committed Sep 27, 2020
1 parent 6313154 commit 31bbcf9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Expand Up @@ -51,7 +51,7 @@ public function __construct()
/**
* Transforms the rows for the deleted records
*
* @param array $deletedRowsArray Array with table as key and array with all deleted rows
* @param array<string, array> $deletedRowsArray Array with table as key and array with all deleted rows
* @return array JSON array
*/
public function transform($deletedRowsArray)
Expand Down
Expand Up @@ -123,7 +123,7 @@ public function dispatch(ServerRequestInterface $request): ResponseInterface
$messageKey = 'flashmessage.undo.' . ($affectedRecords !== false ? 'success' : 'failure') . '.' . ((int)$affectedRecords === 1 ? 'singular' : 'plural');
$content = [
'success' => true,
'message' => sprintf(LocalizationUtility::translate($messageKey, 'recycler'), $affectedRecords)
'message' => sprintf((string)LocalizationUtility::translate($messageKey, 'recycler'), $affectedRecords)
];
break;
case 'deleteRecords':
Expand All @@ -142,7 +142,7 @@ public function dispatch(ServerRequestInterface $request): ResponseInterface
$messageKey = 'flashmessage.delete.' . ($success ? 'success' : 'failure') . '.' . ($affectedRecords === 1 ? 'singular' : 'plural');
$content = [
'success' => true,
'message' => sprintf(LocalizationUtility::translate($messageKey, 'recycler'), $affectedRecords)
'message' => sprintf((string)LocalizationUtility::translate($messageKey, 'recycler'), $affectedRecords)
];
break;
}
Expand Down
Expand Up @@ -182,7 +182,7 @@ protected function getJavaScriptConfiguration(NormalizedParams $normalizedParams
'startUid' => $this->id,
'isSSL' => $normalizedParams->isHttps(),
'deleteDisable' => !$this->allowDelete,
'depthSelection' => $this->getDataFromSession('depthSelection', 0),
'depthSelection' => $this->getDataFromSession('depthSelection', '0'),
'tableSelection' => $this->getDataFromSession('tableSelection', ''),
'States' => $this->getBackendUser()->uc['moduleData']['web_recycler']['States']
];
Expand Down
Expand Up @@ -386,6 +386,7 @@ public function undeleteData($recordsArray, $recursive = false)
$cmd = [];
foreach ($recordsArray as $record) {
[$table, $uid] = explode(':', $record);
$uid = (int)$uid;
// get all parent pages and cover them
$pid = RecyclerUtility::getPidOfUid($uid, $table);
if ($pid > 0) {
Expand Down

0 comments on commit 31bbcf9

Please sign in to comment.