Commit 5c8af34c authored by Oliver Klee's avatar Oliver Klee Committed by Stefan Bürk
Browse files

[TASK] Improve a type annotation in the setup extension

Also add a missing type cast.

Used command:
> ./Build/Scripts/runTests.sh -s phpstanGenerateBaseline

Resolves: #97426
Releases: main, 11.5
Change-Id: I5a48c0737833792f99652cc54a90db9bcbe798b8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74351


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Simon Schaufelberger's avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Simon Schaufelberger's avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
parent 5e89b5dc
......@@ -4330,16 +4330,6 @@ parameters:
count: 1
path: ../../typo3/sysext/scheduler/Classes/Scheduler.php
-
message: "#^If condition is always true\\.$#"
count: 1
path: ../../typo3/sysext/setup/Classes/Controller/SetupModuleController.php
-
message: "#^Strict comparison using \\=\\=\\= between int\\<min, \\-1\\>\\|int\\<1, max\\> and 'delete' will always evaluate to false\\.$#"
count: 1
path: ../../typo3/sysext/setup/Classes/Controller/SetupModuleController.php
-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 1
......
......@@ -742,7 +742,7 @@ class SetupModuleController
* Set avatar fileUid for backend user
*
* @param int $beUserId
* @param int $fileUid
* @param numeric-string|''|'delete' $fileUid either a file UID, an empty string, or `delete`
* @param array $storeRec
*/
protected function setAvatarFileUid($beUserId, $fileUid, array &$storeRec)
......@@ -788,11 +788,10 @@ class SetupModuleController
}
// Create new reference
if ($fileUid) {
if ((int)$fileUid > 0) {
// Get file object
try {
$file = GeneralUtility::makeInstance(ResourceFactory::class)->getFileObject($fileUid);
$file = GeneralUtility::makeInstance(ResourceFactory::class)->getFileObject((int)$fileUid);
} catch (FileDoesNotExistException $e) {
$file = false;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment