summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/comments/appinfo/app.php2
-rw-r--r--apps/comments/lib/Activity/Listener.php2
-rw-r--r--apps/dav/l10n/zh_CN.js10
-rw-r--r--apps/dav/l10n/zh_CN.json10
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php2
-rw-r--r--apps/dav/lib/CalDAV/Plugin.php2
-rw-r--r--apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php2
-rw-r--r--apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php2
-rw-r--r--apps/dav/lib/CardDAV/Converter.php3
-rw-r--r--apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php6
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php3
-rw-r--r--apps/dav/lib/Connector/Sabre/Node.php2
-rw-r--r--apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php2
-rw-r--r--apps/encryption/l10n/nl.js2
-rw-r--r--apps/encryption/l10n/nl.json2
-rw-r--r--apps/encryption/lib/Crypto/Crypt.php2
-rw-r--r--apps/encryption/lib/Util.php3
-rw-r--r--apps/federatedfilesharing/lib/AddressHandler.php3
-rw-r--r--apps/federatedfilesharing/lib/FederatedShareProvider.php3
-rw-r--r--apps/files/l10n/zh_CN.js7
-rw-r--r--apps/files/l10n/zh_CN.json7
-rw-r--r--apps/files_external/3rdparty/icewind/smb/src/Parser.php2
-rw-r--r--apps/files_external/3rdparty/icewind/smb/src/Share.php3
-rw-r--r--apps/files_external/lib/Controller/AjaxController.php4
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php1
-rw-r--r--apps/files_external/lib/Service/UserStoragesService.php3
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php2
-rw-r--r--apps/files_sharing/lib/Controller/ShareesAPIController.php4
-rw-r--r--apps/files_sharing/lib/Migration/OwncloudGuestShareType.php2
-rw-r--r--apps/files_sharing/lib/ShareBackend/Folder.php4
-rw-r--r--apps/files_trashbin/lib/Expiration.php8
-rw-r--r--apps/files_trashbin/lib/Storage.php3
-rw-r--r--apps/files_versions/lib/Expiration.php8
-rw-r--r--apps/files_versions/lib/Storage.php6
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php3
-rw-r--r--apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php3
-rw-r--r--apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php2
-rw-r--r--apps/user_ldap/ajax/getNewServerConfigPrefix.php2
-rw-r--r--apps/user_ldap/lib/Access.php3
-rw-r--r--apps/user_ldap/lib/Command/Search.php4
-rw-r--r--apps/user_ldap/lib/Connection.php6
-rw-r--r--apps/user_ldap/lib/Controller/ConfigAPIController.php2
-rw-r--r--apps/user_ldap/lib/Group_LDAP.php6
-rw-r--r--apps/user_ldap/lib/Helper.php5
-rw-r--r--apps/user_ldap/lib/Jobs/CleanUp.php10
-rw-r--r--apps/user_ldap/lib/Migration/UUIDFixInsert.php2
-rw-r--r--apps/user_ldap/lib/User/Manager.php2
-rw-r--r--apps/user_ldap/lib/User/OfflineUser.php6
-rw-r--r--apps/user_ldap/lib/User_LDAP.php7
-rw-r--r--apps/user_ldap/lib/Wizard.php6
-rw-r--r--apps/workflowengine/lib/Controller/RequestTime.php2
-rw-r--r--core/Command/Config/Import.php3
-rw-r--r--core/Command/Integrity/CheckApp.php2
-rw-r--r--core/Command/TwoFactorAuth/Base.php2
-rw-r--r--core/l10n/pl.js2
-rw-r--r--core/l10n/pl.json2
-rw-r--r--core/l10n/tr.js1
-rw-r--r--core/l10n/tr.json1
-rw-r--r--cron.php12
-rw-r--r--lib/l10n/zh_CN.js9
-rw-r--r--lib/l10n/zh_CN.json9
-rw-r--r--lib/private/Activity/Manager.php4
-rw-r--r--lib/private/App/CodeChecker/DeprecationCheck.php5
-rw-r--r--lib/private/App/CodeChecker/PrivateCheck.php2
-rw-r--r--lib/private/App/Platform.php3
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php2
-rw-r--r--lib/private/AppFramework/Middleware/MiddlewareDispatcher.php2
-rw-r--r--lib/private/Collaboration/Collaborators/GroupPlugin.php4
-rw-r--r--lib/private/Collaboration/Collaborators/UserPlugin.php4
-rw-r--r--lib/private/Comments/Manager.php20
-rw-r--r--lib/private/DB/Adapter.php2
-rw-r--r--lib/private/DB/AdapterSqlite.php2
-rw-r--r--lib/private/Encryption/Util.php2
-rw-r--r--lib/private/Files/Cache/Cache.php3
-rw-r--r--lib/private/Files/Cache/FailedCache.php7
-rw-r--r--lib/private/Files/Node/Node.php2
-rw-r--r--lib/private/Files/Storage/Wrapper/Encryption.php4
-rw-r--r--lib/private/Files/View.php9
-rw-r--r--lib/private/L10N/Factory.php3
-rw-r--r--lib/private/LargeFileHelper.php2
-rw-r--r--lib/private/Memcache/Redis.php4
-rw-r--r--lib/private/Route/CachingRouter.php2
-rw-r--r--lib/private/Security/CertificateManager.php4
-rw-r--r--lib/private/Server.php4
-rw-r--r--lib/private/Settings/Admin/Sharing.php2
-rw-r--r--lib/private/Share/Helper.php2
-rw-r--r--lib/private/Share/Share.php8
-rw-r--r--lib/private/SubAdmin.php4
-rw-r--r--lib/private/Template/JSConfigHelper.php6
-rw-r--r--lib/private/User/Session.php22
-rw-r--r--lib/private/legacy/db.php3
-rw-r--r--lib/private/legacy/db/statementwrapper.php3
-rw-r--r--lib/private/legacy/files.php4
-rw-r--r--lib/private/legacy/helper.php4
-rw-r--r--lib/private/legacy/template.php2
-rw-r--r--lib/private/legacy/template/functions.php2
-rw-r--r--lib/private/legacy/util.php4
-rw-r--r--lib/public/BackgroundJob.php45
-rw-r--r--lib/public/BackgroundJob/IJobList.php13
-rw-r--r--lib/public/Collaboration/Collaborators/SearchResultType.php2
-rw-r--r--settings/Controller/AppSettingsController.php2
-rw-r--r--settings/Controller/UsersController.php4
102 files changed, 231 insertions, 238 deletions
diff --git a/apps/comments/appinfo/app.php b/apps/comments/appinfo/app.php
index 15c545ae1e4..109063cd22e 100644
--- a/apps/comments/appinfo/app.php
+++ b/apps/comments/appinfo/app.php
@@ -36,7 +36,7 @@ $eventDispatcher->addListener(
$eventDispatcher->addListener(\OCP\Comments\CommentsEntityEvent::EVENT_ENTITY, function(\OCP\Comments\CommentsEntityEvent $event) {
$event->addEntityCollection('files', function($name) {
- $nodes = \OC::$server->getUserFolder()->getById(intval($name));
+ $nodes = \OC::$server->getUserFolder()->getById((int)$name);
return !empty($nodes);
});
});
diff --git a/apps/comments/lib/Activity/Listener.php b/apps/comments/lib/Activity/Listener.php
index 76af565cf15..1dec28c8250 100644
--- a/apps/comments/lib/Activity/Listener.php
+++ b/apps/comments/lib/Activity/Listener.php
@@ -77,7 +77,7 @@ class Listener {
*/
public function commentEvent(CommentsEvent $event) {
if ($event->getComment()->getObjectType() !== 'files'
- || !in_array($event->getEvent(), [CommentsEvent::EVENT_ADD])
+ || $event->getEvent() !== CommentsEvent::EVENT_ADD
|| !$this->appManager->isInstalled('activity')) {
// Comment not for file, not adding a comment or no activity-app enabled (save the energy)
return;
diff --git a/apps/dav/l10n/zh_CN.js b/apps/dav/l10n/zh_CN.js
index e0ee9015402..2e03a120e60 100644
--- a/apps/dav/l10n/zh_CN.js
+++ b/apps/dav/l10n/zh_CN.js
@@ -41,9 +41,17 @@ OC.L10N.register(
"A calendar <strong>event</strong> was modified" : "日历中<strong>事件</strong>已经修改",
"A calendar <strong>todo</strong> was modified" : "列表中<strong>待办事项</strong>已经修改",
"Contact birthdays" : "联系人生日",
+ "Hello %s," : "%s你好,",
+ "When:" : "时间:",
+ "Where:" : "地点:",
+ "Description:" : "描述:",
+ "Link:" : "链接:",
"Contacts" : "联系人",
"Technical details" : "技术细节",
"Remote Address: %s" : "远程地址: %s",
- "Request ID: %s" : "请求 ID: %s"
+ "Request ID: %s" : "请求 ID: %s",
+ "CalDAV server" : "日历服务",
+ "Automatically generate a birthday calendar" : "自动生成生日日历",
+ "Birthday calendars will be generated by a background job." : "生日日历将由后台作业生成。"
},
"nplurals=1; plural=0;");
diff --git a/apps/dav/l10n/zh_CN.json b/apps/dav/l10n/zh_CN.json
index 30419409556..60ea656ff51 100644
--- a/apps/dav/l10n/zh_CN.json
+++ b/apps/dav/l10n/zh_CN.json
@@ -39,9 +39,17 @@
"A calendar <strong>event</strong> was modified" : "日历中<strong>事件</strong>已经修改",
"A calendar <strong>todo</strong> was modified" : "列表中<strong>待办事项</strong>已经修改",
"Contact birthdays" : "联系人生日",
+ "Hello %s," : "%s你好,",
+ "When:" : "时间:",
+ "Where:" : "地点:",
+ "Description:" : "描述:",
+ "Link:" : "链接:",
"Contacts" : "联系人",
"Technical details" : "技术细节",
"Remote Address: %s" : "远程地址: %s",
- "Request ID: %s" : "请求 ID: %s"
+ "Request ID: %s" : "请求 ID: %s",
+ "CalDAV server" : "日历服务",
+ "Automatically generate a birthday calendar" : "自动生成生日日历",
+ "Birthday calendars will be generated by a background job." : "生日日历将由后台作业生成。"
},"pluralForm" :"nplurals=1; plural=0;"
} \ No newline at end of file
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index 169bf6ff6a5..a936cb6aeba 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -2261,7 +2261,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$query->execute();
}
- if (in_array($property->name, array_keys(self::$indexParameters))) {
+ if (array_key_exists($property->name, self::$indexParameters)) {
$parameters = $property->parameters();
$indexedParametersForProperty = self::$indexParameters[$property->name];
diff --git a/apps/dav/lib/CalDAV/Plugin.php b/apps/dav/lib/CalDAV/Plugin.php
index 167ea4ffd69..0d793f929b3 100644
--- a/apps/dav/lib/CalDAV/Plugin.php
+++ b/apps/dav/lib/CalDAV/Plugin.php
@@ -36,8 +36,6 @@ class Plugin extends \Sabre\CalDAV\Plugin {
list(, $principalId) = \Sabre\Uri\split($principalUrl);
return self::CALENDAR_ROOT .'/' . $principalId;
}
-
- return;
}
}
diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php
index 5fc38315438..bac661b6722 100644
--- a/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php
+++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php
@@ -40,6 +40,6 @@ class LimitFilter implements XmlDeserializable {
throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}limit has illegal value');
}
- return intval($value);
+ return (int)$value;
}
} \ No newline at end of file
diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php
index 7aac59809a2..8ced850bbc0 100644
--- a/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php
+++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php
@@ -40,6 +40,6 @@ class OffsetFilter implements XmlDeserializable {
throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value');
}
- return intval($value);
+ return (int)$value;
}
} \ No newline at end of file
diff --git a/apps/dav/lib/CardDAV/Converter.php b/apps/dav/lib/CardDAV/Converter.php
index a480f0ea45d..e047ee2a772 100644
--- a/apps/dav/lib/CardDAV/Converter.php
+++ b/apps/dav/lib/CardDAV/Converter.php
@@ -143,8 +143,7 @@ class Converter {
*/
private function getAvatarImage(IUser $user) {
try {
- $image = $user->getAvatarImage(-1);
- return $image;
+ return $user->getAvatarImage(-1);
} catch (\Exception $ex) {
return null;
}
diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
index ac625c3a9a4..58469d27205 100644
--- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
@@ -97,7 +97,7 @@ class CommentPropertiesPlugin extends ServerPlugin {
}
$propFind->handle(self::PROPERTY_NAME_COUNT, function() use ($node) {
- return $this->commentsManager->getNumberOfCommentsForObject('files', strval($node->getId()));
+ return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId());
});
$propFind->handle(self::PROPERTY_NAME_HREF, function() use ($node) {
@@ -153,9 +153,9 @@ class CommentPropertiesPlugin extends ServerPlugin {
return null;
}
- $lastRead = $this->commentsManager->getReadMark('files', strval($node->getId()), $user);
+ $lastRead = $this->commentsManager->getReadMark('files', (string)$node->getId(), $user);
- return $this->commentsManager->getNumberOfCommentsForObject('files', strval($node->getId()), $lastRead);
+ return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId(), $lastRead);
}
}
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index a3a0893259b..b5333f48374 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -340,8 +340,7 @@ class FilesPlugin extends ServerPlugin {
});
$propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function() use ($node) {
- $result = $node->getFileInfo()->isEncrypted() ? '1' : '0';
- return $result;
+ return $node->getFileInfo()->isEncrypted() ? '1' : '0';
});
$propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) {
diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php
index b8a8209129c..fd237b604a9 100644
--- a/apps/dav/lib/Connector/Sabre/Node.php
+++ b/apps/dav/lib/Connector/Sabre/Node.php
@@ -369,7 +369,7 @@ abstract class Node implements \Sabre\DAV\INode {
throw new \InvalidArgumentException('X-OC-MTime header must be an integer (unix timestamp).');
}
- return intval($mtimeFromRequest);
+ return (int)$mtimeFromRequest;
}
}
diff --git a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php
index c76ab832b14..eb4b3a7c9e6 100644
--- a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php
+++ b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php
@@ -60,7 +60,7 @@ class SystemTagsRelationsCollection extends SimpleCollection {
$userSession,
$groupManager,
function($name) {
- $nodes = \OC::$server->getUserFolder()->getById(intval($name));
+ $nodes = \OC::$server->getUserFolder()->getById((int)$name);
return !empty($nodes);
}
),
diff --git a/apps/encryption/l10n/nl.js b/apps/encryption/l10n/nl.js
index 1dc6bfad795..2661126492a 100644
--- a/apps/encryption/l10n/nl.js
+++ b/apps/encryption/l10n/nl.js
@@ -38,7 +38,7 @@ OC.L10N.register(
"Default encryption module" : "Standaard cryptomodule",
"Encryption app is enabled but your keys are not initialized, please log-out and log-in again" : "Crypto app is ingeschakeld, maar je sleutels werden niet geïnitialiseerd. Log uit en log daarna opnieuw in.",
"Encrypt the home storage" : "Versleutel de eigen serveropslag",
- "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Het inschakelen van deze optie zorgt voor versleutelen van alle bestanden op do hoofdopslag, anders worden alleen bestanden op externe opslag versleuteld",
+ "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Het inschakelen van deze optie zorgt voor versleutelen van alle bestanden op de hoofdopslag, anders worden alleen bestanden op externe opslag versleuteld",
"Enable recovery key" : "Activeer herstelsleutel",
"Disable recovery key" : "Deactiveer herstelsleutel",
"The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "De herstelsleutel is een extra cryptografische sleutel die wordt gebruikt om bestanden te versleutelen. Die maakt het mogelijk bestanden te herstellen als de gebruiker zijn of haar wachtwoord vergeet.",
diff --git a/apps/encryption/l10n/nl.json b/apps/encryption/l10n/nl.json
index abdb5767611..60f7644a485 100644
--- a/apps/encryption/l10n/nl.json
+++ b/apps/encryption/l10n/nl.json
@@ -36,7 +36,7 @@
"Default encryption module" : "Standaard cryptomodule",
"Encryption app is enabled but your keys are not initialized, please log-out and log-in again" : "Crypto app is ingeschakeld, maar je sleutels werden niet geïnitialiseerd. Log uit en log daarna opnieuw in.",
"Encrypt the home storage" : "Versleutel de eigen serveropslag",
- "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Het inschakelen van deze optie zorgt voor versleutelen van alle bestanden op do hoofdopslag, anders worden alleen bestanden op externe opslag versleuteld",
+ "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Het inschakelen van deze optie zorgt voor versleutelen van alle bestanden op de hoofdopslag, anders worden alleen bestanden op externe opslag versleuteld",
"Enable recovery key" : "Activeer herstelsleutel",
"Disable recovery key" : "Deactiveer herstelsleutel",
"The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "De herstelsleutel is een extra cryptografische sleutel die wordt gebruikt om bestanden te versleutelen. Die maakt het mogelijk bestanden te herstellen als de gebruiker zijn of haar wachtwoord vergeet.",
diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php
index 090ca6184d6..4d5c20ea75f 100644
--- a/apps/encryption/lib/Crypto/Crypt.php
+++ b/apps/encryption/lib/Crypto/Crypt.php
@@ -560,7 +560,7 @@ class Crypt {
$signaturePosition = strpos($meta, '00sig00');
// enforce signature for the new 'CTR' ciphers
- if ($signaturePosition === false && strpos(strtolower($cipher), 'ctr') !== false) {
+ if ($signaturePosition === false && stripos($cipher, 'ctr') !== false) {
throw new GenericEncryptionException('Missing Signature', $this->l->t('Missing Signature'));
}
diff --git a/apps/encryption/lib/Util.php b/apps/encryption/lib/Util.php
index 5926817dc48..eb2357bd10f 100644
--- a/apps/encryption/lib/Util.php
+++ b/apps/encryption/lib/Util.php
@@ -196,8 +196,7 @@ class Util {
* @return \OC\Files\Storage\Storage
*/
public function getStorage($path) {
- $storage = $this->files->getMount($path)->getStorage();
- return $storage;
+ return $this->files->getMount($path)->getStorage();
}
}
diff --git a/apps/federatedfilesharing/lib/AddressHandler.php b/apps/federatedfilesharing/lib/AddressHandler.php
index 78234f17ed7..be3a624e28f 100644
--- a/apps/federatedfilesharing/lib/AddressHandler.php
+++ b/apps/federatedfilesharing/lib/AddressHandler.php
@@ -84,8 +84,7 @@ class AddressHandler {
* @return string url of the current server
*/
public function generateRemoteURL() {
- $url = $this->urlGenerator->getAbsoluteURL('/');
- return $url;
+ return $this->urlGenerator->getAbsoluteURL('/');
}
/**
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index 1025c3c4ae7..6857dd48e98 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -592,7 +592,6 @@ class FederatedShareProvider implements IShareProvider {
// shares is a umount of a external storage. This is handled here
// apps/files_sharing/lib/external/manager.php
// TODO move this code over to this app
- return;
}
@@ -934,7 +933,6 @@ class FederatedShareProvider implements IShareProvider {
*/
public function groupDeleted($gid) {
// We don't handle groups here
- return;
}
/**
@@ -945,7 +943,6 @@ class FederatedShareProvider implements IShareProvider {
*/
public function userDeletedFromGroup($uid, $gid) {
// We don't handle groups here
- return;
}
/**
diff --git a/apps/files/l10n/zh_CN.js b/apps/files/l10n/zh_CN.js
index 1aceaa6eaf4..02f55447e76 100644
--- a/apps/files/l10n/zh_CN.js
+++ b/apps/files/l10n/zh_CN.js
@@ -19,6 +19,7 @@ OC.L10N.register(
"Uploading …" : "上传中…",
"…" : "undefined",
"{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} / {totalSize} ({bitrate})",
+ "Target folder does not exist any more" : "目标文件夹不存在",
"Actions" : "操作",
"Download" : "下载",
"Rename" : "重命名",
@@ -60,8 +61,11 @@ OC.L10N.register(
"You don’t have permission to upload or create files here" : "您没有权限在此上传或创建文件",
"_Uploading %n file_::_Uploading %n files_" : ["上传 %n 个文件"],
"New" : "新建",
+ "{used} of {quota} used" : "已使用{used} /{quota}",
+ "{used} used" : "{used} 已使用",
"\"{name}\" is an invalid file name." : "\"{name}\" 是一个无效的文件名",
"File name cannot be empty." : "文件名不能为空.",
+ "\"/\" is not allowed inside a file name." : "文件名不能包含“/”",
"\"{name}\" is not an allowed filetype" : "\"{name}\" 不是允许的文件类型",
"Storage of {owner} is full, files can not be updated or synced anymore!" : "{owner} 的存储空间已满, 文件将无法更新或同步!",
"Your storage is full, files can not be updated or synced anymore!" : "您的存储空间已满, 文件将无法更新或同步!",
@@ -77,6 +81,9 @@ OC.L10N.register(
"Favorite" : "收藏",
"New folder" : "新建文件夹",
"Upload file" : "上传文件",
+ "Not favorited" : "不受欢迎的",
+ "Remove from favorites" : "取消收藏",
+ "Add to favorites" : "收藏",
"An error occurred while trying to update the tags" : "更新标签时出错",
"Added to favorites" : "已添加到收藏",
"Removed from favorites" : "取消收藏",
diff --git a/apps/files/l10n/zh_CN.json b/apps/files/l10n/zh_CN.json
index d326104673b..773909549f2 100644
--- a/apps/files/l10n/zh_CN.json
+++ b/apps/files/l10n/zh_CN.json
@@ -17,6 +17,7 @@
"Uploading …" : "上传中…",
"…" : "undefined",
"{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} / {totalSize} ({bitrate})",
+ "Target folder does not exist any more" : "目标文件夹不存在",
"Actions" : "操作",
"Download" : "下载",
"Rename" : "重命名",
@@ -58,8 +59,11 @@
"You don’t have permission to upload or create files here" : "您没有权限在此上传或创建文件",
"_Uploading %n file_::_Uploading %n files_" : ["上传 %n 个文件"],
"New" : "新建",
+ "{used} of {quota} used" : "已使用{used} /{quota}",
+ "{used} used" : "{used} 已使用",
"\"{name}\" is an invalid file name." : "\"{name}\" 是一个无效的文件名",
"File name cannot be empty." : "文件名不能为空.",
+ "\"/\" is not allowed inside a file name." : "文件名不能包含“/”",
"\"{name}\" is not an allowed filetype" : "\"{name}\" 不是允许的文件类型",
"Storage of {owner} is full, files can not be updated or synced anymore!" : "{owner} 的存储空间已满, 文件将无法更新或同步!",
"Your storage is full, files can not be updated or synced anymore!" : "您的存储空间已满, 文件将无法更新或同步!",
@@ -75,6 +79,9 @@
"Favorite" : "收藏",
"New folder" : "新建文件夹",
"Upload file" : "上传文件",
+ "Not favorited" : "不受欢迎的",
+ "Remove from favorites" : "取消收藏",
+ "Add to favorites" : "收藏",
"An error occurred while trying to update the tags" : "更新标签时出错",
"Added to favorites" : "已添加到收藏",
"Removed from favorites" : "取消收藏",
diff --git a/apps/files_external/3rdparty/icewind/smb/src/Parser.php b/apps/files_external/3rdparty/icewind/smb/src/Parser.php
index 3142f9c29e0..c6515002657 100644
--- a/apps/files_external/3rdparty/icewind/smb/src/Parser.php
+++ b/apps/files_external/3rdparty/icewind/smb/src/Parser.php
@@ -133,7 +133,7 @@ class Parser {
return [
'mtime' => strtotime($data['write_time']),
'mode' => hexdec(substr($data['attributes'], strpos($data['attributes'], '('), -1)),
- 'size' => isset($data['stream']) ? intval(explode(' ', $data['stream'])[1]) : 0
+ 'size' => isset($data['stream']) ? (int)explode(' ', $data['stream'])[1] : 0
];
}
diff --git a/apps/files_external/3rdparty/icewind/smb/src/Share.php b/apps/files_external/3rdparty/icewind/smb/src/Share.php
index 8f1dace2be2..be1ba025508 100644
--- a/apps/files_external/3rdparty/icewind/smb/src/Share.php
+++ b/apps/files_external/3rdparty/icewind/smb/src/Share.php
@@ -370,8 +370,7 @@ class Share extends AbstractShare {
protected function execute($command) {
$this->connect();
$this->connection->write($command . PHP_EOL);
- $output = $this->connection->read();
- return $output;
+ return $this->connection->read();
}
/**
diff --git a/apps/files_external/lib/Controller/AjaxController.php b/apps/files_external/lib/Controller/AjaxController.php
index 9c2953851f5..66cbcae3e8f 100644
--- a/apps/files_external/lib/Controller/AjaxController.php
+++ b/apps/files_external/lib/Controller/AjaxController.php
@@ -110,9 +110,7 @@ class AjaxController extends Controller {
$currentUser = $this->userSession->getUser();
// Non-admins can only edit their own credentials
- $allowedToEdit = (
- $this->groupManager->isAdmin($currentUser->getUID()) || $currentUser->getUID() === $uid
- ) ? true : false;
+ $allowedToEdit = ($this->groupManager->isAdmin($currentUser->getUID()) || $currentUser->getUID() === $uid);
if ($allowedToEdit) {
$this->globalAuth->saveAuth($uid, $user, $password);
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index 7c536443a0e..03a24e89765 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -232,7 +232,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
} catch (\Exception $e) {
return $this->batchDelete();
}
- return false;
}
private function batchDelete($path = null) {
diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php
index b225f1eec8c..db03befa852 100644
--- a/apps/files_external/lib/Service/UserStoragesService.php
+++ b/apps/files_external/lib/Service/UserStoragesService.php
@@ -112,8 +112,7 @@ class UserStoragesService extends StoragesService {
*/
public function addStorage(StorageConfig $newStorage) {
$newStorage->setApplicableUsers([$this->getUser()->getUID()]);
- $config = parent::addStorage($newStorage);
- return $config;
+ return parent::addStorage($newStorage);
}
/**
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index c51bc1a75dd..fdd69987658 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -348,7 +348,7 @@ class ShareController extends Controller {
$freeSpace = (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
}
- $hideFileList = $share->getPermissions() & \OCP\Constants::PERMISSION_READ ? false : true;
+ $hideFileList = !($share->getPermissions() & \OCP\Constants::PERMISSION_READ);
$maxUploadFilesize = $freeSpace;
$folder = new Template('files', 'list', '');
diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php
index 575bf01fdb0..742962e6490 100644
--- a/apps/files_sharing/lib/Controller/ShareesAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php
@@ -230,9 +230,7 @@ class ShareesAPIController extends OCSController {
$url = $this->urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/sharees') . '?';
}
$params['page'] = $page + 1;
- $link = '<' . $url . http_build_query($params) . '>; rel="next"';
-
- return $link;
+ return '<' . $url . http_build_query($params) . '>; rel="next"';
}
/**
diff --git a/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php b/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php
index 07f739fb702..33812c5a43e 100644
--- a/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php
+++ b/apps/files_sharing/lib/Migration/OwncloudGuestShareType.php
@@ -75,7 +75,7 @@ class OwncloudGuestShareType implements IRepairStep {
protected function shouldRun() {
$appVersion = $this->config->getAppValue('files_sharing', 'installed_version', '0.0.0');
- return in_array($appVersion, ['0.10.0']) ||
+ return $appVersion === '0.10.0' ||
$this->config->getAppValue('core', 'vendor', '') === 'owncloud';
}
diff --git a/apps/files_sharing/lib/ShareBackend/Folder.php b/apps/files_sharing/lib/ShareBackend/Folder.php
index 80b141326d3..c48a26300a2 100644
--- a/apps/files_sharing/lib/ShareBackend/Folder.php
+++ b/apps/files_sharing/lib/ShareBackend/Folder.php
@@ -73,9 +73,7 @@ class Folder extends File implements \OCP\Share_Backend_Collection {
$query = \OCP\DB::prepare('SELECT `parent` FROM `*PREFIX*filecache` WHERE `fileid` = ?');
$result = $query->execute(array($child));
$row = $result->fetchRow();
- $parent = $row ? $row['parent'] : null;
-
- return $parent;
+ return $row ? $row['parent'] : null;
}
public function getChildren($itemSource) {
diff --git a/apps/files_trashbin/lib/Expiration.php b/apps/files_trashbin/lib/Expiration.php
index 03f126fc415..c7ad4e29f18 100644
--- a/apps/files_trashbin/lib/Expiration.php
+++ b/apps/files_trashbin/lib/Expiration.php
@@ -142,13 +142,13 @@ class Expiration {
$this->canPurgeToSaveSpace = true;
} elseif ($minValue !== 'auto' && $maxValue === 'auto') {
// Keep for X days but delete anytime if space needed
- $this->minAge = intval($minValue);
+ $this->minAge = (int)$minValue;
$this->maxAge = self::NO_OBLIGATION;
$this->canPurgeToSaveSpace = true;
} elseif ($minValue === 'auto' && $maxValue !== 'auto') {
// Delete anytime if space needed, Delete all older than max automatically
$this->minAge = self::NO_OBLIGATION;
- $this->maxAge = intval($maxValue);
+ $this->maxAge = (int)$maxValue;
$this->canPurgeToSaveSpace = true;
} elseif ($minValue !== 'auto' && $maxValue !== 'auto') {
// Delete all older than max OR older than min if space needed
@@ -158,8 +158,8 @@ class Expiration {
$maxValue = $minValue;
}
- $this->minAge = intval($minValue);
- $this->maxAge = intval($maxValue);
+ $this->minAge = (int)$minValue;
+ $this->maxAge = (int)$maxValue;
$this->canPurgeToSaveSpace = false;
}
}
diff --git a/apps/files_trashbin/lib/Storage.php b/apps/files_trashbin/lib/Storage.php
index e6609034f91..3025d36a210 100644
--- a/apps/files_trashbin/lib/Storage.php
+++ b/apps/files_trashbin/lib/Storage.php
@@ -254,8 +254,7 @@ class Storage extends Wrapper {
* @return MoveToTrashEvent
*/
protected function createMoveToTrashEvent(Node $node) {
- $event = new MoveToTrashEvent($node);
- return $event;
+ return new MoveToTrashEvent($node);
}
/**
diff --git a/apps/files_versions/lib/Expiration.php b/apps/files_versions/lib/Expiration.php
index 1dad8801230..83195d10a30 100644
--- a/apps/files_versions/lib/Expiration.php
+++ b/apps/files_versions/lib/Expiration.php
@@ -175,13 +175,13 @@ class Expiration {
$this->canPurgeToSaveSpace = true;
} elseif ($minValue !== 'auto' && $maxValue === 'auto') {
// Keep for X days but delete anytime if space needed
- $this->minAge = intval($minValue);
+ $this->minAge = (int)$minValue;
$this->maxAge = self::NO_OBLIGATION;
$this->canPurgeToSaveSpace = true;
} elseif ($minValue === 'auto' && $maxValue !== 'auto') {
// Delete anytime if space needed, Delete all older than max automatically
$this->minAge = self::NO_OBLIGATION;
- $this->maxAge = intval($maxValue);
+ $this->maxAge = (int)$maxValue;
$this->canPurgeToSaveSpace = true;
} elseif ($minValue !== 'auto' && $maxValue !== 'auto') {
// Delete all older than max OR older than min if space needed
@@ -191,8 +191,8 @@ class Expiration {
$maxValue = $minValue;
}
- $this->minAge = intval($minValue);
- $this->maxAge = intval($maxValue);
+ $this->minAge = (int)$minValue;
+ $this->maxAge = (int)$maxValue;
$this->canPurgeToSaveSpace = false;
}
}
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index 4c76c5340fa..f8a6636839a 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -167,7 +167,7 @@ class Storage {
// to get the right target
$ext = pathinfo($filename, PATHINFO_EXTENSION);
if ($ext === 'part') {
- $filename = substr($filename, 0, strlen($filename) - 5);
+ $filename = substr($filename, 0, -5);
}
// we only handle existing files
@@ -503,7 +503,7 @@ class Storage {
$toDelete = [];
foreach (array_reverse($versions['all']) as $key => $version) {
- if (intval($version['version'])<$threshold) {
+ if ((int)$version['version'] <$threshold) {
$toDelete[$key] = $version;
} else {
//Versions are sorted by time - nothing mo to iterate.
@@ -566,7 +566,7 @@ class Storage {
$fileData = $file->getData();
$filePath = $dir . '/' . $fileData['name'];
if ($file['type'] === 'dir') {
- array_push($dirs, $filePath);
+ $dirs[] = $filePath;
} else {
$versionsBegin = strrpos($filePath, '.v');
$relPathStart = strlen(self::VERSIONS_ROOT);
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index 287c6abff59..31df8a18951 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -690,7 +690,6 @@ class ShareByMailProvider implements IShareProvider {
*/
public function deleteFromSelf(IShare $share, $recipient) {
// nothing to do here, mail shares are only outgoing shares
- return;
}
/**
@@ -981,7 +980,6 @@ class ShareByMailProvider implements IShareProvider {
* @param string $gid
*/
public function groupDeleted($gid) {
- return;
}
/**
@@ -991,7 +989,6 @@ class ShareByMailProvider implements IShareProvider {
* @param string $gid
*/
public function userDeletedFromGroup($uid, $gid) {
- return;
}
/**
diff --git a/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php b/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php
index 5c5500862e6..f5b01649bbb 100644
--- a/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php
+++ b/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php
@@ -90,8 +90,7 @@ class BackupCodesProvider implements IProvider {
* @return Template
*/
public function getTemplate(IUser $user) {
- $tmpl = new Template('twofactor_backupcodes', 'challenge');
- return $tmpl;
+ return new Template('twofactor_backupcodes', 'challenge');
}
/**
diff --git a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
index 84bf54d3379..2fb5fe8a6c0 100644
--- a/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
+++ b/apps/twofactor_backupcodes/lib/Service/BackupCodeStorage.php
@@ -86,7 +86,7 @@ class BackupCodeStorage {
$dbCode->setUsed(0);
$this->mapper->insert($dbCode);
- array_push($result, $code);
+ $result[] = $code;
}
$this->publishEvent($user, 'codes_generated');
diff --git a/apps/user_ldap/ajax/getNewServerConfigPrefix.php b/apps/user_ldap/ajax/getNewServerConfigPrefix.php
index d65e9add563..c0c81be14d7 100644
--- a/apps/user_ldap/ajax/getNewServerConfigPrefix.php
+++ b/apps/user_ldap/ajax/getNewServerConfigPrefix.php
@@ -32,7 +32,7 @@ $helper = new \OCA\User_LDAP\Helper(\OC::$server->getConfig());
$serverConnections = $helper->getServerConfigurationPrefixes();
sort($serverConnections);
$lk = array_pop($serverConnections);
-$ln = intval(str_replace('s', '', $lk));
+$ln = (int)str_replace('s', '', $lk);
$nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT);
$resultData = array('configPrefix' => $nk);
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index 43feeb4c1f0..915d8e8e092 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -168,12 +168,14 @@ class Access extends LDAPUtility implements IUserTools {
/**
* reads a given attribute for an LDAP record identified by a DN
+ *
* @param string $dn the record in question
* @param string $attr the attribute that shall be retrieved
* if empty, just check the record's existence
* @param string $filter
* @return array|false an array of values on success or an empty
* array if $attr is empty, false otherwise
+ * @throws ServerNotAvailableException
*/
public function readAttribute($dn, $attr, $filter = 'objectClass=*') {
if(!$this->checkConnection()) {
@@ -255,6 +257,7 @@ class Access extends LDAPUtility implements IUserTools {
* @return array|bool false if there was any error, true if an exists check
* was performed and the requested DN found, array with the
* returned data on a successful usual operation
+ * @throws ServerNotAvailableException
*/
public function executeRead($cr, $dn, $attribute, $filter, $maxResults) {
$this->initPagedSearch($filter, array($dn), array($attribute), $maxResults, 0);
diff --git a/apps/user_ldap/lib/Command/Search.php b/apps/user_ldap/lib/Command/Search.php
index ae61bfcd41c..c81b8d54696 100644
--- a/apps/user_ldap/lib/Command/Search.php
+++ b/apps/user_ldap/lib/Command/Search.php
@@ -109,8 +109,8 @@ class Search extends Command {
$configPrefixes = $helper->getServerConfigurationPrefixes(true);
$ldapWrapper = new LDAP();
- $offset = intval($input->getOption('offset'));
- $limit = intval($input->getOption('limit'));
+ $offset = (int)$input->getOption('offset');
+ $limit = (int)$input->getOption('limit');
$this->validateOffsetAndLimit($offset, $limit);
if($input->getOption('group')) {
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index c73a35e6bf1..25d3f66c52d 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -106,7 +106,7 @@ class Connection extends LDAPUtility {
$this->doNotValidate = !in_array($this->configPrefix,
$helper->getServerConfigurationPrefixes());
$this->hasPagedResultSupport =
- intval($this->configuration->ldapPagingSize) !== 0
+ (int)$this->configuration->ldapPagingSize !== 0
|| $this->ldap->hasPagedResultSupport();
}
@@ -368,7 +368,7 @@ class Connection extends LDAPUtility {
}
}
- $backupPort = intval($this->configuration->ldapBackupPort);
+ $backupPort = (int)$this->configuration->ldapBackupPort;
if ($backupPort <= 0) {
$this->configuration->backupPort = $this->configuration->ldapPort;
}
@@ -399,7 +399,7 @@ class Connection extends LDAPUtility {
private function doCriticalValidation() {
$configurationOK = true;
$errorStr = 'Configuration Error (prefix '.
- strval($this->configPrefix).'): ';
+ (string)$this->configPrefix .'): ';
//options that shall not be empty
$options = array('ldapHost', 'ldapPort', 'ldapUserDisplayName',
diff --git a/apps/user_ldap/lib/Controller/ConfigAPIController.php b/apps/user_ldap/lib/Controller/ConfigAPIController.php
index 54800ef24eb..e000bd4e709 100644
--- a/apps/user_ldap/lib/Controller/ConfigAPIController.php
+++ b/apps/user_ldap/lib/Controller/ConfigAPIController.php
@@ -285,7 +285,7 @@ class ConfigAPIController extends OCSController {
$config = new Configuration($configID);
$data = $config->getConfiguration();
- if(!boolval(intval($showPassword))) {
+ if(!(int)$showPassword) {
$data['ldapAgentPassword'] = '***';
}
foreach ($data as $key => $value) {
diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php
index 3faa96bc2b8..6a2be770104 100644
--- a/apps/user_ldap/lib/Group_LDAP.php
+++ b/apps/user_ldap/lib/Group_LDAP.php
@@ -266,7 +266,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
$groups = $this->access->groupsMatchFilter($groups);
$allGroups = $groups;
$nestedGroups = $this->access->connection->ldapNestedGroups;
- if (intval($nestedGroups) === 1) {
+ if ((int)$nestedGroups === 1) {
foreach ($groups as $group) {
$subGroups = $this->_getGroupDNsFromMemberOf($group, $seen);
$allGroups = array_merge($allGroups, $subGroups);
@@ -667,8 +667,8 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
// if possible, read out membership via memberOf. It's far faster than
// performing a search, which still is a fallback later.
// memberof doesn't support memberuid, so skip it here.
- if(intval($this->access->connection->hasMemberOfFilterSupport) === 1
- && intval($this->access->connection->useMemberOfToDetectMembership) === 1
+ if((int)$this->access->connection->hasMemberOfFilterSupport === 1
+ && (int)$this->access->connection->useMemberOfToDetectMembership === 1
&& strtolower($this->access->connection->ldapGroupMemberAssocAttr) !== 'memberuid'
) {
$groupDNs = $this->_getGroupDNsFromMemberOf($userDN);
diff --git a/apps/user_ldap/lib/Helper.php b/apps/user_ldap/lib/Helper.php
index 3157a7ab09d..f7794168760 100644
--- a/apps/user_ldap/lib/Helper.php
+++ b/apps/user_ldap/lib/Helper.php
@@ -122,9 +122,8 @@ class Helper {
sort($serverConnections);
$lastKey = array_pop($serverConnections);
- $lastNumber = intval(str_replace('s', '', $lastKey));
- $nextPrefix = 's' . str_pad($lastNumber + 1, 2, '0', STR_PAD_LEFT);
- return $nextPrefix;
+ $lastNumber = (int)str_replace('s', '', $lastKey);
+ return 's' . str_pad($lastNumber + 1, 2, '0', STR_PAD_LEFT);
}
private function getServersConfig($value) {
diff --git a/apps/user_ldap/lib/Jobs/CleanUp.php b/apps/user_ldap/lib/Jobs/CleanUp.php
index 849c30ecd65..df7d888a902 100644
--- a/apps/user_ldap/lib/Jobs/CleanUp.php
+++ b/apps/user_ldap/lib/Jobs/CleanUp.php
@@ -69,8 +69,8 @@ class CleanUp extends TimedJob {
public function __construct() {
$minutes = \OC::$server->getConfig()->getSystemValue(
- 'ldapUserCleanupInterval', strval($this->defaultIntervalMin));
- $this->setInterval(intval($minutes) * 60);
+ 'ldapUserCleanupInterval', (string)$this->defaultIntervalMin);
+ $this->setInterval((int)$minutes * 60);
}
/**
@@ -156,7 +156,7 @@ class CleanUp extends TimedJob {
* @return bool
*/
public function isOffsetResetNecessary($resultCount) {
- return ($resultCount < $this->limit) ? true : false;
+ return $resultCount < $this->limit;
}
/**
@@ -183,7 +183,7 @@ class CleanUp extends TimedJob {
*/
private function isCleanUpEnabled() {
return (bool)$this->ocConfig->getSystemValue(
- 'ldapUserCleanupInterval', strval($this->defaultIntervalMin));
+ 'ldapUserCleanupInterval', (string)$this->defaultIntervalMin);
}
/**
@@ -215,7 +215,7 @@ class CleanUp extends TimedJob {
* @return int
*/
private function getOffset() {
- return intval($this->ocConfig->getAppValue('user_ldap', 'cleanUpJobOffset', 0));
+ return (int)$this->ocConfig->getAppValue('user_ldap', 'cleanUpJobOffset', 0);
}
/**
diff --git a/apps/user_ldap/lib/Migration/UUIDFixInsert.php b/apps/user_ldap/lib/Migration/UUIDFixInsert.php
index 4a1104f2c6f..a99e13f74ce 100644
--- a/apps/user_ldap/lib/Migration/UUIDFixInsert.php
+++ b/apps/user_ldap/lib/Migration/UUIDFixInsert.php
@@ -90,7 +90,7 @@ class UUIDFixInsert implements IRepairStep {
$offset += $batchSize;
} catch (\InvalidArgumentException $e) {
if(strpos($e->getMessage(), 'Background job arguments can\'t exceed 4000') !== false) {
- $batchSize = intval(floor(count($records) * 0.8));
+ $batchSize = (int)floor(count($records) * 0.8);
$retry = true;
}
}
diff --git a/apps/user_ldap/lib/User/Manager.php b/apps/user_ldap/lib/User/Manager.php
index b04a321652c..55fc7499beb 100644
--- a/apps/user_ldap/lib/User/Manager.php
+++ b/apps/user_ldap/lib/User/Manager.php
@@ -207,7 +207,7 @@ class Manager {
public function isDeletedUser($id) {
$isDeleted = $this->ocConfig->getUserValue(
$id, 'user_ldap', 'isDeleted', 0);
- return intval($isDeleted) === 1;
+ return (int)$isDeleted === 1;
}
/**
diff --git a/apps/user_ldap/lib/User/OfflineUser.php b/apps/user_ldap/lib/User/OfflineUser.php
index 942eee84cb7..9576b49d5a2 100644
--- a/apps/user_ldap/lib/User/OfflineUser.php
+++ b/apps/user_ldap/lib/User/OfflineUser.php
@@ -166,7 +166,7 @@ class OfflineUser {
* @return int
*/
public function getLastLogin() {
- return intval($this->lastLogin);
+ return (int)$this->lastLogin;
}
/**
@@ -211,7 +211,7 @@ class OfflineUser {
', 1);
$query->execute(array($this->ocName));
$sResult = $query->fetchColumn(0);
- if(intval($sResult) === 1) {
+ if((int)$sResult === 1) {
$this->hasActiveShares = true;
return;
}
@@ -223,7 +223,7 @@ class OfflineUser {
', 1);
$query->execute(array($this->ocName));
$sResult = $query->fetchColumn(0);
- if(intval($sResult) === 1) {
+ if((int)$sResult === 1) {
$this->hasActiveShares = true;
return;
}
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php
index 506ea36c529..cc3bf85716f 100644
--- a/apps/user_ldap/lib/User_LDAP.php
+++ b/apps/user_ldap/lib/User_LDAP.php
@@ -38,6 +38,7 @@
namespace OCA\User_LDAP;
+use OC\ServerNotAvailableException;
use OC\User\Backend;
use OC\User\NoUserException;
use OCA\User_LDAP\Exceptions\NotOnLDAP;
@@ -317,16 +318,18 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
try {
$uuid = $this->access->getUserMapper()->getUUIDByDN($dn);
- if(!$uuid) {
+ if (!$uuid) {
return false;
}
$newDn = $this->access->getUserDnByUuid($uuid);
//check if renamed user is still valid by reapplying the ldap filter
- if(!is_array($this->access->readAttribute($newDn, '', $this->access->connection->ldapUserFilter))) {
+ if (!is_array($this->access->readAttribute($newDn, '', $this->access->connection->ldapUserFilter))) {
return false;
}
$this->access->getUserMapper()->setDNbyUUID($newDn, $uuid);
return true;
+ } catch (ServerNotAvailableException $e) {
+ throw $e;
} catch (\Exception $e) {
return false;
}
diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php
index bf7c6bbeb93..433bd2fb73a 100644
--- a/apps/user_ldap/lib/Wizard.php
+++ b/apps/user_ldap/lib/Wizard.php
@@ -227,7 +227,7 @@ class Wizard extends LDAPUtility {
if ($attr !== '' && $attr !== 'displayName') {
// most likely not the default value with upper case N,
// verify it still produces a result
- $count = intval($this->countUsersWithAttribute($attr, true));
+ $count = (int)$this->countUsersWithAttribute($attr, true);
if($count > 0) {
//no change, but we sent it back to make sure the user interface
//is still correct, even if the ajax call was cancelled meanwhile
@@ -239,7 +239,7 @@ class Wizard extends LDAPUtility {
// first attribute that has at least one result wins
$displayNameAttrs = array('displayname', 'cn');
foreach ($displayNameAttrs as $attr) {
- $count = intval($this->countUsersWithAttribute($attr, true));
+ $count = (int)$this->countUsersWithAttribute($attr, true);
if($count > 0) {
$this->applyFind('ldap_display_name', $attr);
@@ -267,7 +267,7 @@ class Wizard extends LDAPUtility {
$attr = $this->configuration->ldapEmailAttribute;
if ($attr !== '') {
- $count = intval($this->countUsersWithAttribute($attr, true));
+ $count = (int)$this->countUsersWithAttribute($attr, true);
if($count > 0) {
return false;
}
diff --git a/apps/workflowengine/lib/Controller/RequestTime.php b/apps/workflowengine/lib/Controller/RequestTime.php
index dd0efa89b91..1a07ca20a4d 100644
--- a/apps/workflowengine/lib/Controller/RequestTime.php
+++ b/apps/workflowengine/lib/Controller/RequestTime.php
@@ -37,7 +37,7 @@ class RequestTime extends Controller {
if ($search !== '') {
$timezones = array_filter($timezones, function ($timezone) use ($search) {
- return strpos(strtolower($timezone), strtolower($search)) !== false;
+ return stripos($timezone, $search) !== false;
});
}
diff --git a/core/Command/Config/Import.php b/core/Command/Config/Import.php
index 4a8db1c9656..b6aa6e3411d 100644
--- a/core/Command/Config/Import.php
+++ b/core/Command/Config/Import.php
@@ -113,8 +113,7 @@ class Import extends Command implements CompletionAwareInterface {
* @return string
*/
protected function getArrayFromFile($importFile) {
- $content = file_get_contents($importFile);
- return $content;
+ return file_get_contents($importFile);
}
/**
diff --git a/core/Command/Integrity/CheckApp.php b/core/Command/Integrity/CheckApp.php
index 3e4d8b9cba7..d0dfbcada3a 100644
--- a/core/Command/Integrity/CheckApp.php
+++ b/core/Command/Integrity/CheckApp.php
@@ -63,7 +63,7 @@ class CheckApp extends Base {
*/
protected function execute(InputInterface $input, OutputInterface $output) {
$appid = $input->getArgument('appid');
- $path = strval($input->getOption('path'));
+ $path = (string)$input->getOption('path');
$result = $this->checker->verifyAppSignature($appid, $path);
$this->writeArrayInOutputFormat($input, $output, $result);
if (count($result)>0){
diff --git a/core/Command/TwoFactorAuth/Base.php b/core/Command/TwoFactorAuth/Base.php
index fe817d214ba..c5340656534 100644
--- a/core/Command/TwoFactorAuth/Base.php
+++ b/core/Command/TwoFactorAuth/Base.php
@@ -28,7 +28,7 @@ use OCP\IUser;
use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface;
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
-class Base extends \OC\Core\Command\Base implements CompletionAwareInterface {
+class Base extends \OC\Core\Command\Base {
/** @var IUserManager */
protected $userManager;
diff --git a/core/l10n/pl.js b/core/l10n/pl.js
index aafc40e0613..0453ba70e62 100644
--- a/core/l10n/pl.js
+++ b/core/l10n/pl.js
@@ -56,6 +56,7 @@ OC.L10N.register(
"Search contacts …" : "Wyszukuję kontakty...",
"No contacts found" : "Nie znaleziono żadnych kontaktów",
"Show all contacts …" : "Pokazuję wszystkie kontakty...",
+ "Could not load your contacts" : "Nie można było załadować Twoich kontaktów",
"Loading your contacts …" : "Ładuję twoje kontakty...",
"Looking for {term} …" : "Szukam {term}...",
"<a href=\"{docUrl}\">There were problems with the code integrity check. More information…</a>" : "<a href=\"{docUrl}\">Wystąpiły problemy przy sprawdzaniu integralności kodu Więcej informacji…</a>",
@@ -114,6 +115,7 @@ OC.L10N.register(
"No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">documentation</a>." : "Nie skonfigurowano pamięci cache. Jeśli to możliwe skonfiguruj pamięć cache, aby zwiększyć wydajność. Więcej informacji można znaleźć w naszej <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">dokumentacji</a>.",
"/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in the <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">documentation</a>." : "PHP nie może czytać z /dev/urandom co jest wymagane ze względów bezpieczeństwa. Więcej informacji można znaleźć w naszej <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">dokumentacji</a>.",
"You are currently running PHP {version}. Upgrade your PHP version to take advantage of <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{phpLink}\">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it." : "Posiadasz aktualnie PHP w wersji {version}. Aby skorzystać z <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{phpLink}\">aktualizacji dotyczących wydajności i bezpieczeństwa otrzymanych z PHP Group</a> zachęcamy do podniesienia wersji PHP, kiedy tylko Twoja dystrybucja będzie je wspierała.",
+ "You are currently running PHP 5.6. The current major version of Nextcloud is the last that is supported on PHP 5.6. It is recommended to upgrade the PHP version to 7.0+ to be able to upgrade to Nextcloud 14." : "Używasz aktualnie PHP w wersji 5.6. Aktualna, główna wersja Nextcloud jest ostatnią wspierającą PHP 5.6. Zalecamy upgrade PHP do wersji 7.0+ aby można było w przyszłości korzystać z Nextcloud 14.",
"The reverse proxy header configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If not, this is a security issue and can allow an attacker to spoof their IP address as visible to the Nextcloud. Further information can be found in the <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">documentation</a>." : "Konfiguracja nagłówków reverse proxy jest niepoprawna albo łączysz się do Nextclouda przez zaufane proxy. Jeśli nie łączysz się z zaufanego proxy, to jest to problem bezpieczeństwa i atakujący może podszyć się pod adres IP jako widoczny dla Nextclouda. Więcej informacji można znaleźć w naszej <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">dokumentacji</a>.",
"Memcached is configured as distributed cache, but the wrong PHP module \"memcache\" is installed. \\OC\\Memcache\\Memcached only supports \"memcached\" and not \"memcache\". See the <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{wikiLink}\">memcached wiki about both modules</a>." : "Jako cache jest skonfigurowane \"memcached\", ale błędny moduł PHP \"memcache\" jest zainstalowany. \\OC\\Memcache\\Memcached wspiera tylko \"memcached\", a nie \"memcache\". Sprawdź <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{wikiLink}\">memcached wiki o obu tych modułach</a>.",
"Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">documentation</a>. (<a href=\"{codeIntegrityDownloadEndpoint}\">List of invalid files…</a> / <a href=\"{rescanEndpoint}\">Rescan…</a>)" : "Niektóre pliki nie przeszły sprawdzania spójności. Dalsze informacje jak to naprawić mogą być znalezione w naszej <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">dokumentacji</a>. (<a href=\"{codeIntegrityDownloadEndpoint}\">Lista niepoprawnych plików...</a> / <a href=\"{rescanEndpoint}\">Skanowanie ponowne…</a>)",
diff --git a/core/l10n/pl.json b/core/l10n/pl.json
index f3689127395..b2f7cd3c674 100644
--- a/core/l10n/pl.json
+++ b/core/l10n/pl.json
@@ -54,6 +54,7 @@
"Search contacts …" : "Wyszukuję kontakty...",
"No contacts found" : "Nie znaleziono żadnych kontaktów",
"Show all contacts …" : "Pokazuję wszystkie kontakty...",
+ "Could not load your contacts" : "Nie można było załadować Twoich kontaktów",
"Loading your contacts …" : "Ładuję twoje kontakty...",
"Looking for {term} …" : "Szukam {term}...",
"<a href=\"{docUrl}\">There were problems with the code integrity check. More information…</a>" : "<a href=\"{docUrl}\">Wystąpiły problemy przy sprawdzaniu integralności kodu Więcej informacji…</a>",
@@ -112,6 +113,7 @@
"No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">documentation</a>." : "Nie skonfigurowano pamięci cache. Jeśli to możliwe skonfiguruj pamięć cache, aby zwiększyć wydajność. Więcej informacji można znaleźć w naszej <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">dokumentacji</a>.",
"/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in the <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">documentation</a>." : "PHP nie może czytać z /dev/urandom co jest wymagane ze względów bezpieczeństwa. Więcej informacji można znaleźć w naszej <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">dokumentacji</a>.",
"You are currently running PHP {version}. Upgrade your PHP version to take advantage of <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{phpLink}\">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it." : "Posiadasz aktualnie PHP w wersji {version}. Aby skorzystać z <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{phpLink}\">aktualizacji dotyczących wydajności i bezpieczeństwa otrzymanych z PHP Group</a> zachęcamy do podniesienia wersji PHP, kiedy tylko Twoja dystrybucja będzie je wspierała.",
+ "You are currently running PHP 5.6. The current major version of Nextcloud is the last that is supported on PHP 5.6. It is recommended to upgrade the PHP version to 7.0+ to be able to upgrade to Nextcloud 14." : "Używasz aktualnie PHP w wersji 5.6. Aktualna, główna wersja Nextcloud jest ostatnią wspierającą PHP 5.6. Zalecamy upgrade PHP do wersji 7.0+ aby można było w przyszłości korzystać z Nextcloud 14.",
"The reverse proxy header configuration is incorrect, or you are accessing Nextcloud from a trusted proxy. If not, this is a security issue and can allow an attacker to spoof their IP address as visible to the Nextcloud. Further information can be found in the <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">documentation</a>." : "Konfiguracja nagłówków reverse proxy jest niepoprawna albo łączysz się do Nextclouda przez zaufane proxy. Jeśli nie łączysz się z zaufanego proxy, to jest to problem bezpieczeństwa i atakujący może podszyć się pod adres IP jako widoczny dla Nextclouda. Więcej informacji można znaleźć w naszej <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">dokumentacji</a>.",
"Memcached is configured as distributed cache, but the wrong PHP module \"memcache\" is installed. \\OC\\Memcache\\Memcached only supports \"memcached\" and not \"memcache\". See the <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{wikiLink}\">memcached wiki about both modules</a>." : "Jako cache jest skonfigurowane \"memcached\", ale błędny moduł PHP \"memcache\" jest zainstalowany. \\OC\\Memcache\\Memcached wspiera tylko \"memcached\", a nie \"memcache\". Sprawdź <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{wikiLink}\">memcached wiki o obu tych modułach</a>.",
"Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">documentation</a>. (<a href=\"{codeIntegrityDownloadEndpoint}\">List of invalid files…</a> / <a href=\"{rescanEndpoint}\">Rescan…</a>)" : "Niektóre pliki nie przeszły sprawdzania spójności. Dalsze informacje jak to naprawić mogą być znalezione w naszej <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"{docLink}\">dokumentacji</a>. (<a href=\"{codeIntegrityDownloadEndpoint}\">Lista niepoprawnych plików...</a> / <a href=\"{rescanEndpoint}\">Skanowanie ponowne…</a>)",
diff --git a/core/l10n/tr.js b/core/l10n/tr.js
index 4c5ae4b2d3f..8ef1b2adf6d 100644
--- a/core/l10n/tr.js
+++ b/core/l10n/tr.js
@@ -56,6 +56,7 @@ OC.L10N.register(
"Search contacts …" : "Kişi arama...",
"No contacts found" : "Herhangi bir kişi bulunamadı",
"Show all contacts …" : "Tüm kişileri görüntüle...",
+ "Could not load your contacts" : "Kişileriniz yüklenemedi",
"Loading your contacts …" : "Kişileriniz yükleniyor...",
"Looking for {term} …" : "{term} ifadesi aranıyor...",
"<a href=\"{docUrl}\">There were problems with the code integrity check. More information…</a>" : "<a href=\"{docUrl}\">Kod bütünlük sınamasında sorunlar çıktı. Ayrıntılı bilgi…</a>",
diff --git a/core/l10n/tr.json b/core/l10n/tr.json
index 2a670c5e246..9453db10fef 100644
--- a/core/l10n/tr.json
+++ b/core/l10n/tr.json
@@ -54,6 +54,7 @@
"Search contacts …" : "Kişi arama...",
"No contacts found" : "Herhangi bir kişi bulunamadı",
"Show all contacts …" : "Tüm kişileri görüntüle...",
+ "Could not load your contacts" : "Kişileriniz yüklenemedi",
"Loading your contacts …" : "Kişileriniz yükleniyor...",
"Looking for {term} …" : "{term} ifadesi aranıyor...",
"<a href=\"{docUrl}\">There were problems with the code integrity check. More information…</a>" : "<a href=\"{docUrl}\">Kod bütünlük sınamasında sorunlar çıktı. Ayrıntılı bilgi…</a>",
diff --git a/cron.php b/cron.php
index 643c42688df..b566f7ea340 100644
--- a/cron.php
+++ b/cron.php
@@ -63,7 +63,7 @@ try {
$logger = \OC::$server->getLogger();
$config = \OC::$server->getConfig();
- // Don't do anything if ownCloud has not been installed
+ // Don't do anything if Nextcloud has not been installed
if (!$config->getSystemValue('installed', false)) {
exit(0);
}
@@ -71,8 +71,8 @@ try {
\OC::$server->getTempManager()->cleanOld();
// Exit if background jobs are disabled!
- $appMode = \OCP\BackgroundJob::getExecutionType();
- if ($appMode == 'none') {
+ $appMode = $config->getAppValue('core', 'backgroundjobs_mode', 'ajax');
+ if ($appMode === 'none') {
if (OC::$CLI) {
echo 'Background Jobs are disabled!' . PHP_EOL;
} else {
@@ -101,9 +101,9 @@ try {
exit(1);
}
- // We call ownCloud from the CLI (aka cron)
- if ($appMode != 'cron') {
- \OCP\BackgroundJob::setExecutionType('cron');
+ // We call Nextcloud from the CLI (aka cron)
+ if ($appMode !== 'cron') {
+ $config->setAppValue('core', 'backgroundjobs_mode', 'cron');
}
// Work
diff --git a/lib/l10n/zh_CN.js b/lib/l10n/zh_CN.js
index 9fb446e472e..421a31bc1cb 100644
--- a/lib/l10n/zh_CN.js
+++ b/lib/l10n/zh_CN.js
@@ -31,14 +31,23 @@ OC.L10N.register(
"Invalid image" : "无效的图像",
"Avatar image is not square" : "头像图像不是正方形",
"today" : "今天",
+ "tomorrow" : "明天",
"yesterday" : "昨天",
+ "_in %n day_::_in %n days_" : ["%n天内"],
"_%n day ago_::_%n days ago_" : ["%n 天前"],
+ "next month" : "下月",
"last month" : "上月",
+ "_in %n month_::_in %n months_" : ["%n月内"],
"_%n month ago_::_%n months ago_" : ["%n 月前"],
+ "next year" : "明年",
"last year" : "去年",
+ "_in %n year_::_in %n years_" : ["%n年内"],
"_%n year ago_::_%n years ago_" : ["%n 年前"],
+ "_in %n hour_::_in %n hours_" : ["%n小时内"],
"_%n hour ago_::_%n hours ago_" : ["%n 小时前"],
+ "_in %n minute_::_in %n minutes_" : ["%n分钟内"],
"_%n minute ago_::_%n minutes ago_" : ["%n 分钟前"],
+ "in a few seconds" : "几秒钟内",
"seconds ago" : "几秒前",
"Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "模块:%s不存在。请在 App 设置中开启或联系管理员。",
"File name is a reserved word" : "文件名包含敏感字符",
diff --git a/lib/l10n/zh_CN.json b/lib/l10n/zh_CN.json
index 77b53a5b409..3734f2630a3 100644
--- a/lib/l10n/zh_CN.json
+++ b/lib/l10n/zh_CN.json
@@ -29,14 +29,23 @@
"Invalid image" : "无效的图像",
"Avatar image is not square" : "头像图像不是正方形",
"today" : "今天",
+ "tomorrow" : "明天",
"yesterday" : "昨天",
+ "_in %n day_::_in %n days_" : ["%n天内"],
"_%n day ago_::_%n days ago_" : ["%n 天前"],
+ "next month" : "下月",
"last month" : "上月",
+ "_in %n month_::_in %n months_" : ["%n月内"],
"_%n month ago_::_%n months ago_" : ["%n 月前"],
+ "next year" : "明年",
"last year" : "去年",
+ "_in %n year_::_in %n years_" : ["%n年内"],
"_%n year ago_::_%n years ago_" : ["%n 年前"],
+ "_in %n hour_::_in %n hours_" : ["%n小时内"],
"_%n hour ago_::_%n hours ago_" : ["%n 小时前"],
+ "_in %n minute_::_in %n minutes_" : ["%n分钟内"],
"_%n minute ago_::_%n minutes ago_" : ["%n 分钟前"],
+ "in a few seconds" : "几秒钟内",
"seconds ago" : "几秒前",
"Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "模块:%s不存在。请在 App 设置中开启或联系管理员。",
"File name is a reserved word" : "文件名包含敏感字符",
diff --git a/lib/private/Activity/Manager.php b/lib/private/Activity/Manager.php
index 792dea4cff5..1b64fa59a91 100644
--- a/lib/private/Activity/Manager.php
+++ b/lib/private/Activity/Manager.php
@@ -231,7 +231,7 @@ class Manager implements IManager {
* @param \Closure $callable
*/
public function registerConsumer(\Closure $callable) {
- array_push($this->consumersClosures, $callable);
+ $this->consumersClosures[] = $callable;
$this->consumers = [];
}
@@ -244,7 +244,7 @@ class Manager implements IManager {
* @param \Closure $callable
*/
public function registerExtension(\Closure $callable) {
- array_push($this->extensionsClosures, $callable);
+ $this->extensionsClosures[] = $callable;
$this->extensions = [];
}
diff --git a/lib/private/App/CodeChecker/DeprecationCheck.php b/lib/private/App/CodeChecker/DeprecationCheck.php
index 95d0762e093..a7cba692cf8 100644
--- a/lib/private/App/CodeChecker/DeprecationCheck.php
+++ b/lib/private/App/CodeChecker/DeprecationCheck.php
@@ -23,7 +23,7 @@
namespace OC\App\CodeChecker;
-class DeprecationCheck extends AbstractCheck implements ICheck {
+class DeprecationCheck extends AbstractCheck {
/**
* @return string
*/
@@ -45,6 +45,7 @@ class DeprecationCheck extends AbstractCheck implements ICheck {
'OCP\Response' => '8.1.0',
'OCP\AppFramework\IApi' => '8.0.0',
'OCP\User' => '13.0.0',
+ 'OCP\BackgroundJob' => '14.0.0',
];
}
@@ -116,6 +117,8 @@ class DeprecationCheck extends AbstractCheck implements ICheck {
'OCP\AppFramework\IAppContainer::log' => '8.0.0',
'OCP\BackgroundJob::registerJob' => '8.1.0',
+ 'OCP\BackgroundJob::getExecutionType' => '14.0.0',
+ 'OCP\BackgroundJob::setExecutionType' => '14.0.0',
'OCP\Files::tmpFile' => '8.1.0',
'OCP\Files::tmpFolder' => '8.1.0',
diff --git a/lib/private/App/CodeChecker/PrivateCheck.php b/lib/private/App/CodeChecker/PrivateCheck.php
index 5d160b8f32a..f6b5fb4fb16 100644
--- a/lib/private/App/CodeChecker/PrivateCheck.php
+++ b/lib/private/App/CodeChecker/PrivateCheck.php
@@ -22,7 +22,7 @@
namespace OC\App\CodeChecker;
-class PrivateCheck extends AbstractCheck implements ICheck {
+class PrivateCheck extends AbstractCheck {
/**
* @return string
*/
diff --git a/lib/private/App/Platform.php b/lib/private/App/Platform.php
index 344e420b7d3..fe4d7ff48f7 100644
--- a/lib/private/App/Platform.php
+++ b/lib/private/App/Platform.php
@@ -94,7 +94,6 @@ class Platform {
public function getLibraryVersion($name) {
$repo = new PlatformRepository();
- $lib = $repo->findLibrary($name);
- return $lib;
+ return $repo->findLibrary($name);
}
}
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 94c725f3fbc..d9e82819d14 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -335,7 +335,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
* @return boolean|null
*/
public function registerMiddleWare($middleWare) {
- array_push($this->middleWares, $middleWare);
+ $this->middleWares[] = $middleWare;
}
/**
diff --git a/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php b/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php
index 306b8095a97..60d2ae8b5c9 100644
--- a/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php
+++ b/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php
@@ -63,7 +63,7 @@ class MiddlewareDispatcher {
* @param Middleware $middleWare the middleware which will be added
*/
public function registerMiddleware(Middleware $middleWare){
- array_push($this->middlewares, $middleWare);
+ $this->middlewares[] = $middleWare;
}
diff --git a/lib/private/Collaboration/Collaborators/GroupPlugin.php b/lib/private/Collaboration/Collaborators/GroupPlugin.php
index 0b2b3d71028..b147d2d7b58 100644
--- a/lib/private/Collaboration/Collaborators/GroupPlugin.php
+++ b/lib/private/Collaboration/Collaborators/GroupPlugin.php
@@ -102,13 +102,13 @@ class GroupPlugin implements ISearchPlugin {
// user id and if so, we add that to the exact match list
$group = $this->groupManager->get($search);
if ($group instanceof IGroup && (!$this->shareWithGroupOnly || in_array($group->getGID(), $userGroups))) {
- array_push($result['exact'], [
+ $result['exact'][] = [
'label' => $group->getDisplayName(),
'value' => [
'shareType' => Share::SHARE_TYPE_GROUP,
'shareWith' => $group->getGID(),
],
- ]);
+ ];
}
}
diff --git a/lib/private/Collaboration/Collaborators/UserPlugin.php b/lib/private/Collaboration/Collaborators/UserPlugin.php
index ad677703547..d2639249d56 100644
--- a/lib/private/Collaboration/Collaborators/UserPlugin.php
+++ b/lib/private/Collaboration/Collaborators/UserPlugin.php
@@ -128,13 +128,13 @@ class UserPlugin implements ISearchPlugin {
}
if ($addUser) {
- array_push($result['exact'], [
+ $result['exact'][] = [
'label' => $user->getDisplayName(),
'value' => [
'shareType' => Share::SHARE_TYPE_USER,
'shareWith' => $user->getUID(),
],
- ]);
+ ];
}
}
}
diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php
index 4357a2eb437..2b43a27b7ac 100644
--- a/lib/private/Comments/Manager.php
+++ b/lib/private/Comments/Manager.php
@@ -87,14 +87,14 @@ class Manager implements ICommentsManager {
* @return array
*/
protected function normalizeDatabaseData(array $data) {
- $data['id'] = strval($data['id']);
- $data['parent_id'] = strval($data['parent_id']);
- $data['topmost_parent_id'] = strval($data['topmost_parent_id']);
+ $data['id'] = (string)$data['id'];
+ $data['parent_id'] = (string)$data['parent_id'];
+ $data['topmost_parent_id'] = (string)$data['topmost_parent_id'];
$data['creation_timestamp'] = new \DateTime($data['creation_timestamp']);
if (!is_null($data['latest_child_timestamp'])) {
$data['latest_child_timestamp'] = new \DateTime($data['latest_child_timestamp']);
}
- $data['children_count'] = intval($data['children_count']);
+ $data['children_count'] = (int)$data['children_count'];
return $data;
}
@@ -171,7 +171,7 @@ class Manager implements ICommentsManager {
$resultStatement = $query->execute();
$data = $resultStatement->fetch(\PDO::FETCH_NUM);
$resultStatement->closeCursor();
- $children = intval($data[0]);
+ $children = (int)$data[0];
$comment = $this->get($id);
$comment->setChildrenCount($children);
@@ -207,7 +207,7 @@ class Manager implements ICommentsManager {
if (empty($id)) {
return;
}
- $this->commentsCache[strval($id)] = $comment;
+ $this->commentsCache[(string)$id] = $comment;
}
/**
@@ -216,7 +216,7 @@ class Manager implements ICommentsManager {
* @param mixed $id the comment's id
*/
protected function uncache($id) {
- $id = strval($id);
+ $id = (string)$id;
if (isset($this->commentsCache[$id])) {
unset($this->commentsCache[$id]);
}
@@ -232,7 +232,7 @@ class Manager implements ICommentsManager {
* @since 9.0.0
*/
public function get($id) {
- if (intval($id) === 0) {
+ if ((int)$id === 0) {
throw new \InvalidArgumentException('IDs must be translatable to a number in this implementation.');
}
@@ -402,7 +402,7 @@ class Manager implements ICommentsManager {
$resultStatement = $query->execute();
$data = $resultStatement->fetch(\PDO::FETCH_NUM);
$resultStatement->closeCursor();
- return intval($data[0]);
+ return (int)$data[0];
}
/**
@@ -569,7 +569,7 @@ class Manager implements ICommentsManager {
->execute();
if ($affectedRows > 0) {
- $comment->setId(strval($qb->getLastInsertId()));
+ $comment->setId((string)$qb->getLastInsertId());
$this->sendEvent(CommentsEvent::EVENT_ADD, $comment);
}
diff --git a/lib/private/DB/Adapter.php b/lib/private/DB/Adapter.php
index 3123a1b0d53..e88e3cf09c6 100644
--- a/lib/private/DB/Adapter.php
+++ b/lib/private/DB/Adapter.php
@@ -108,7 +108,7 @@ class Adapter {
$query .= ' = ? AND ';
}
}
- $query = substr($query, 0, strlen($query) - 5);
+ $query = substr($query, 0, -5);
$query .= ' HAVING COUNT(*) = 0';
return $this->conn->executeUpdate($query, $inserts);
diff --git a/lib/private/DB/AdapterSqlite.php b/lib/private/DB/AdapterSqlite.php
index 5507699c54a..dbeec9ded43 100644
--- a/lib/private/DB/AdapterSqlite.php
+++ b/lib/private/DB/AdapterSqlite.php
@@ -79,7 +79,7 @@ class AdapterSqlite extends Adapter {
$query .= ' = ? AND ';
}
}
- $query = substr($query, 0, strlen($query) - 5);
+ $query = substr($query, 0, -5);
$query .= ')';
return $this->conn->executeUpdate($query, $inserts);
diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php
index 047ef1626df..fc0adbbd47b 100644
--- a/lib/private/Encryption/Util.php
+++ b/lib/private/Encryption/Util.php
@@ -384,7 +384,7 @@ class Util {
public function recoveryEnabled($uid) {
$enabled = $this->config->getUserValue($uid, 'encryption', 'recovery_enabled', '0');
- return ($enabled === '1') ? true : false;
+ return $enabled === '1';
}
/**
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index cf017c73960..428f52fd9ef 100644
--- a/lib/private/Files/Cache/Cache.php
+++ b/lib/private/Files/Cache/Cache.php
@@ -208,9 +208,8 @@ class Cache implements ICache {
return array_map(function (array $data) {
return self::cacheEntryFromData($data, $this->mimetypeLoader);;
}, $files);
- } else {
- return array();
}
+ return [];
}
/**
diff --git a/lib/private/Files/Cache/FailedCache.php b/lib/private/Files/Cache/FailedCache.php
index 932a5e5181a..b64d66dc697 100644
--- a/lib/private/Files/Cache/FailedCache.php
+++ b/lib/private/Files/Cache/FailedCache.php
@@ -71,15 +71,12 @@ class FailedCache implements ICache {
}
public function put($file, array $data) {
- return;
}
public function insert($file, array $data) {
- return;
}
public function update($id, array $data) {
- return;
}
public function getId($file) {
@@ -95,19 +92,15 @@ class FailedCache implements ICache {
}
public function remove($file) {
- return;
}
public function move($source, $target) {
- return;
}
public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
- return;
}
public function clear() {
- return;
}
public function getStatus($file) {
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php
index e00debe6903..304b2ccf464 100644
--- a/lib/private/Files/Node/Node.php
+++ b/lib/private/Files/Node/Node.php
@@ -118,7 +118,6 @@ class Node implements \OCP\Files\Node {
}
public function delete() {
- return;
}
/**
@@ -349,7 +348,6 @@ class Node implements \OCP\Files\Node {
}
public function getChecksum() {
- return;
}
/**
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php
index d443ccfd49b..e40a4830953 100644
--- a/lib/private/Files/Storage/Wrapper/Encryption.php
+++ b/lib/private/Files/Storage/Wrapper/Encryption.php
@@ -379,7 +379,7 @@ class Encryption extends Wrapper {
$shouldEncrypt = false;
$encryptionModule = null;
$header = $this->getHeader($path);
- $signed = (isset($header['signed']) && $header['signed'] === 'true') ? true : false;
+ $signed = isset($header['signed']) && $header['signed'] === 'true';
$fullPath = $this->getFullPath($path);
$encryptionModuleId = $this->util->getEncryptionModuleId($header);
@@ -544,7 +544,7 @@ class Encryption extends Wrapper {
return 0;
}
- $signed = (isset($header['signed']) && $header['signed'] === 'true') ? true : false;
+ $signed = isset($header['signed']) && $header['signed'] === 'true';
$unencryptedBlockSize = $encryptionModule->getUnencryptedBlockSize($signed);
// calculate last chunk nr
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 1553444e05d..3ab3ed89e6b 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -426,8 +426,7 @@ class View {
flush();
}
fclose($handle);
- $size = $this->filesize($path);
- return $size;
+ return $this->filesize($path);
}
return false;
}
@@ -476,8 +475,7 @@ class View {
echo fread($handle, $len);
flush();
}
- $size = ftell($handle) - $from;
- return $size;
+ return ftell($handle) - $from;
}
throw new \OCP\Files\UnseekableException('fseek error');
@@ -1083,8 +1081,7 @@ class View {
}
list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix);
if ($storage) {
- $result = $storage->hash($type, $internalPath, $raw);
- return $result;
+ return $storage->hash($type, $internalPath, $raw);
}
}
return null;
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php
index 8268be05d4b..a7ffb401b7b 100644
--- a/lib/private/L10N/Factory.php
+++ b/lib/private/L10N/Factory.php
@@ -407,7 +407,8 @@ class Factory implements IFactory {
$body .= ';';
$res = '';
$p = 0;
- for($i = 0; $i < strlen($body); $i++) {
+ $length = strlen($body);
+ for($i = 0; $i < $length; $i++) {
$ch = $body[$i];
switch ( $ch ) {
case '?':
diff --git a/lib/private/LargeFileHelper.php b/lib/private/LargeFileHelper.php
index 9f18a6acd6b..ea848f83622 100644
--- a/lib/private/LargeFileHelper.php
+++ b/lib/private/LargeFileHelper.php
@@ -50,7 +50,7 @@ class LargeFileHelper {
* PHP platform.
*/
public function __construct() {
- $pow_2_53 = floatval(self::POW_2_53_MINUS_1) + 1.0;
+ $pow_2_53 = (float)self::POW_2_53_MINUS_1 + 1.0;
if ($this->formatUnsignedInteger($pow_2_53) !== self::POW_2_53) {
throw new \RuntimeException(
'This class assumes floats to be double precision or "better".'
diff --git a/lib/private/Memcache/Redis.php b/lib/private/Memcache/Redis.php
index 9cc61114b00..adf3c5050bd 100644
--- a/lib/private/Memcache/Redis.php
+++ b/lib/private/Memcache/Redis.php
@@ -145,7 +145,7 @@ class Redis extends Cache implements IMemcacheTTL {
$result = self::$cache->multi()
->set($this->getNameSpace() . $key, $new)
->exec();
- return ($result === false) ? false : true;
+ return $result !== false;
}
self::$cache->unwatch();
return false;
@@ -164,7 +164,7 @@ class Redis extends Cache implements IMemcacheTTL {
$result = self::$cache->multi()
->del($this->getNameSpace() . $key)
->exec();
- return ($result === false) ? false : true;
+ return $result !== false;
}
self::$cache->unwatch();
return false;
diff --git a/lib/private/Route/CachingRouter.php b/lib/private/Route/CachingRouter.php
index 355f9e80c3f..cb1b98d77e6 100644
--- a/lib/private/Route/CachingRouter.php
+++ b/lib/private/Route/CachingRouter.php
@@ -52,7 +52,7 @@ class CachingRouter extends Router {
*/
public function generate($name, $parameters = array(), $absolute = false) {
asort($parameters);
- $key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . intval($absolute);
+ $key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . (int)$absolute;
$cachedKey = $this->cache->get($key);
if ($cachedKey) {
return $cachedKey;
diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php
index 90ad7de9b59..a213a5b3b9b 100644
--- a/lib/private/Security/CertificateManager.php
+++ b/lib/private/Security/CertificateManager.php
@@ -249,9 +249,7 @@ class CertificateManager implements ICertificateManager {
if ($uid === '') {
$uid = $this->uid;
}
- $path = is_null($uid) ? '/files_external/' : '/' . $uid . '/files_external/';
-
- return $path;
+ return is_null($uid) ? '/files_external/' : '/' . $uid . '/files_external/';
}
/**
diff --git a/lib/private/Server.php b/lib/private/Server.php
index c0fb96dce86..1f572280c7c 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -243,9 +243,7 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerService('SystemTagManagerFactory', function (Server $c) {
$config = $c->getConfig();
$factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory');
- /** @var \OC\SystemTag\ManagerFactory $factory */
- $factory = new $factoryClass($this);
- return $factory;
+ return new $factoryClass($this);
});
$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) {
return $c->query('SystemTagManagerFactory')->getManager();
diff --git a/lib/private/Settings/Admin/Sharing.php b/lib/private/Settings/Admin/Sharing.php
index a99ba453d67..dbdacf78dab 100644
--- a/lib/private/Settings/Admin/Sharing.php
+++ b/lib/private/Settings/Admin/Sharing.php
@@ -64,7 +64,7 @@ class Sharing implements ISettings {
'shareDefaultExpireDateSet' => $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no'),
'shareExpireAfterNDays' => $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'),
'shareEnforceExpireDate' => $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no'),
- 'shareExcludeGroups' => $this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes' ? true : false,
+ 'shareExcludeGroups' => $this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes',
'shareExcludedGroupsList' => $excludeGroupsList,
'publicShareDisclaimerText' => $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null),
'enableLinkPasswordByDefault' => $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'),
diff --git a/lib/private/Share/Helper.php b/lib/private/Share/Helper.php
index a1a56077d40..2eba67004dd 100644
--- a/lib/private/Share/Helper.php
+++ b/lib/private/Share/Helper.php
@@ -169,7 +169,7 @@ class Helper extends \OC\Share\Constants {
$enforceExpireDate = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no');
$defaultExpireSettings['defaultExpireDateSet'] = true;
$defaultExpireSettings['expireAfterDays'] = (int)($config->getAppValue('core', 'shareapi_expire_after_n_days', '7'));
- $defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes' ? true : false;
+ $defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes';
}
return $defaultExpireSettings;
diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php
index 8812399c812..35d84307548 100644
--- a/lib/private/Share/Share.php
+++ b/lib/private/Share/Share.php
@@ -1416,7 +1416,7 @@ class Share extends Constants {
*/
protected static function groupItems($items, $itemType) {
- $fileSharing = ($itemType === 'file' || $itemType === 'folder') ? true : false;
+ $fileSharing = $itemType === 'file' || $itemType === 'folder';
$result = array();
@@ -2070,7 +2070,7 @@ class Share extends Constants {
*/
public static function shareWithGroupMembersOnly() {
$value = \OC::$server->getConfig()->getAppValue('core', 'shareapi_only_share_with_group_members', 'no');
- return ($value === 'yes') ? true : false;
+ return $value === 'yes';
}
/**
@@ -2078,7 +2078,7 @@ class Share extends Constants {
*/
public static function isDefaultExpireDateEnabled() {
$defaultExpireDateEnabled = \OC::$server->getConfig()->getAppValue('core', 'shareapi_default_expire_date', 'no');
- return ($defaultExpireDateEnabled === "yes") ? true : false;
+ return $defaultExpireDateEnabled === 'yes';
}
/**
@@ -2119,7 +2119,7 @@ class Share extends Constants {
*/
public static function enforcePassword(IConfig $config) {
$enforcePassword = $config->getAppValue('core', 'shareapi_enforce_links_password', 'no');
- return ($enforcePassword === "yes") ? true : false;
+ return $enforcePassword === 'yes';
}
/**
diff --git a/lib/private/SubAdmin.php b/lib/private/SubAdmin.php
index d92c8d01605..cd16d07e43d 100644
--- a/lib/private/SubAdmin.php
+++ b/lib/private/SubAdmin.php
@@ -230,9 +230,7 @@ class SubAdmin extends PublicEmitter {
$isSubAdmin = $result->fetch();
$result->closeCursor();
- $result = $isSubAdmin === false ? false : true;
-
- return $result;
+ return $isSubAdmin !== false;
}
/**
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php
index 9f93ef784bc..ab52704d1e2 100644
--- a/lib/private/Template/JSConfigHelper.php
+++ b/lib/private/Template/JSConfigHelper.php
@@ -122,7 +122,7 @@ class JSConfigHelper {
$enableLinkPasswordByDefault = $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no');
- $enableLinkPasswordByDefault = ($enableLinkPasswordByDefault === 'yes') ? true : false;
+ $enableLinkPasswordByDefault = $enableLinkPasswordByDefault === 'yes';
$defaultExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes';
$defaultExpireDate = $enforceDefaultExpireDate = null;
if ($defaultExpireDateEnabled) {
@@ -220,8 +220,8 @@ class JSConfigHelper {
'enable_avatars' => true, // here for legacy reasons - to not crash existing code that relies on this value
'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null),
'modRewriteWorking' => ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'),
- 'sharing.maxAutocompleteResults' => intval($this->config->getSystemValue('sharing.maxAutocompleteResults', 0)),
- 'sharing.minSearchStringLength' => intval($this->config->getSystemValue('sharing.minSearchStringLength', 0)),
+ 'sharing.maxAutocompleteResults' => (int)$this->config->getSystemValue('sharing.maxAutocompleteResults', 0),
+ 'sharing.minSearchStringLength' => (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0),
'blacklist_files_regex' => \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX,
]),
"oc_appconfig" => json_encode([
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php
index 34319760c86..c2b58c37cdb 100644
--- a/lib/private/User/Session.php
+++ b/lib/private/User/Session.php
@@ -295,15 +295,15 @@ class Session implements IUserSession, Emitter {
public function getLoginName() {
if ($this->activeUser) {
return $this->session->get('loginname');
- } else {
- $uid = $this->session->get('user_id');
- if ($uid) {
- $this->activeUser = $this->manager->get($uid);
- return $this->session->get('loginname');
- } else {
- return null;
- }
}
+
+ $uid = $this->session->get('user_id');
+ if ($uid) {
+ $this->activeUser = $this->manager->get($uid);
+ return $this->session->get('loginname');
+ }
+
+ return null;
}
/**
@@ -369,10 +369,10 @@ class Session implements IUserSession, Emitter {
if($this->isLoggedIn()) {
$this->prepareUserLogin($firstTimeLogin, $regenerateSessionId);
return true;
- } else {
- $message = \OC::$server->getL10N('lib')->t('Login canceled by app');
- throw new LoginException($message);
}
+
+ $message = \OC::$server->getL10N('lib')->t('Login canceled by app');
+ throw new LoginException($message);
}
/**
diff --git a/lib/private/legacy/db.php b/lib/private/legacy/db.php
index 6e487e25ad5..7c556baeaeb 100644
--- a/lib/private/legacy/db.php
+++ b/lib/private/legacy/db.php
@@ -170,8 +170,7 @@ class OC_DB {
*/
public static function createDbFromStructure( $file ) {
$schemaManager = self::getMDB2SchemaManager();
- $result = $schemaManager->createDbFromStructure($file);
- return $result;
+ return $schemaManager->createDbFromStructure($file);
}
/**
diff --git a/lib/private/legacy/db/statementwrapper.php b/lib/private/legacy/db/statementwrapper.php
index 7c3c4776aa7..12774c894e8 100644
--- a/lib/private/legacy/db/statementwrapper.php
+++ b/lib/private/legacy/db/statementwrapper.php
@@ -77,8 +77,7 @@ class OC_DB_StatementWrapper {
return false;
}
if ($this->isManipulation) {
- $count = $this->statement->rowCount();
- return $count;
+ return $this->statement->rowCount();
} else {
return $this;
}
diff --git a/lib/private/legacy/files.php b/lib/private/legacy/files.php
index ba635d57627..24324bca095 100644
--- a/lib/private/legacy/files.php
+++ b/lib/private/legacy/files.php
@@ -148,7 +148,7 @@ class OC_Files {
self::lockFiles($view, $dir, $files);
$streamer->sendHeaders($name);
- $executionTime = intval(OC::$server->getIniWrapper()->getNumeric('max_execution_time'));
+ $executionTime = (int)OC::$server->getIniWrapper()->getNumeric('max_execution_time');
if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
@set_time_limit(0);
}
@@ -344,7 +344,7 @@ class OC_Files {
*/
public static function setUploadLimit($size, $files = []) {
//don't allow user to break his config
- $size = intval($size);
+ $size = (int)$size;
if ($size < self::UPLOAD_MIN_LIMIT_BYTES) {
return false;
}
diff --git a/lib/private/legacy/helper.php b/lib/private/legacy/helper.php
index e88e967a57b..cd69b40b76b 100644
--- a/lib/private/legacy/helper.php
+++ b/lib/private/legacy/helper.php
@@ -141,7 +141,7 @@ class OC_Helper {
public static function computerFileSize($str) {
$str = strtolower($str);
if (is_numeric($str)) {
- return floatval($str);
+ return (float)$str;
}
$bytes_array = array(
@@ -158,7 +158,7 @@ class OC_Helper {
'p' => 1024 * 1024 * 1024 * 1024 * 1024,
);
- $bytes = floatval($str);
+ $bytes = (float)$str;
if (preg_match('#([kmgtp]?b?)$#si', $str, $matches) && !empty($bytes_array[$matches[1]])) {
$bytes *= $bytes_array[$matches[1]];
diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php
index e3365ca455f..c5279bff6b8 100644
--- a/lib/private/legacy/template.php
+++ b/lib/private/legacy/template.php
@@ -132,7 +132,7 @@ class OC_Template extends \OC\Template\Base {
foreach(array_reverse($coreDependencies['vendor']) as $vendorLibrary) {
//remove trailing ".js" as addVendorScript will append it
OC_Util::addVendorScript(
- substr($vendorLibrary, 0, strlen($vendorLibrary) - 3),null,true);
+ substr($vendorLibrary, 0, -3),null,true);
}
} else {
throw new \Exception('Cannot read core/js/core.json');
diff --git a/lib/private/legacy/template/functions.php b/lib/private/legacy/template/functions.php
index 2cd439e9e6e..290ffe120a3 100644
--- a/lib/private/legacy/template/functions.php
+++ b/lib/private/legacy/template/functions.php
@@ -284,7 +284,7 @@ function human_file_size( $bytes ) {
function strip_time($timestamp){
$date = new \DateTime("@{$timestamp}");
$date->setTime(0, 0, 0);
- return intval($date->format('U'));
+ return (int)$date->format('U');
}
/**
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index 776a879e731..efa488b434d 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -301,7 +301,7 @@ class OC_Util {
*/
public static function isPublicLinkPasswordRequired() {
$enforcePassword = \OC::$server->getConfig()->getAppValue('core', 'shareapi_enforce_links_password', 'no');
- return ($enforcePassword === 'yes') ? true : false;
+ return $enforcePassword === 'yes';
}
/**
@@ -344,7 +344,7 @@ class OC_Util {
$enforceDefaultExpireDate = false;
if ($isDefaultExpireDateEnabled === 'yes') {
$value = \OC::$server->getConfig()->getAppValue('core', 'shareapi_enforce_expire_date', 'no');
- $enforceDefaultExpireDate = ($value === 'yes') ? true : false;
+ $enforceDefaultExpireDate = $value === 'yes';
}
return $enforceDefaultExpireDate;
diff --git a/lib/public/BackgroundJob.php b/lib/public/BackgroundJob.php
index d343ae2531c..9e37ff30145 100644
--- a/lib/public/BackgroundJob.php
+++ b/lib/public/BackgroundJob.php
@@ -25,67 +25,32 @@
*
*/
-/**
- * Public interface of ownCloud for background jobs.
- */
-
-// use OCP namespace for all classes that are considered public.
-// This means that they should be used by apps instead of the internal ownCloud classes
namespace OCP;
-
/**
- * This class provides functions to register backgroundjobs in ownCloud
- *
- * To create a new backgroundjob create a new class that inherits from either \OC\BackgroundJob\Job,
- * \OC\BackgroundJob\QueuedJob or \OC\BackgroundJob\TimedJob and register it using
- * \OCP\BackgroundJob->registerJob($job, $argument), $argument will be passed to the run() function
- * of the job when the job is executed.
- *
- * A regular Job will be executed every time cron.php is run, a QueuedJob will only run once and a TimedJob
- * will only run at a specific interval which is to be specified in the constructor of the job by calling
- * $this->setInterval($interval) with $interval in seconds.
* @since 4.5.0
+ * @deprecated 14.0.0
*/
class BackgroundJob {
/**
- * get the execution type of background jobs
- *
- * @return string
- *
- * This method returns the type how background jobs are executed. If the user
- * did not select something, the type is ajax.
* @since 5.0.0
+ * @deprecated 14.0.0
*/
public static function getExecutionType() {
- return \OC::$server->getConfig()->getAppValue('core', 'backgroundjobs_mode', 'ajax');
+ return '';
}
/**
- * sets the background jobs execution type
- *
- * @param string $type execution type
- * @return false|null
- *
- * This method sets the execution type of the background jobs. Possible types
- * are "none", "ajax", "webcron", "cron"
* @since 5.0.0
+ * @deprecated 14.0.0
*/
public static function setExecutionType($type) {
- if( !in_array( $type, array('none', 'ajax', 'webcron', 'cron'))) {
- return false;
- }
- \OC::$server->getConfig()->setAppValue('core', 'backgroundjobs_mode', $type);
}
/**
- * @param string $job
- * @param mixed $argument
- * @deprecated 8.1.0 Use \OC::$server->getJobList()->add() instead
* @since 6.0.0
+ * @deprecated 8.1.0 Use \OC::$server->getJobList()->add() instead
*/
public static function registerJob($job, $argument = null) {
- $jobList = \OC::$server->getJobList();
- $jobList->add($job, $argument);
}
}
diff --git a/lib/public/BackgroundJob/IJobList.php b/lib/public/BackgroundJob/IJobList.php
index c074e5c9d59..0a909411688 100644
--- a/lib/public/BackgroundJob/IJobList.php
+++ b/lib/public/BackgroundJob/IJobList.php
@@ -29,6 +29,19 @@ namespace OCP\BackgroundJob;
/**
* Interface IJobList
*
+ * This interface provides functions to register background jobs
+ *
+ * To create a new background job create a new class that inherits from either
+ * \OC\BackgroundJob\Job, \OC\BackgroundJob\QueuedJob or
+ * \OC\BackgroundJob\TimedJob and register it using ->add($job, $argument),
+ * $argument will be passed to the run() function of the job when the job is
+ * executed.
+ *
+ * A regular job will be executed every time cron.php is run, a QueuedJob will
+ * only run once and a TimedJob will only run at a specific interval which is to
+ * be specified in the constructor of the job by calling
+ * $this->setInterval($interval) with $interval in seconds.
+ *
* @package OCP\BackgroundJob
* @since 7.0.0
*/
diff --git a/lib/public/Collaboration/Collaborators/SearchResultType.php b/lib/public/Collaboration/Collaborators/SearchResultType.php
index e4ad888d6e4..e45b26e8dcc 100644
--- a/lib/public/Collaboration/Collaborators/SearchResultType.php
+++ b/lib/public/Collaboration/Collaborators/SearchResultType.php
@@ -58,7 +58,7 @@ class SearchResultType {
* @since 13.0.0
*/
protected function getValidatedType($type) {
- $type = trim(strval($type));
+ $type = trim((string)$type);
if($type === '') {
throw new \InvalidArgumentException('Type must not be empty');
diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php
index f2a92b52f6d..cd34edf567c 100644
--- a/settings/Controller/AppSettingsController.php
+++ b/settings/Controller/AppSettingsController.php
@@ -205,7 +205,7 @@ class AppSettingsController extends Controller {
$nextCloudVersionDependencies['nextcloud']['@attributes']['max-version'] = $nextCloudVersion->getMaximumVersion();
}
$phpVersion = $versionParser->getVersion($app['releases'][0]['rawPhpVersionSpec']);
- $existsLocally = (\OC_App::getAppPath($app['id']) !== false) ? true : false;
+ $existsLocally = \OC_App::getAppPath($app['id']) !== false;
$phpDependencies = [];
if($phpVersion->getMinimumVersion() !== '') {
$phpDependencies['php']['@attributes']['min-version'] = $phpVersion->getMinimumVersion();
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php
index af5aff8371d..c373cb0d521 100644
--- a/settings/Controller/UsersController.php
+++ b/settings/Controller/UsersController.php
@@ -723,9 +723,7 @@ class UsersController extends Controller {
protected function signMessage(IUser $user, $message) {
$privateKey = $this->keyManager->getKey($user)->getPrivate();
openssl_sign(json_encode($message), $signature, $privateKey, OPENSSL_ALGO_SHA512);
- $signatureBase64 = base64_encode($signature);
-
- return $signatureBase64;
+ return base64_encode($signature);
}
/**