diff --git a/apps/comments/lib/Activity/Provider.php b/apps/comments/lib/Activity/Provider.php
index 566b7835b5642c7c8ce9aa21e1a3bb98d7db64be..527c9c4ca690f63ab44123dca41a3fb5ff0e1c06 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 7e762b4c088e0350f6e3076731fb8ef318577c39..382825d8955f0de2ba05a5af6b0f6e305b55812d 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 4aa2c8c0b0ed033b5ba0ea3127fa7708c258f354..8850715a1c54db08a55681433d54ebd269c4485a 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 64f542b9f7e1957c2a6f452773b3ccc5d6ef22b0..2f6c088be0a191bfba4d98214f1ca957e65835a9 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 f34baffd784f761b707b2fa6c261c0ea304f93c0..e5ae9064ae7e0ef90f1f50ce117fd451fb055293 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 801ae42e033046a64c53d7d2229ef43ef3b9ce9d..6455700cd9b27c97d9cb2b3820e82496dc124929 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 f918f176767631107fa6658d6c66b40f9983757a..6ccfe51400ed3fef8760412643de7fe76d1e4fd4 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 f3541eeed93c76ba42d56979957936af38490335..a17023fdcfdd49c7c607010b7ce4c4e6e3e43d77 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 8124f2a7a7596fdfe254da5c00ed687704aa67b9..3d18d8b3a530b726dba83360750df8cf984caa52 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 bd0ca88d8857e82ee15ad0e7251ad7cb0de5988d..f365a14a13ca3fff8268d5b9ba4450d4babadf9c 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 7f68f238366eb0c77efb425977129dbb9ade5a32..466f1c008a72d00c8647226806a88c1a16e58e56 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 a852be5dad51bdf9020309a35235387a4cb0c938..206ddbd6ed62c1a1e4135c45a890a0cb3924ab4d 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 7ce2c84b8a91f26e1bfe98fd3f1e52c3afd4bcff..f6032ae902b9edbe458f1859115b3342ebe4c612 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 d58d61e3939d148fca4d033c971a50d87592feef..80adeb47f7d00468a70034bcdae53d1f2d24d9f7 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 f26b4dd67f9b729fdb1ed7dcd1a0396d6511a100..7bab5e47caa96de13650ad68b1a18d542aaf5e79 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 8686921c90c76cd366ffb665c9e00f3be87a5bbe..5b981b7c643c4ea45d5694bba67c8a0ef325d530 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 23b37544c54e24e2c6013375d2b9f2988b7f1d0b..30b45ccf0ccfc5c4d285db6b7ecdf1969e0d782f 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 c8b4e8575200cab8efca0f3d417921085646cc89..12408d8e108fa418420f381c95e3ccdab6012f48 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 c857df852293e6cfc7f6945d2786bf1f0eb4fe0d..33ac1662a4d1f6c734a9ad8579dffe72bae543c6 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 6acd970c40ef1e18e8030d3f662b67bb8ae2b053..b21301cd96a48e9b9d895b6d8cdb03c1b2807141 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 79d7028afcf83a04138f965fbfe6f17cb6d7bd31..23f036c470003eeb43aed26f3804e6e75e372143 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 68d1ff311fe8e7dd845440820439998144a22b16..65b7be430edf41e4c5bd02b8f2b2826fe31930a8 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 9679f631897b063a98673cc32f1c461c5fa0fab0..d5ca80e9d3e033cc19ad748360b8c9bc4e2f697f 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 {
diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php
index 41492905a04b2de1b7157fa46f832dbda7be57e6..f85b379f89ed1821e8b2a9d966913e8c3ac31076 100644
--- a/core/Migrations/Version13000Date20170718121200.php
+++ b/core/Migrations/Version13000Date20170718121200.php
@@ -1031,7 +1031,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
 			$insert->setParameter('propertypath', (string) $row['propertypath'])
 				->setParameter('propertyname', (string) $row['propertyname'])
 				->setParameter('propertyvalue', (string) $row['propertyvalue'])
-				->setParameter('userid', (string) ($match[2] ?? ''));
+				->setParameter('userid', ($match[2] ?? ''));
 			$insert->execute();
 		}
 	}
diff --git a/core/ajax/update.php b/core/ajax/update.php
index 137df3097a11fafce3b04628964722cccdd72494..09931ec91e2c1e9c4e1820b6ab235e0b55930574 100644
--- a/core/ajax/update.php
+++ b/core/ajax/update.php
@@ -47,7 +47,7 @@ $eventSource = \OC::$server->createEventSource();
 // need to send an initial message to force-init the event source,
 // which will then trigger its own CSRF check and produces its own CSRF error
 // message
-$eventSource->send('success', (string)$l->t('Preparing update'));
+$eventSource->send('success', $l->t('Preparing update'));
 
 class FeedBackHandler {
 	/** @var integer */
@@ -83,23 +83,23 @@ class FeedBackHandler {
 				if (empty($desc)) {
 					$desc = $this->currentStep;
 				}
-				$this->eventSource->send('success', (string)$this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $desc]));
+				$this->eventSource->send('success', $this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $desc]));
 				break;
 			case '\OC\Repair::finishProgress':
 				$this->progressStateMax = $this->progressStateStep;
-				$this->eventSource->send('success', (string)$this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $this->currentStep]));
+				$this->eventSource->send('success', $this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $this->currentStep]));
 				break;
 			case '\OC\Repair::step':
-				$this->eventSource->send('success', (string)$this->l10n->t('Repair step:') . ' ' . $event->getArgument(0));
+				$this->eventSource->send('success', $this->l10n->t('Repair step:') . ' ' . $event->getArgument(0));
 				break;
 			case '\OC\Repair::info':
-				$this->eventSource->send('success', (string)$this->l10n->t('Repair info:') . ' ' . $event->getArgument(0));
+				$this->eventSource->send('success', $this->l10n->t('Repair info:') . ' ' . $event->getArgument(0));
 				break;
 			case '\OC\Repair::warning':
-				$this->eventSource->send('notice', (string)$this->l10n->t('Repair warning:') . ' ' . $event->getArgument(0));
+				$this->eventSource->send('notice', $this->l10n->t('Repair warning:') . ' ' . $event->getArgument(0));
 				break;
 			case '\OC\Repair::error':
-				$this->eventSource->send('notice', (string)$this->l10n->t('Repair error:') . ' ' . $event->getArgument(0));
+				$this->eventSource->send('notice', $this->l10n->t('Repair error:') . ' ' . $event->getArgument(0));
 				break;
 		}
 	}
@@ -108,7 +108,7 @@ class FeedBackHandler {
 if (\OCP\Util::needUpgrade()) {
 	$config = \OC::$server->getSystemConfig();
 	if ($config->getValue('upgrade.disable-web', false)) {
-		$eventSource->send('failure', (string)$l->t('Please use the command line updater because automatic updating is disabled in the config.php.'));
+		$eventSource->send('failure', $l->t('Please use the command line updater because automatic updating is disabled in the config.php.'));
 		$eventSource->close();
 		exit();
 	}
@@ -130,12 +130,12 @@ if (\OCP\Util::needUpgrade()) {
 	$dispatcher = \OC::$server->getEventDispatcher();
 	$dispatcher->addListener('\OC\DB\Migrator::executeSql', function ($event) use ($eventSource, $l) {
 		if ($event instanceof GenericEvent) {
-			$eventSource->send('success', (string)$l->t('[%d / %d]: %s', [$event[0], $event[1], $event->getSubject()]));
+			$eventSource->send('success', $l->t('[%d / %d]: %s', [$event[0], $event[1], $event->getSubject()]));
 		}
 	});
 	$dispatcher->addListener('\OC\DB\Migrator::checkTable', function ($event) use ($eventSource, $l) {
 		if ($event instanceof GenericEvent) {
-			$eventSource->send('success', (string)$l->t('[%d / %d]: Checking table %s', [$event[0], $event[1], $event->getSubject()]));
+			$eventSource->send('success', $l->t('[%d / %d]: Checking table %s', [$event[0], $event[1], $event->getSubject()]));
 		}
 	});
 	$feedBack = new FeedBackHandler($eventSource, $l);
@@ -148,46 +148,46 @@ if (\OCP\Util::needUpgrade()) {
 	$dispatcher->addListener('\OC\Repair::error', [$feedBack, 'handleRepairFeedback']);
 
 	$updater->listen('\OC\Updater', 'maintenanceEnabled', function () use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Turned on maintenance mode'));
+		$eventSource->send('success', $l->t('Turned on maintenance mode'));
 	});
 	$updater->listen('\OC\Updater', 'maintenanceDisabled', function () use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Turned off maintenance mode'));
+		$eventSource->send('success', $l->t('Turned off maintenance mode'));
 	});
 	$updater->listen('\OC\Updater', 'maintenanceActive', function () use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Maintenance mode is kept active'));
+		$eventSource->send('success', $l->t('Maintenance mode is kept active'));
 	});
 	$updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Updating database schema'));
+		$eventSource->send('success', $l->t('Updating database schema'));
 	});
 	$updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Updated database'));
+		$eventSource->send('success', $l->t('Updated database'));
 	});
 	$updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function () use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Checking whether the database schema can be updated (this can take a long time depending on the database size)'));
+		$eventSource->send('success', $l->t('Checking whether the database schema can be updated (this can take a long time depending on the database size)'));
 	});
 	$updater->listen('\OC\Updater', 'dbSimulateUpgrade', function () use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Checked database schema update'));
+		$eventSource->send('success', $l->t('Checked database schema update'));
 	});
 	$updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Checking updates of apps'));
+		$eventSource->send('success', $l->t('Checking updates of apps'));
 	});
 	$updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Checking for update of app "%s" in appstore', [$app]));
+		$eventSource->send('success', $l->t('Checking for update of app "%s" in appstore', [$app]));
 	});
 	$updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Update app "%s" from appstore', [$app]));
+		$eventSource->send('success', $l->t('Update app "%s" from appstore', [$app]));
 	});
 	$updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Checked for update of app "%s" in appstore', [$app]));
+		$eventSource->send('success', $l->t('Checked for update of app "%s" in appstore', [$app]));
 	});
 	$updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app]));
+		$eventSource->send('success', $l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app]));
 	});
 	$updater->listen('\OC\Updater', 'appUpgradeCheck', function () use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Checked database schema update for apps'));
+		$eventSource->send('success', $l->t('Checked database schema update for apps'));
 	});
 	$updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Updated "%1$s" to %2$s', [$app, $version]));
+		$eventSource->send('success', $l->t('Updated "%1$s" to %2$s', [$app, $version]));
 	});
 	$updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use (&$incompatibleApps) {
 		$incompatibleApps[] = $app;
@@ -198,16 +198,16 @@ if (\OCP\Util::needUpgrade()) {
 		$config->setSystemValue('maintenance', false);
 	});
 	$updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Set log level to debug'));
+		$eventSource->send('success', $l->t('Set log level to debug'));
 	});
 	$updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Reset log level'));
+		$eventSource->send('success', $l->t('Reset log level'));
 	});
 	$updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Starting code integrity check'));
+		$eventSource->send('success', $l->t('Starting code integrity check'));
 	});
 	$updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use ($eventSource, $l) {
-		$eventSource->send('success', (string)$l->t('Finished code integrity check'));
+		$eventSource->send('success', $l->t('Finished code integrity check'));
 	});
 
 	try {
@@ -224,15 +224,14 @@ if (\OCP\Util::needUpgrade()) {
 
 	$disabledApps = [];
 	foreach ($incompatibleApps as $app) {
-		$disabledApps[$app] = (string) $l->t('%s (incompatible)', [$app]);
+		$disabledApps[$app] = $l->t('%s (incompatible)', [$app]);
 	}
 
 	if (!empty($disabledApps)) {
-		$eventSource->send('notice',
-			(string)$l->t('The following apps have been disabled: %s', [implode(', ', $disabledApps)]));
+		$eventSource->send('notice', $l->t('The following apps have been disabled: %s', [implode(', ', $disabledApps)]));
 	}
 } else {
-	$eventSource->send('notice', (string)$l->t('Already up to date'));
+	$eventSource->send('notice', $l->t('Already up to date'));
 }
 
 $eventSource->send('done', '');
diff --git a/lib/private/App/AppStore/Bundles/EducationBundle.php b/lib/private/App/AppStore/Bundles/EducationBundle.php
index 05d6fbbd9d76a5f8df6414e39d8cff3cec4fe54d..f59e8a115e2f561628007d1499bafd0eaae46a1c 100644
--- a/lib/private/App/AppStore/Bundles/EducationBundle.php
+++ b/lib/private/App/AppStore/Bundles/EducationBundle.php
@@ -29,7 +29,7 @@ class EducationBundle extends Bundle {
 	 * {@inheritDoc}
 	 */
 	public function getName() {
-		return (string)$this->l10n->t('Education Edition');
+		return $this->l10n->t('Education Edition');
 	}
 
 	/**
diff --git a/lib/private/App/AppStore/Bundles/GroupwareBundle.php b/lib/private/App/AppStore/Bundles/GroupwareBundle.php
index 49ae1068b1012372f6132ec6e3ec485cd4df8f63..604ed44aa08d89fcf89528b44daa1f3dbe64fa4a 100644
--- a/lib/private/App/AppStore/Bundles/GroupwareBundle.php
+++ b/lib/private/App/AppStore/Bundles/GroupwareBundle.php
@@ -30,7 +30,7 @@ class GroupwareBundle extends Bundle {
 	 * {@inheritDoc}
 	 */
 	public function getName() {
-		return (string)$this->l10n->t('Groupware bundle');
+		return $this->l10n->t('Groupware bundle');
 	}
 
 	/**
diff --git a/lib/private/App/AppStore/Bundles/SocialSharingBundle.php b/lib/private/App/AppStore/Bundles/SocialSharingBundle.php
index 8ce4d1080ffe1a0b34b7fde2cd13b12610a340a3..cd063f6fa882e16667864ef3ae6bceb2c325fc8f 100644
--- a/lib/private/App/AppStore/Bundles/SocialSharingBundle.php
+++ b/lib/private/App/AppStore/Bundles/SocialSharingBundle.php
@@ -29,7 +29,7 @@ class SocialSharingBundle extends Bundle {
 	 * {@inheritDoc}
 	 */
 	public function getName() {
-		return (string)$this->l10n->t('Social sharing bundle');
+		return $this->l10n->t('Social sharing bundle');
 	}
 
 	/**
diff --git a/lib/private/App/DependencyAnalyzer.php b/lib/private/App/DependencyAnalyzer.php
index eb114adbb48aa36d08768f14477edc0c10337f4c..8476f9bc1455677e3f6bb4bb35bf95f335235baf 100644
--- a/lib/private/App/DependencyAnalyzer.php
+++ b/lib/private/App/DependencyAnalyzer.php
@@ -158,19 +158,19 @@ class DependencyAnalyzer {
 		if (isset($dependencies['php']['@attributes']['min-version'])) {
 			$minVersion = $dependencies['php']['@attributes']['min-version'];
 			if ($this->compareSmaller($this->platform->getPhpVersion(), $minVersion)) {
-				$missing[] = (string)$this->l->t('PHP %s or higher is required.', [$minVersion]);
+				$missing[] = $this->l->t('PHP %s or higher is required.', [$minVersion]);
 			}
 		}
 		if (isset($dependencies['php']['@attributes']['max-version'])) {
 			$maxVersion = $dependencies['php']['@attributes']['max-version'];
 			if ($this->compareBigger($this->platform->getPhpVersion(), $maxVersion)) {
-				$missing[] = (string)$this->l->t('PHP with a version lower than %s is required.', [$maxVersion]);
+				$missing[] = $this->l->t('PHP with a version lower than %s is required.', [$maxVersion]);
 			}
 		}
 		if (isset($dependencies['php']['@attributes']['min-int-size'])) {
 			$intSize = $dependencies['php']['@attributes']['min-int-size'];
 			if ($intSize > $this->platform->getIntSize() * 8) {
-				$missing[] = (string)$this->l->t('%sbit or higher PHP required.', [$intSize]);
+				$missing[] = $this->l->t('%sbit or higher PHP required.', [$intSize]);
 			}
 		}
 		return $missing;
@@ -194,7 +194,7 @@ class DependencyAnalyzer {
 		}, $supportedArchitectures);
 		$currentArchitecture = $this->platform->getArchitecture();
 		if (!in_array($currentArchitecture, $supportedArchitectures, true)) {
-			$missing[] = (string)$this->l->t('The following architectures are supported: %s', [implode(', ', $supportedArchitectures)]);
+			$missing[] = $this->l->t('The following architectures are supported: %s', [implode(', ', $supportedArchitectures)]);
 		}
 		return $missing;
 	}
@@ -221,7 +221,7 @@ class DependencyAnalyzer {
 		}, $supportedDatabases);
 		$currentDatabase = $this->platform->getDatabase();
 		if (!in_array($currentDatabase, $supportedDatabases)) {
-			$missing[] = (string)$this->l->t('The following databases are supported: %s', [implode(', ', $supportedDatabases)]);
+			$missing[] = $this->l->t('The following databases are supported: %s', [implode(', ', $supportedDatabases)]);
 		}
 		return $missing;
 	}
@@ -250,7 +250,7 @@ class DependencyAnalyzer {
 			}
 			$commandName = $this->getValue($command);
 			if (!$this->platform->isCommandKnown($commandName)) {
-				$missing[] = (string)$this->l->t('The command line tool %s could not be found', [$commandName]);
+				$missing[] = $this->l->t('The command line tool %s could not be found', [$commandName]);
 			}
 		}
 		return $missing;
@@ -324,7 +324,7 @@ class DependencyAnalyzer {
 		}
 		$currentOS = $this->platform->getOS();
 		if (!in_array($currentOS, $oss)) {
-			$missing[] = (string)$this->l->t('The following platforms are supported: %s', [implode(', ', $oss)]);
+			$missing[] = $this->l->t('The following platforms are supported: %s', [implode(', ', $oss)]);
 		}
 		return $missing;
 	}
@@ -350,12 +350,12 @@ class DependencyAnalyzer {
 
 		if (!is_null($minVersion)) {
 			if ($this->compareSmaller($this->platform->getOcVersion(), $minVersion)) {
-				$missing[] = (string)$this->l->t('Server version %s or higher is required.', [$this->toVisibleVersion($minVersion)]);
+				$missing[] = $this->l->t('Server version %s or higher is required.', [$this->toVisibleVersion($minVersion)]);
 			}
 		}
 		if (!$ignoreMax && !is_null($maxVersion)) {
 			if ($this->compareBigger($this->platform->getOcVersion(), $maxVersion)) {
-				$missing[] = (string)$this->l->t('Server version %s or lower is required.', [$this->toVisibleVersion($maxVersion)]);
+				$missing[] = $this->l->t('Server version %s or lower is required.', [$this->toVisibleVersion($maxVersion)]);
 			}
 		}
 		return $missing;
diff --git a/lib/private/AppFramework/Http/Dispatcher.php b/lib/private/AppFramework/Http/Dispatcher.php
index 828864f1e028df7dc29493980c6244db5bcad9ad..9ec69558e889d6a7c7da17651b1d7a5ea41b196c 100644
--- a/lib/private/AppFramework/Http/Dispatcher.php
+++ b/lib/private/AppFramework/Http/Dispatcher.php
@@ -133,7 +133,7 @@ class Dispatcher {
 
 				if ($numBuilt > 50) {
 					$this->logger->debug('Controller {class}::{method} created {count} QueryBuilder objects, please check if they are created inside a loop by accident.' , [
-						'class' => (string) get_class($controller),
+						'class' => get_class($controller),
 						'method' => $methodName,
 						'count' => $numBuilt,
 					]);
@@ -141,7 +141,7 @@ class Dispatcher {
 
 				if ($numExecuted > 100) {
 					$this->logger->warning('Controller {class}::{method} executed {count} queries.' , [
-						'class' => (string) get_class($controller),
+						'class' => get_class($controller),
 						'method' => $methodName,
 						'count' => $numExecuted,
 					]);
diff --git a/lib/private/AppFramework/Routing/RouteConfig.php b/lib/private/AppFramework/Routing/RouteConfig.php
index b382e7eb4b033b9122ea1c0c37cadc669edd0bd9..c522d3436cab841a517780559f8bf37e051f1c56 100644
--- a/lib/private/AppFramework/Routing/RouteConfig.php
+++ b/lib/private/AppFramework/Routing/RouteConfig.php
@@ -231,7 +231,7 @@ class RouteConfig {
 				$controllerName = $this->buildControllerName($controller);
 				$actionName = $this->buildActionName($method);
 
-				$routeName = $routeNamePrefix . $this->appName . '.' . strtolower($resource) . '.' . strtolower($method);
+				$routeName = $routeNamePrefix . $this->appName . '.' . strtolower($resource) . '.' . $method;
 
 				$route = $this->router->create($routeName, $url)
 					->method($verb);
diff --git a/lib/private/Collaboration/Collaborators/Search.php b/lib/private/Collaboration/Collaborators/Search.php
index 7b5789640a0909349d687a39d196e8996316e866..79dfd5e1d826932d7b5e55bc3bcff4c1f7a4fa39 100644
--- a/lib/private/Collaboration/Collaborators/Search.php
+++ b/lib/private/Collaboration/Collaborators/Search.php
@@ -100,7 +100,7 @@ class Search implements ISearch {
 			$searchResult->unsetResult($emailType);
 		}
 
-		return [$searchResult->asArray(), (bool)$hasMoreResults];
+		return [$searchResult->asArray(), $hasMoreResults];
 	}
 
 	public function registerPlugin(array $pluginInfo) {
diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php
index 35e69ae270ff9edf3aa1eeac59d95f4ec54a3c59..d4cc6ffe4b2a35a03778a8eb19c73d4b6d310049 100644
--- a/lib/private/Files/FileInfo.php
+++ b/lib/private/Files/FileInfo.php
@@ -243,7 +243,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
 		if (\OCP\Util::isSharingDisabledForUser() || ($this->isShared() && !\OC\Share\Share::isResharingAllowed())) {
 			$perms = $perms & ~\OCP\Constants::PERMISSION_SHARE;
 		}
-		return (int) $perms;
+		return $perms;
 	}
 
 	/**
diff --git a/lib/private/Files/Storage/Wrapper/Encoding.php b/lib/private/Files/Storage/Wrapper/Encoding.php
index d49420471dd3a392b24be7b6c435b6d30f367663..c0587cd0263edabdba609606a9138d25480cddc6 100644
--- a/lib/private/Files/Storage/Wrapper/Encoding.php
+++ b/lib/private/Files/Storage/Wrapper/Encoding.php
@@ -61,7 +61,7 @@ class Encoding extends Wrapper {
 	 * @return bool true if the string is all ASCII, false otherwise
 	 */
 	private function isAscii($str) {
-		return (bool) !preg_match('/[\\x80-\\xff]+/', $str);
+		return !preg_match('/[\\x80-\\xff]+/', $str);
 	}
 
 	/**
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php
index 9c9a3cc951e22419ebd4e26fb27aca1ab18f970a..471914755805e8af6b0a07d8fbce6abd3f52a779 100644
--- a/lib/private/L10N/Factory.php
+++ b/lib/private/L10N/Factory.php
@@ -123,7 +123,7 @@ class Factory implements IFactory {
 		return new LazyL10N(function () use ($app, $lang, $locale) {
 			$app = \OC_App::cleanAppId($app);
 			if ($lang !== null) {
-				$lang = str_replace(['\0', '/', '\\', '..'], '', (string)$lang);
+				$lang = str_replace(['\0', '/', '\\', '..'], '', $lang);
 			}
 
 			$forceLang = $this->config->getSystemValue('force_language', false);
@@ -617,7 +617,7 @@ class Factory implements IFactory {
 		$forceLanguage = $this->config->getSystemValue('force_language', false);
 		if ($forceLanguage !== false) {
 			$l = $this->get('lib', $forceLanguage);
-			$potentialName = (string) $l->t('__language_name__');
+			$potentialName = $l->t('__language_name__');
 
 			return [
 				'commonlanguages' => [[
@@ -636,7 +636,7 @@ class Factory implements IFactory {
 		foreach ($languageCodes as $lang) {
 			$l = $this->get('lib', $lang);
 			// TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version
-			$potentialName = (string) $l->t('__language_name__');
+			$potentialName = $l->t('__language_name__');
 			if ($l->getLanguageCode() === $lang && $potentialName[0] !== '_') {//first check if the language name is in the translation file
 				$ln = [
 					'code' => $lang,
diff --git a/lib/private/Notification/Notification.php b/lib/private/Notification/Notification.php
index 8ac4e19b7d1ad923521ac19ba781a75101e2d779..c0848817361b4b626459a802b6d1d070003a7783 100644
--- a/lib/private/Notification/Notification.php
+++ b/lib/private/Notification/Notification.php
@@ -206,7 +206,7 @@ class Notification implements INotification {
 		if ($id === '' || isset($id[64])) {
 			throw new \InvalidArgumentException('The given object id is invalid');
 		}
-		$this->objectId = (string) $id;
+		$this->objectId = $id;
 		return $this;
 	}
 
diff --git a/lib/private/Preview/TXT.php b/lib/private/Preview/TXT.php
index 968a15a5683e4714708a7f1f80b65a2b7a1fc7ba..9c5b7aa144033fb412756aa47e808cd96a655aae 100644
--- a/lib/private/Preview/TXT.php
+++ b/lib/private/Preview/TXT.php
@@ -85,7 +85,7 @@ class TXT extends ProviderV2 {
 		foreach ($lines as $index => $line) {
 			$index = $index + 1;
 
-			$x = (int) 1;
+			$x = 1;
 			$y = (int) ($index * $lineSize);
 
 			if ($canUseTTF === true) {
diff --git a/lib/private/Security/Normalizer/IpAddress.php b/lib/private/Security/Normalizer/IpAddress.php
index a679936e20cbe242e592ad70f7e3f5630dc969cf..cbfc212e1ce63ab310fdc6eed10f5eb1d8e3b51c 100644
--- a/lib/private/Security/Normalizer/IpAddress.php
+++ b/lib/private/Security/Normalizer/IpAddress.php
@@ -58,7 +58,7 @@ class IpAddress {
 		$binary = \inet_pton($ip);
 		for ($i = 32; $i > $maskBits; $i -= 8) {
 			$j = \intdiv($i, 8) - 1;
-			$k = (int) \min(8, $i - $maskBits);
+			$k = \min(8, $i - $maskBits);
 			$mask = (0xff - ((2 ** $k) - 1));
 			$int = \unpack('C', $binary[$j]);
 			$binary[$j] = \pack('C', $int[1] & $mask);
@@ -84,7 +84,7 @@ class IpAddress {
 		$binary = \inet_pton($ip);
 		for ($i = 128; $i > $maskBits; $i -= 8) {
 			$j = \intdiv($i, 8) - 1;
-			$k = (int) \min(8, $i - $maskBits);
+			$k = \min(8, $i - $maskBits);
 			$mask = (0xff - ((2 ** $k) - 1));
 			$int = \unpack('C', $binary[$j]);
 			$binary[$j] = \pack('C', $int[1] & $mask);
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php
index 69624825ae46711567e84d3a4ee9d5d527b8deed..b228cae6ffb335a56ad3584cbc798069362b87e0 100644
--- a/lib/private/Template/JSConfigHelper.php
+++ b/lib/private/Template/JSConfigHelper.php
@@ -207,59 +207,59 @@ class JSConfigHelper {
 			'nc_lastLogin' => $lastConfirmTimestamp,
 			'nc_pageLoad' => time(),
 			"dayNames" => json_encode([
-				(string)$this->l->t('Sunday'),
-				(string)$this->l->t('Monday'),
-				(string)$this->l->t('Tuesday'),
-				(string)$this->l->t('Wednesday'),
-				(string)$this->l->t('Thursday'),
-				(string)$this->l->t('Friday'),
-				(string)$this->l->t('Saturday')
+				$this->l->t('Sunday'),
+				$this->l->t('Monday'),
+				$this->l->t('Tuesday'),
+				$this->l->t('Wednesday'),
+				$this->l->t('Thursday'),
+				$this->l->t('Friday'),
+				$this->l->t('Saturday')
 			]),
 			"dayNamesShort" => json_encode([
-				(string)$this->l->t('Sun.'),
-				(string)$this->l->t('Mon.'),
-				(string)$this->l->t('Tue.'),
-				(string)$this->l->t('Wed.'),
-				(string)$this->l->t('Thu.'),
-				(string)$this->l->t('Fri.'),
-				(string)$this->l->t('Sat.')
+				$this->l->t('Sun.'),
+				$this->l->t('Mon.'),
+				$this->l->t('Tue.'),
+				$this->l->t('Wed.'),
+				$this->l->t('Thu.'),
+				$this->l->t('Fri.'),
+				$this->l->t('Sat.')
 			]),
 			"dayNamesMin" => json_encode([
-				(string)$this->l->t('Su'),
-				(string)$this->l->t('Mo'),
-				(string)$this->l->t('Tu'),
-				(string)$this->l->t('We'),
-				(string)$this->l->t('Th'),
-				(string)$this->l->t('Fr'),
-				(string)$this->l->t('Sa')
+				$this->l->t('Su'),
+				$this->l->t('Mo'),
+				$this->l->t('Tu'),
+				$this->l->t('We'),
+				$this->l->t('Th'),
+				$this->l->t('Fr'),
+				$this->l->t('Sa')
 			]),
 			"monthNames" => json_encode([
-				(string)$this->l->t('January'),
-				(string)$this->l->t('February'),
-				(string)$this->l->t('March'),
-				(string)$this->l->t('April'),
-				(string)$this->l->t('May'),
-				(string)$this->l->t('June'),
-				(string)$this->l->t('July'),
-				(string)$this->l->t('August'),
-				(string)$this->l->t('September'),
-				(string)$this->l->t('October'),
-				(string)$this->l->t('November'),
-				(string)$this->l->t('December')
+				$this->l->t('January'),
+				$this->l->t('February'),
+				$this->l->t('March'),
+				$this->l->t('April'),
+				$this->l->t('May'),
+				$this->l->t('June'),
+				$this->l->t('July'),
+				$this->l->t('August'),
+				$this->l->t('September'),
+				$this->l->t('October'),
+				$this->l->t('November'),
+				$this->l->t('December')
 			]),
 			"monthNamesShort" => json_encode([
-				(string)$this->l->t('Jan.'),
-				(string)$this->l->t('Feb.'),
-				(string)$this->l->t('Mar.'),
-				(string)$this->l->t('Apr.'),
-				(string)$this->l->t('May.'),
-				(string)$this->l->t('Jun.'),
-				(string)$this->l->t('Jul.'),
-				(string)$this->l->t('Aug.'),
-				(string)$this->l->t('Sep.'),
-				(string)$this->l->t('Oct.'),
-				(string)$this->l->t('Nov.'),
-				(string)$this->l->t('Dec.')
+				$this->l->t('Jan.'),
+				$this->l->t('Feb.'),
+				$this->l->t('Mar.'),
+				$this->l->t('Apr.'),
+				$this->l->t('May.'),
+				$this->l->t('Jun.'),
+				$this->l->t('Jul.'),
+				$this->l->t('Aug.'),
+				$this->l->t('Sep.'),
+				$this->l->t('Oct.'),
+				$this->l->t('Nov.'),
+				$this->l->t('Dec.')
 			]),
 			"firstDay" => json_encode($this->l->l('firstday', null)),
 			"_oc_config" => json_encode($config),