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/private/Share20 | |
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/private/Share20')
-rw-r--r-- | lib/private/Share20/LegacyHooks.php | 11 | ||||
-rw-r--r-- | lib/private/Share20/Manager.php | 7 |
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/private/Share20/LegacyHooks.php b/lib/private/Share20/LegacyHooks.php index 77db4c5d0e0..c3a4e9d999d 100644 --- a/lib/private/Share20/LegacyHooks.php +++ b/lib/private/Share20/LegacyHooks.php @@ -27,6 +27,7 @@ use OCP\Files\File; use OCP\Share\IShare; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\GenericEvent; +use OCP\Share; class LegacyHooks { /** @var EventDispatcher */ @@ -55,7 +56,7 @@ class LegacyHooks { $share = $e->getSubject(); $formatted = $this->formatHookParams($share); - \OC_Hook::emit('OCP\Share', 'pre_unshare', $formatted); + \OC_Hook::emit(Share::class, 'pre_unshare', $formatted); } /** @@ -76,7 +77,7 @@ class LegacyHooks { $formatted['deletedShares'] = $formattedDeletedShares; - \OC_Hook::emit('OCP\Share', 'post_unshare', $formatted); + \OC_Hook::emit(Share::class, 'post_unshare', $formatted); } /** @@ -90,7 +91,7 @@ class LegacyHooks { $formatted['itemTarget'] = $formatted['fileTarget']; $formatted['unsharedItems'] = [$formatted]; - \OC_Hook::emit('OCP\Share', 'post_unshareFromSelf', $formatted); + \OC_Hook::emit(Share::class, 'post_unshareFromSelf', $formatted); } private function formatHookParams(IShare $share) { @@ -138,7 +139,7 @@ class LegacyHooks { 'run' => &$run, 'error' => &$error, ]; - \OC_Hook::emit('OCP\Share', 'pre_shared', $preHookData); + \OC_Hook::emit(Share::class, 'pre_shared', $preHookData); if ($run === false) { $e->setArgument('error', $error); @@ -167,7 +168,7 @@ class LegacyHooks { 'fileTarget' => $share->getTarget(), ]; - \OC_Hook::emit('OCP\Share', 'post_shared', $postHookData); + \OC_Hook::emit(Share::class, 'post_shared', $postHookData); } } diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 48c70606835..0ae96f29ded 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -64,6 +64,7 @@ use OCP\Share\IProviderFactory; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\GenericEvent; use OCP\Share\IShareProvider; +use OCP\Share; /** * This class is the communication hub for all sharing related operations. @@ -838,7 +839,7 @@ class Manager implements IManager { } if ($expirationDateUpdated === true) { - \OC_Hook::emit('OCP\Share', 'post_set_expiration_date', [ + \OC_Hook::emit(Share::class, 'post_set_expiration_date', [ 'itemType' => $share->getNode() instanceof \OCP\Files\File ? 'file' : 'folder', 'itemSource' => $share->getNode()->getId(), 'date' => $share->getExpirationDate(), @@ -847,7 +848,7 @@ class Manager implements IManager { } if ($share->getPassword() !== $originalShare->getPassword()) { - \OC_Hook::emit('OCP\Share', 'post_update_password', [ + \OC_Hook::emit(Share::class, 'post_update_password', [ 'itemType' => $share->getNode() instanceof \OCP\Files\File ? 'file' : 'folder', 'itemSource' => $share->getNode()->getId(), 'uidOwner' => $share->getSharedBy(), @@ -862,7 +863,7 @@ class Manager implements IManager { } else { $userFolder = $this->rootFolder->getUserFolder($share->getSharedBy()); } - \OC_Hook::emit('OCP\Share', 'post_update_permissions', array( + \OC_Hook::emit(Share::class, 'post_update_permissions', array( 'itemType' => $share->getNode() instanceof \OCP\Files\File ? 'file' : 'folder', 'itemSource' => $share->getNode()->getId(), 'shareType' => $share->getShareType(), |