From f25a71806baff92b4fa51e35242eaeb805f82d9f Mon Sep 17 00:00:00 2001 From: provokateurin Date: Wed, 23 Oct 2024 17:06:59 +0200 Subject: [PATCH] fix(apps): Fix wrong or missing casts Signed-off-by: provokateurin --- .../lib/OCM/CloudFederationProviderFiles.php | 2 +- apps/files_trashbin/lib/Trashbin.php | 2 +- .../user_ldap/ajax/getNewServerConfigPrefix.php | 2 +- apps/workflowengine/lib/Check/RequestTime.php | 2 +- build/psalm-baseline.xml | 17 ----------------- 5 files changed, 4 insertions(+), 21 deletions(-) diff --git a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php index 7e07703f43042..029e94eeef842 100644 --- a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php +++ b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php @@ -490,7 +490,7 @@ private function unshare($id, array $notification) { $notification = $this->notificationManager->createNotification(); $notification->setApp('files_sharing') ->setUser($share['user']) - ->setObject('remote_share', (int)$share['id']); + ->setObject('remote_share', (string)$share['id']); $this->notificationManager->markProcessed($notification); $event = $this->activityManager->generateEvent(); diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index f6791f78a3858..32fd81465fa62 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -980,7 +980,7 @@ private static function getVersionsFromTrash($filename, $timestamp, string $user $pattern = \OC::$server->getDatabaseConnection()->escapeLikeParameter(basename($filename)); if ($timestamp) { // fetch for old versions - $escapedTimestamp = \OC::$server->getDatabaseConnection()->escapeLikeParameter($timestamp); + $escapedTimestamp = \OC::$server->getDatabaseConnection()->escapeLikeParameter((string)$timestamp); $pattern .= '.v%.d' . $escapedTimestamp; $offset = -strlen($escapedTimestamp) - 2; } else { diff --git a/apps/user_ldap/ajax/getNewServerConfigPrefix.php b/apps/user_ldap/ajax/getNewServerConfigPrefix.php index 9ee225ddaa02e..a91c3c516ab8f 100644 --- a/apps/user_ldap/ajax/getNewServerConfigPrefix.php +++ b/apps/user_ldap/ajax/getNewServerConfigPrefix.php @@ -18,7 +18,7 @@ sort($serverConnections); $lk = array_pop($serverConnections); $ln = (int)str_replace('s', '', $lk); -$nk = 's' . str_pad($ln + 1, 2, '0', STR_PAD_LEFT); +$nk = 's' . str_pad((string)($ln + 1), 2, '0', STR_PAD_LEFT); $resultData = ['configPrefix' => $nk]; diff --git a/apps/workflowengine/lib/Check/RequestTime.php b/apps/workflowengine/lib/Check/RequestTime.php index f4d2093dc5071..b6b4e9176c263 100644 --- a/apps/workflowengine/lib/Check/RequestTime.php +++ b/apps/workflowengine/lib/Check/RequestTime.php @@ -62,7 +62,7 @@ protected function getTimestamp($currentTimestamp, $value) { [$hour1, $minute1] = explode(':', $time1); $date1 = new \DateTime('now', new \DateTimeZone($timezone1)); $date1->setTimestamp($currentTimestamp); - $date1->setTime($hour1, $minute1); + $date1->setTime((int)$hour1, (int)$minute1); return $date1->getTimestamp(); } diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index fbc5a4ac4fc6a..90d58778832cf 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -722,9 +722,6 @@ - - - @@ -978,9 +975,6 @@ - - - @@ -1072,11 +1066,6 @@ - - - - - @@ -1204,12 +1193,6 @@ - - - - - - Application::APP_ID, 'class' => get_class($subject)]]]>