diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-25 23:16:13 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-01-29 12:03:47 +0100 |
commit | eb51f06a3b9e42686f462b9f7a56411d3fe6cb27 (patch) | |
tree | 0d96c86c4489b4e3fe60bcceaeb6759d856a36e9 /lib/base.php | |
parent | 1d8b90b8d3c8a85104d223b7f1d5693280370774 (diff) | |
download | nextcloud-server-eb51f06a3b9e42686f462b9f7a56411d3fe6cb27.tar.gz nextcloud-server-eb51f06a3b9e42686f462b9f7a56411d3fe6cb27.zip |
Use ::class statement instead of string
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/base.php b/lib/base.php index fdebe283b9c..444c0df7e9e 100644 --- a/lib/base.php +++ b/lib/base.php @@ -54,6 +54,12 @@ * */ +use OC\Settings\RemoveOrphaned; +use OCP\Share; +use OC\Encryption\HookManager; +use OC\Files\Filesystem; +use OC\Share20\Hooks; + require_once 'public/Constants.php'; /** @@ -836,7 +842,7 @@ class OC { $dispatcher->addListener(OCP\App\ManagerEvent::EVENT_APP_UPDATE, function($event) { /** @var \OCP\App\ManagerEvent $event */ $jobList = \OC::$server->getJobList(); - $job = 'OC\\Settings\\RemoveOrphaned'; + $job = RemoveOrphaned::class; if(!$jobList->has($job, null)) { $jobList->add($job); } @@ -851,10 +857,10 @@ class OC { private static function registerEncryptionHooks() { $enabled = self::$server->getEncryptionManager()->isEnabled(); if ($enabled) { - \OCP\Util::connectHook('OCP\Share', 'post_shared', 'OC\Encryption\HookManager', 'postShared'); - \OCP\Util::connectHook('OCP\Share', 'post_unshare', 'OC\Encryption\HookManager', 'postUnshared'); - \OCP\Util::connectHook('OC_Filesystem', 'post_rename', 'OC\Encryption\HookManager', 'postRename'); - \OCP\Util::connectHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', 'OC\Encryption\HookManager', 'postRestore'); + \OCP\Util::connectHook(Share::class, 'post_shared', HookManager::class, 'postShared'); + \OCP\Util::connectHook(Share::class, 'post_unshare', HookManager::class, 'postUnshared'); + \OCP\Util::connectHook('OC_Filesystem', 'post_rename', HookManager::class, 'postRename'); + \OCP\Util::connectHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', HookManager::class, 'postRestore'); } } @@ -868,8 +874,8 @@ class OC { */ public static function registerFilesystemHooks() { // Check for blacklisted files - OC_Hook::connect('OC_Filesystem', 'write', 'OC\Files\Filesystem', 'isBlacklisted'); - OC_Hook::connect('OC_Filesystem', 'rename', 'OC\Files\Filesystem', 'isBlacklisted'); + OC_Hook::connect('OC_Filesystem', 'write', Filesystem::class, 'isBlacklisted'); + OC_Hook::connect('OC_Filesystem', 'rename', Filesystem::class, 'isBlacklisted'); } /** @@ -877,9 +883,9 @@ class OC { */ public static function registerShareHooks() { if (\OC::$server->getSystemConfig()->getValue('installed')) { - OC_Hook::connect('OC_User', 'post_deleteUser', 'OC\Share20\Hooks', 'post_deleteUser'); - OC_Hook::connect('OC_User', 'post_removeFromGroup', 'OC\Share20\Hooks', 'post_removeFromGroup'); - OC_Hook::connect('OC_User', 'post_deleteGroup', 'OC\Share20\Hooks', 'post_deleteGroup'); + OC_Hook::connect('OC_User', 'post_deleteUser', Hooks::class, 'post_deleteUser'); + OC_Hook::connect('OC_User', 'post_removeFromGroup', Hooks::class, 'post_removeFromGroup'); + OC_Hook::connect('OC_User', 'post_deleteGroup', Hooks::class, 'post_deleteGroup'); } } |