diff options
author | Morris Jobke <hey@morrisjobke.de> | 2021-01-11 12:57:03 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2021-01-11 13:14:41 +0100 |
commit | 24d436cb600a725ba162a5387552a996a6fc486f (patch) | |
tree | 91e00673fad2c999776991ca57d09e8af9a10ed5 /apps | |
parent | 8b656e321bbf358d8074ce8a3976fac5defdece0 (diff) | |
download | nextcloud-server-24d436cb600a725ba162a5387552a996a6fc486f.tar.gz nextcloud-server-24d436cb600a725ba162a5387552a996a6fc486f.zip |
Remove unneeded casts that were found by Psalm
In preparation of the update of Psalm from 4.2.1 to 4.3.1+ (see https://github.com/nextcloud/server/pull/24521)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps')
23 files changed, 68 insertions, 69 deletions
diff --git a/apps/comments/lib/Activity/Provider.php b/apps/comments/lib/Activity/Provider.php index 566b7835b56..527c9c4ca69 100644 --- a/apps/comments/lib/Activity/Provider.php +++ b/apps/comments/lib/Activity/Provider.php @@ -185,7 +185,7 @@ class Provider implements IProvider { // they will get the dead entries in their stream. return [ 'actor' => $subjectParameters[0], - 'fileId' => (int) $event->getObjectId(), + 'fileId' => $event->getObjectId(), 'filePath' => trim($subjectParameters[1], '/'), ]; } diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php index 7e762b4c088..382825d8955 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php @@ -229,32 +229,32 @@ class Calendar extends Base { case self::SUBJECT_UNSHARE_USER . '_self': return [ 'actor' => $this->generateUserParameter($parameters[0]), - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateLegacyCalendarParameter($event->getObjectId(), $parameters[1]), ]; case self::SUBJECT_SHARE_USER . '_you': case self::SUBJECT_UNSHARE_USER . '_you': return [ 'user' => $this->generateUserParameter($parameters[0]), - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateLegacyCalendarParameter($event->getObjectId(), $parameters[1]), ]; case self::SUBJECT_SHARE_USER . '_by': case self::SUBJECT_UNSHARE_USER . '_by': return [ 'user' => $this->generateUserParameter($parameters[0]), - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateLegacyCalendarParameter($event->getObjectId(), $parameters[1]), 'actor' => $this->generateUserParameter($parameters[2]), ]; case self::SUBJECT_SHARE_GROUP . '_you': case self::SUBJECT_UNSHARE_GROUP . '_you': return [ 'group' => $this->generateGroupParameter($parameters[0]), - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateLegacyCalendarParameter($event->getObjectId(), $parameters[1]), ]; case self::SUBJECT_SHARE_GROUP . '_by': case self::SUBJECT_UNSHARE_GROUP . '_by': return [ 'group' => $this->generateGroupParameter($parameters[0]), - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateLegacyCalendarParameter($event->getObjectId(), $parameters[1]), 'actor' => $this->generateUserParameter($parameters[2]), ]; } diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Event.php b/apps/dav/lib/CalDAV/Activity/Provider/Event.php index 4aa2c8c0b0e..8850715a1c5 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Event.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Event.php @@ -195,14 +195,14 @@ class Event extends Base { case self::SUBJECT_OBJECT_UPDATE . '_event': return [ 'actor' => $this->generateUserParameter($parameters[0]), - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateLegacyCalendarParameter($event->getObjectId(), $parameters[1]), 'event' => $this->generateObjectParameter($parameters[2]), ]; case self::SUBJECT_OBJECT_ADD . '_event_self': case self::SUBJECT_OBJECT_DELETE . '_event_self': case self::SUBJECT_OBJECT_UPDATE . '_event_self': return [ - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateLegacyCalendarParameter($event->getObjectId(), $parameters[1]), 'event' => $this->generateObjectParameter($parameters[2]), ]; } diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php index 64f542b9f7e..2f6c088be0a 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php @@ -127,7 +127,7 @@ class Todo extends Event { case self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action': return [ 'actor' => $this->generateUserParameter($parameters[0]), - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateLegacyCalendarParameter($event->getObjectId(), $parameters[1]), 'todo' => $this->generateObjectParameter($parameters[2]), ]; case self::SUBJECT_OBJECT_ADD . '_todo_self': @@ -136,7 +136,7 @@ class Todo extends Event { case self::SUBJECT_OBJECT_UPDATE . '_todo_completed_self': case self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action_self': return [ - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), + 'calendar' => $this->generateLegacyCalendarParameter($event->getObjectId(), $parameters[1]), 'todo' => $this->generateObjectParameter($parameters[2]), ]; } diff --git a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php index f34baffd784..e5ae9064ae7 100644 --- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php +++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php @@ -138,7 +138,7 @@ class PublishPlugin extends ServerPlugin { $canPublish &= ($node->getOwner() === $node->getPrincipalURI()); } - return new AllowedSharingModes((bool)$canShare, (bool)$canPublish); + return new AllowedSharingModes($canShare, $canPublish); }); } } diff --git a/apps/encryption/lib/Controller/RecoveryController.php b/apps/encryption/lib/Controller/RecoveryController.php index 801ae42e033..6455700cd9b 100644 --- a/apps/encryption/lib/Controller/RecoveryController.php +++ b/apps/encryption/lib/Controller/RecoveryController.php @@ -75,36 +75,36 @@ class RecoveryController extends Controller { public function adminRecovery($recoveryPassword, $confirmPassword, $adminEnableRecovery) { // Check if both passwords are the same if (empty($recoveryPassword)) { - $errorMessage = (string)$this->l->t('Missing recovery key password'); + $errorMessage = $this->l->t('Missing recovery key password'); return new DataResponse(['data' => ['message' => $errorMessage]], Http::STATUS_BAD_REQUEST); } if (empty($confirmPassword)) { - $errorMessage = (string)$this->l->t('Please repeat the recovery key password'); + $errorMessage = $this->l->t('Please repeat the recovery key password'); return new DataResponse(['data' => ['message' => $errorMessage]], Http::STATUS_BAD_REQUEST); } if ($recoveryPassword !== $confirmPassword) { - $errorMessage = (string)$this->l->t('Repeated recovery key password does not match the provided recovery key password'); + $errorMessage = $this->l->t('Repeated recovery key password does not match the provided recovery key password'); return new DataResponse(['data' => ['message' => $errorMessage]], Http::STATUS_BAD_REQUEST); } if (isset($adminEnableRecovery) && $adminEnableRecovery === '1') { if ($this->recovery->enableAdminRecovery($recoveryPassword)) { - return new DataResponse(['data' => ['message' => (string)$this->l->t('Recovery key successfully enabled')]]); + return new DataResponse(['data' => ['message' => $this->l->t('Recovery key successfully enabled')]]); } - return new DataResponse(['data' => ['message' => (string)$this->l->t('Could not enable recovery key. Please check your recovery key password!')]], Http::STATUS_BAD_REQUEST); + return new DataResponse(['data' => ['message' => $this->l->t('Could not enable recovery key. Please check your recovery key password!')]], Http::STATUS_BAD_REQUEST); } elseif (isset($adminEnableRecovery) && $adminEnableRecovery === '0') { if ($this->recovery->disableAdminRecovery($recoveryPassword)) { - return new DataResponse(['data' => ['message' => (string)$this->l->t('Recovery key successfully disabled')]]); + return new DataResponse(['data' => ['message' => $this->l->t('Recovery key successfully disabled')]]); } - return new DataResponse(['data' => ['message' => (string)$this->l->t('Could not disable recovery key. Please check your recovery key password!')]], Http::STATUS_BAD_REQUEST); + return new DataResponse(['data' => ['message' => $this->l->t('Could not disable recovery key. Please check your recovery key password!')]], Http::STATUS_BAD_REQUEST); } // this response should never be sent but just in case. - return new DataResponse(['data' => ['message' => (string)$this->l->t('Missing parameters')]], Http::STATUS_BAD_REQUEST); + return new DataResponse(['data' => ['message' => $this->l->t('Missing parameters')]], Http::STATUS_BAD_REQUEST); } /** @@ -116,22 +116,22 @@ class RecoveryController extends Controller { public function changeRecoveryPassword($newPassword, $oldPassword, $confirmPassword) { //check if both passwords are the same if (empty($oldPassword)) { - $errorMessage = (string)$this->l->t('Please provide the old recovery password'); + $errorMessage = $this->l->t('Please provide the old recovery password'); return new DataResponse(['data' => ['message' => $errorMessage]], Http::STATUS_BAD_REQUEST); } if (empty($newPassword)) { - $errorMessage = (string)$this->l->t('Please provide a new recovery password'); + $errorMessage = $this->l->t('Please provide a new recovery password'); return new DataResponse(['data' => ['message' => $errorMessage]], Http::STATUS_BAD_REQUEST); } if (empty($confirmPassword)) { - $errorMessage = (string)$this->l->t('Please repeat the new recovery password'); + $errorMessage = $this->l->t('Please repeat the new recovery password'); return new DataResponse(['data' => ['message' => $errorMessage]], Http::STATUS_BAD_REQUEST); } if ($newPassword !== $confirmPassword) { - $errorMessage = (string)$this->l->t('Repeated recovery key password does not match the provided recovery key password'); + $errorMessage = $this->l->t('Repeated recovery key password does not match the provided recovery key password'); return new DataResponse(['data' => ['message' => $errorMessage]], Http::STATUS_BAD_REQUEST); } @@ -142,14 +142,14 @@ class RecoveryController extends Controller { return new DataResponse( [ 'data' => [ - 'message' => (string)$this->l->t('Password successfully changed.')] + 'message' => $this->l->t('Password successfully changed.')] ] ); } return new DataResponse( [ 'data' => [ - 'message' => (string)$this->l->t('Could not change the password. Maybe the old password was not correct.') + 'message' => $this->l->t('Could not change the password. Maybe the old password was not correct.') ] ], Http::STATUS_BAD_REQUEST); } @@ -169,14 +169,14 @@ class RecoveryController extends Controller { return new DataResponse( [ 'data' => [ - 'message' => (string)$this->l->t('Recovery Key disabled')] + 'message' => $this->l->t('Recovery Key disabled')] ] ); } return new DataResponse( [ 'data' => [ - 'message' => (string)$this->l->t('Recovery Key enabled')] + 'message' => $this->l->t('Recovery Key enabled')] ] ); } @@ -184,7 +184,7 @@ class RecoveryController extends Controller { return new DataResponse( [ 'data' => [ - 'message' => (string)$this->l->t('Could not enable the recovery key, please try again or contact your administrator') + 'message' => $this->l->t('Could not enable the recovery key, please try again or contact your administrator') ] ], Http::STATUS_BAD_REQUEST); } diff --git a/apps/encryption/lib/Controller/SettingsController.php b/apps/encryption/lib/Controller/SettingsController.php index f918f176767..6ccfe51400e 100644 --- a/apps/encryption/lib/Controller/SettingsController.php +++ b/apps/encryption/lib/Controller/SettingsController.php @@ -142,11 +142,11 @@ class SettingsController extends Controller { if ($result === true) { $this->session->setStatus(Session::INIT_SUCCESSFUL); return new DataResponse( - ['message' => (string) $this->l->t('Private key password successfully updated.')] + ['message' => $this->l->t('Private key password successfully updated.')] ); } else { return new DataResponse( - ['message' => (string) $errorMessage], + ['message' => $errorMessage], Http::STATUS_BAD_REQUEST ); } diff --git a/apps/encryption/lib/Controller/StatusController.php b/apps/encryption/lib/Controller/StatusController.php index f3541eeed93..a17023fdcfd 100644 --- a/apps/encryption/lib/Controller/StatusController.php +++ b/apps/encryption/lib/Controller/StatusController.php @@ -73,25 +73,25 @@ class StatusController extends Controller { switch ($this->session->getStatus()) { case Session::INIT_EXECUTED: $status = 'interactionNeeded'; - $message = (string)$this->l->t( + $message = $this->l->t( 'Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files.' ); break; case Session::NOT_INITIALIZED: $status = 'interactionNeeded'; if ($this->encryptionManager->isEnabled()) { - $message = (string)$this->l->t( + $message = $this->l->t( 'Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.' ); } else { - $message = (string)$this->l->t( + $message = $this->l->t( 'Please enable server side encryption in the admin settings in order to use the encryption module.' ); } break; case Session::INIT_SUCCESSFUL: $status = 'success'; - $message = (string)$this->l->t('Encryption app is enabled and ready'); + $message = $this->l->t('Encryption app is enabled and ready'); } return new DataResponse( diff --git a/apps/encryption/lib/Crypto/EncryptAll.php b/apps/encryption/lib/Crypto/EncryptAll.php index 8124f2a7a75..3d18d8b3a53 100644 --- a/apps/encryption/lib/Crypto/EncryptAll.php +++ b/apps/encryption/lib/Crypto/EncryptAll.php @@ -422,7 +422,7 @@ class EncryptAll { continue; } - $subject = (string)$this->l->t('one-time password for server-side-encryption'); + $subject = $this->l->t('one-time password for server-side-encryption'); list($htmlBody, $textBody) = $this->createMailBody($password); // send it out now diff --git a/apps/federatedfilesharing/lib/Notifier.php b/apps/federatedfilesharing/lib/Notifier.php index bd0ca88d885..f365a14a13c 100644 --- a/apps/federatedfilesharing/lib/Notifier.php +++ b/apps/federatedfilesharing/lib/Notifier.php @@ -151,14 +151,14 @@ class Notifier implements INotifier { switch ($action->getLabel()) { case 'accept': $action->setParsedLabel( - (string)$l->t('Accept') + $l->t('Accept') ) ->setPrimary(true); break; case 'decline': $action->setParsedLabel( - (string)$l->t('Decline') + $l->t('Decline') ); break; } diff --git a/apps/federation/lib/Controller/SettingsController.php b/apps/federation/lib/Controller/SettingsController.php index 7f68f238366..466f1c008a7 100644 --- a/apps/federation/lib/Controller/SettingsController.php +++ b/apps/federation/lib/Controller/SettingsController.php @@ -71,7 +71,7 @@ class SettingsController extends Controller { [ 'url' => $url, 'id' => $id, - 'message' => (string) $this->l->t('Added to the list of trusted servers') + 'message' => $this->l->t('Added to the list of trusted servers') ] ); } diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index a852be5dad5..206ddbd6ed6 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -321,7 +321,7 @@ class ApiController extends Controller { foreach ($navItems as $item) { // check if data is valid if (($show === 0 || $show === 1) && isset($item['expandedState']) && $key === $item['expandedState']) { - $this->config->setUserValue($this->userSession->getUser()->getUID(), 'files', $key, (int)$show); + $this->config->setUserValue($this->userSession->getUser()->getUID(), 'files', $key, $show); return new Response(); } } diff --git a/apps/files_external/lib/Controller/GlobalStoragesController.php b/apps/files_external/lib/Controller/GlobalStoragesController.php index 7ce2c84b8a9..f6032ae902b 100644 --- a/apps/files_external/lib/Controller/GlobalStoragesController.php +++ b/apps/files_external/lib/Controller/GlobalStoragesController.php @@ -179,7 +179,7 @@ class GlobalStoragesController extends StoragesController { } catch (NotFoundException $e) { return new DataResponse( [ - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) + 'message' => $this->l10n->t('Storage with ID "%d" not found', [$id]) ], Http::STATUS_NOT_FOUND ); diff --git a/apps/files_external/lib/Controller/StoragesController.php b/apps/files_external/lib/Controller/StoragesController.php index d58d61e3939..80adeb47f7d 100644 --- a/apps/files_external/lib/Controller/StoragesController.php +++ b/apps/files_external/lib/Controller/StoragesController.php @@ -145,7 +145,7 @@ abstract class StoragesController extends Controller { $this->logger->logException($e); return new DataResponse( [ - 'message' => (string)$this->l10n->t('Invalid backend or authentication mechanism class') + 'message' => $this->l10n->t('Invalid backend or authentication mechanism class') ], Http::STATUS_UNPROCESSABLE_ENTITY ); @@ -164,7 +164,7 @@ abstract class StoragesController extends Controller { if ($mountPoint === '') { return new DataResponse( [ - 'message' => (string)$this->l10n->t('Invalid mount point'), + 'message' => $this->l10n->t('Invalid mount point'), ], Http::STATUS_UNPROCESSABLE_ENTITY ); @@ -174,7 +174,7 @@ abstract class StoragesController extends Controller { // objectstore must not be sent from client side return new DataResponse( [ - 'message' => (string)$this->l10n->t('Objectstore forbidden'), + 'message' => $this->l10n->t('Objectstore forbidden'), ], Http::STATUS_UNPROCESSABLE_ENTITY ); @@ -188,7 +188,7 @@ abstract class StoragesController extends Controller { // invalid backend return new DataResponse( [ - 'message' => (string)$this->l10n->t('Invalid storage backend "%s"', [ + 'message' => $this->l10n->t('Invalid storage backend "%s"', [ $backend->getIdentifier(), ]), ], @@ -200,7 +200,7 @@ abstract class StoragesController extends Controller { // not permitted to use backend return new DataResponse( [ - 'message' => (string)$this->l10n->t('Not permitted to use backend "%s"', [ + 'message' => $this->l10n->t('Not permitted to use backend "%s"', [ $backend->getIdentifier(), ]), ], @@ -211,7 +211,7 @@ abstract class StoragesController extends Controller { // not permitted to use auth mechanism return new DataResponse( [ - 'message' => (string)$this->l10n->t('Not permitted to use authentication mechanism "%s"', [ + 'message' => $this->l10n->t('Not permitted to use authentication mechanism "%s"', [ $authMechanism->getIdentifier(), ]), ], @@ -223,7 +223,7 @@ abstract class StoragesController extends Controller { // unsatisfied parameters return new DataResponse( [ - 'message' => (string)$this->l10n->t('Unsatisfied backend parameters'), + 'message' => $this->l10n->t('Unsatisfied backend parameters'), ], Http::STATUS_UNPROCESSABLE_ENTITY ); @@ -232,7 +232,7 @@ abstract class StoragesController extends Controller { // unsatisfied parameters return new DataResponse( [ - 'message' => (string)$this->l10n->t('Unsatisfied authentication mechanism parameters'), + 'message' => $this->l10n->t('Unsatisfied authentication mechanism parameters'), ], Http::STATUS_UNPROCESSABLE_ENTITY ); @@ -347,7 +347,7 @@ abstract class StoragesController extends Controller { } catch (NotFoundException $e) { return new DataResponse( [ - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]), + 'message' => $this->l10n->t('Storage with ID "%d" not found', [$id]), ], Http::STATUS_NOT_FOUND ); @@ -376,7 +376,7 @@ abstract class StoragesController extends Controller { } catch (NotFoundException $e) { return new DataResponse( [ - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]), + 'message' => $this->l10n->t('Storage with ID "%d" not found', [$id]), ], Http::STATUS_NOT_FOUND ); diff --git a/apps/files_external/lib/Controller/UserGlobalStoragesController.php b/apps/files_external/lib/Controller/UserGlobalStoragesController.php index f26b4dd67f9..7bab5e47caa 100644 --- a/apps/files_external/lib/Controller/UserGlobalStoragesController.php +++ b/apps/files_external/lib/Controller/UserGlobalStoragesController.php @@ -125,7 +125,7 @@ class UserGlobalStoragesController extends StoragesController { } catch (NotFoundException $e) { return new DataResponse( [ - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) + 'message' => $this->l10n->t('Storage with ID "%d" not found', [$id]) ], Http::STATUS_NOT_FOUND ); @@ -169,7 +169,7 @@ class UserGlobalStoragesController extends StoragesController { } else { return new DataResponse( [ - 'message' => (string)$this->l10n->t('Storage with ID "%d" is not user editable', [$id]) + 'message' => $this->l10n->t('Storage with ID "%d" is not user editable', [$id]) ], Http::STATUS_FORBIDDEN ); @@ -177,7 +177,7 @@ class UserGlobalStoragesController extends StoragesController { } catch (NotFoundException $e) { return new DataResponse( [ - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) + 'message' => $this->l10n->t('Storage with ID "%d" not found', [$id]) ], Http::STATUS_NOT_FOUND ); diff --git a/apps/files_external/lib/Controller/UserStoragesController.php b/apps/files_external/lib/Controller/UserStoragesController.php index 8686921c90c..5b981b7c643 100644 --- a/apps/files_external/lib/Controller/UserStoragesController.php +++ b/apps/files_external/lib/Controller/UserStoragesController.php @@ -198,7 +198,7 @@ class UserStoragesController extends StoragesController { } catch (NotFoundException $e) { return new DataResponse( [ - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) + 'message' => $this->l10n->t('Storage with ID "%d" not found', [$id]) ], Http::STATUS_NOT_FOUND ); diff --git a/apps/files_external/lib/MountConfig.php b/apps/files_external/lib/MountConfig.php index 23b37544c54..30b45ccf0cc 100644 --- a/apps/files_external/lib/MountConfig.php +++ b/apps/files_external/lib/MountConfig.php @@ -295,11 +295,11 @@ class MountConfig { private static function getSingleDependencyMessage(\OCP\IL10N $l, $module, $backend) { switch (strtolower($module)) { case 'curl': - return (string)$l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]); + return $l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]); case 'ftp': - return (string)$l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]); + return $l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]); default: - return (string)$l->t('"%1$s" is not installed. Mounting of %2$s is not possible. Please ask your system administrator to install it.', [$module, $backend]); + return $l->t('"%1$s" is not installed. Mounting of %2$s is not possible. Please ask your system administrator to install it.', [$module, $backend]); } } diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index c8b4e857520..12408d8e108 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1064,7 +1064,7 @@ class ShareAPIController extends OCSController { } if ($permissions !== null) { - $newPermissions = (int) $permissions; + $newPermissions = $permissions; $newPermissions = $newPermissions & ~Constants::PERMISSION_SHARE; } @@ -1147,7 +1147,6 @@ class ShareAPIController extends OCSController { // NOT A LINK SHARE else { if ($permissions !== null) { - $permissions = (int) $permissions; $share->setPermissions($permissions); } diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php index c857df85229..33ac1662a4d 100644 --- a/apps/files_sharing/lib/Controller/ShareesAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php @@ -212,7 +212,7 @@ class ShareesAPIController extends OCSController { } sort($shareTypes); - $this->limit = (int) $perPage; + $this->limit = $perPage; $this->offset = $perPage * ($page - 1); // In global scale mode we always search the loogup server diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 6acd970c40e..b21301cd96a 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -239,9 +239,9 @@ class CheckSetupController extends Controller { return ''; } - $features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); + $features = $this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); if (!$this->config->getSystemValue('appstoreenabled', true)) { - $features = (string)$this->l10n->t('Federated Cloud Sharing'); + $features = $this->l10n->t('Federated Cloud Sharing'); } // Check if at least OpenSSL after 1.01d or 1.0.2b diff --git a/apps/sharebymail/lib/Activity.php b/apps/sharebymail/lib/Activity.php index 79d7028afcf..23f036c4700 100644 --- a/apps/sharebymail/lib/Activity.php +++ b/apps/sharebymail/lib/Activity.php @@ -288,24 +288,24 @@ class Activity implements IProvider { case self::SUBJECT_SHARED_EMAIL_SELF: case self::SUBJECT_UNSHARED_EMAIL_SELF: return [ - 'file' => $this->generateFileParameter((int) $event->getObjectId(), $parameters[0]), + 'file' => $this->generateFileParameter($event->getObjectId(), $parameters[0]), 'email' => $this->generateEmailParameter($parameters[1]), ]; case self::SUBJECT_SHARED_EMAIL_BY: case self::SUBJECT_UNSHARED_EMAIL_BY: return [ - 'file' => $this->generateFileParameter((int) $event->getObjectId(), $parameters[0]), + 'file' => $this->generateFileParameter($event->getObjectId(), $parameters[0]), 'email' => $this->generateEmailParameter($parameters[1]), 'actor' => $this->generateUserParameter($parameters[2]), ]; case self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND: return [ - 'file' => $this->generateFileParameter((int) $event->getObjectId(), $parameters[0]), + 'file' => $this->generateFileParameter($event->getObjectId(), $parameters[0]), 'email' => $this->generateEmailParameter($parameters[1]), ]; case self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF: return [ - 'file' => $this->generateFileParameter((int) $event->getObjectId(), $parameters[0]), + 'file' => $this->generateFileParameter($event->getObjectId(), $parameters[0]), ]; } throw new \InvalidArgumentException(); diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php index 68d1ff311fe..65b7be430ed 100644 --- a/apps/theming/lib/IconBuilder.php +++ b/apps/theming/lib/IconBuilder.php @@ -198,8 +198,8 @@ class IconBuilder { // offset for icon positioning $border_w = (int)($appIconFile->getImageWidth() * 0.05); $border_h = (int)($appIconFile->getImageHeight() * 0.05); - $innerWidth = (int)($appIconFile->getImageWidth() - $border_w * 2); - $innerHeight = (int)($appIconFile->getImageHeight() - $border_h * 2); + $innerWidth = ($appIconFile->getImageWidth() - $border_w * 2); + $innerHeight = ($appIconFile->getImageHeight() - $border_h * 2); $appIconFile->adaptiveResizeImage($innerWidth, $innerHeight); // center icon $offset_w = 512 / 2 - $innerWidth / 2; diff --git a/apps/workflowengine/lib/Check/RequestUserAgent.php b/apps/workflowengine/lib/Check/RequestUserAgent.php index 9679f631897..d5ca80e9d3e 100644 --- a/apps/workflowengine/lib/Check/RequestUserAgent.php +++ b/apps/workflowengine/lib/Check/RequestUserAgent.php @@ -76,7 +76,7 @@ class RequestUserAgent extends AbstractStringCheck { * @return string */ protected function getActualValue() { - return (string) $this->request->getHeader('User-Agent'); + return $this->request->getHeader('User-Agent'); } public function isAvailableForScope(int $scope): bool { |