Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-26 01:16:13 +0300
committerMorris Jobke <hey@morrisjobke.de>2018-01-29 14:03:47 +0300
commiteb51f06a3b9e42686f462b9f7a56411d3fe6cb27 (patch)
tree0d96c86c4489b4e3fe60bcceaeb6759d856a36e9 /apps/files_sharing/lib
parent1d8b90b8d3c8a85104d223b7f1d5693280370774 (diff)
Use ::class statement instead of string
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/AppInfo/Application.php6
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php2
-rw-r--r--apps/files_sharing/lib/External/Manager.php3
-rw-r--r--apps/files_sharing/lib/Hooks.php2
-rw-r--r--apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php4
-rw-r--r--apps/files_sharing/lib/Updater.php2
6 files changed, 11 insertions, 8 deletions
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php
index fe2669640ca..e0c40730b31 100644
--- a/apps/files_sharing/lib/AppInfo/Application.php
+++ b/apps/files_sharing/lib/AppInfo/Application.php
@@ -41,6 +41,8 @@ use OCP\Defaults;
use OCP\Federation\ICloudIdManager;
use \OCP\IContainer;
use OCP\IServerContainer;
+use OCA\Files_Sharing\Capabilities;
+use OCA\Files_Sharing\External\Manager;
class Application extends App {
public function __construct(array $urlParams = array()) {
@@ -104,7 +106,7 @@ class Application extends App {
$uid
);
});
- $container->registerAlias('OCA\Files_Sharing\External\Manager', 'ExternalManager');
+ $container->registerAlias(Manager::class, 'ExternalManager');
/**
* Middleware
@@ -163,7 +165,7 @@ class Application extends App {
/*
* Register capabilities
*/
- $container->registerCapability('OCA\Files_Sharing\Capabilities');
+ $container->registerCapability(Capabilities::class);
}
public function registerMountProviders() {
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index fdd69987658..eff6cf65142 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -244,7 +244,7 @@ class ShareController extends Controller {
$exception = $e;
}
}
- \OC_Hook::emit('OCP\Share', 'share_link_access', [
+ \OC_Hook::emit(Share::class, 'share_link_access', [
'itemType' => $itemType,
'itemSource' => $itemSource,
'uidOwner' => $uidOwner,
diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php
index 6935685685c..c9303ac224c 100644
--- a/apps/files_sharing/lib/External/Manager.php
+++ b/apps/files_sharing/lib/External/Manager.php
@@ -39,6 +39,7 @@ use OCP\Http\Client\IClientService;
use OCP\IDBConnection;
use OCP\Notification\IManager;
use OCP\OCS\IDiscoveryService;
+use OCP\Share;
class Manager {
const STORAGE = '\OCA\Files_Sharing\External\Storage';
@@ -217,7 +218,7 @@ class Manager {
$updated = $acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid));
if ($updated === true) {
$this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'accept');
- \OC_Hook::emit('OCP\Share', 'federated_share_added', ['server' => $share['remote']]);
+ \OC_Hook::emit(Share::class, 'federated_share_added', ['server' => $share['remote']]);
$result = true;
}
}
diff --git a/apps/files_sharing/lib/Hooks.php b/apps/files_sharing/lib/Hooks.php
index 97b1079f1eb..51511ca6b64 100644
--- a/apps/files_sharing/lib/Hooks.php
+++ b/apps/files_sharing/lib/Hooks.php
@@ -53,7 +53,7 @@ class Hooks {
$mountManager = \OC\Files\Filesystem::getMountManager();
$mountedShares = $mountManager->findIn($path);
foreach ($mountedShares as $mount) {
- if ($mount->getStorage()->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) {
+ if ($mount->getStorage()->instanceOfStorage(ISharedStorage::class)) {
$mountPoint = $mount->getMountPoint();
$view->unlink($mountPoint);
}
diff --git a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php
index c96b559daf5..4b630d0a8da 100644
--- a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php
+++ b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php
@@ -121,11 +121,11 @@ class SharingCheckMiddleware extends Middleware {
* @throws \Exception
*/
public function afterException($controller, $methodName, \Exception $exception) {
- if(is_a($exception, '\OCP\Files\NotFoundException')) {
+ if(is_a($exception, NotFoundException::class)) {
return new NotFoundResponse();
}
- if (is_a($exception, '\OCA\Files_Sharing\Exceptions\S2SException')) {
+ if (is_a($exception, S2SException::class)) {
return new JSONResponse($exception->getMessage(), 405);
}
diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php
index de45b45ab37..784fe8b72b1 100644
--- a/apps/files_sharing/lib/Updater.php
+++ b/apps/files_sharing/lib/Updater.php
@@ -96,7 +96,7 @@ class Updater {
$mountManager = \OC\Files\Filesystem::getMountManager();
$mountedShares = $mountManager->findIn('/' . \OCP\User::getUser() . '/files/' . $oldPath);
foreach ($mountedShares as $mount) {
- if ($mount->getStorage()->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) {
+ if ($mount->getStorage()->instanceOfStorage(ISharedStorage::class)) {
$mountPoint = $mount->getMountPoint();
$target = str_replace($absOldPath, $absNewPath, $mountPoint);
$mount->moveMount($target);