summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-25 23:16:13 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-01-29 12:03:47 +0100
commiteb51f06a3b9e42686f462b9f7a56411d3fe6cb27 (patch)
tree0d96c86c4489b4e3fe60bcceaeb6759d856a36e9 /apps/files
parent1d8b90b8d3c8a85104d223b7f1d5693280370774 (diff)
downloadnextcloud-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 'apps/files')
-rw-r--r--apps/files/ajax/list.php10
-rw-r--r--apps/files/appinfo/app.php5
-rw-r--r--apps/files/lib/AppInfo/Application.php3
-rw-r--r--apps/files/lib/Helper.php2
4 files changed, 14 insertions, 6 deletions
diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php
index d91db8744c4..617ad18ac14 100644
--- a/apps/files/ajax/list.php
+++ b/apps/files/ajax/list.php
@@ -23,6 +23,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
+
+use OCP\Files\StorageNotAvailableException;
+use OCP\Files\StorageInvalidException;
+
OCP\JSON::checkLoggedIn();
\OC::$server->getSession()->close();
$l = \OC::$server->getL10N('files');
@@ -80,7 +84,7 @@ try {
\OCP\Util::logException('files', $e);
OCP\JSON::error([
'data' => [
- 'exception' => '\OCP\Files\StorageNotAvailableException',
+ 'exception' => StorageNotAvailableException::class,
'message' => $l->t('Storage is temporarily not available')
]
]);
@@ -88,7 +92,7 @@ try {
\OCP\Util::logException('files', $e);
OCP\JSON::error(array(
'data' => array(
- 'exception' => '\OCP\Files\StorageInvalidException',
+ 'exception' => StorageInvalidException::class,
'message' => $l->t('Storage invalid')
)
));
@@ -96,7 +100,7 @@ try {
\OCP\Util::logException('files', $e);
OCP\JSON::error(array(
'data' => array(
- 'exception' => '\Exception',
+ 'exception' => \Exception::class,
'message' => $l->t('Unknown error')
)
));
diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php
index b540c2e7682..fbe33fb54fe 100644
--- a/apps/files/appinfo/app.php
+++ b/apps/files/appinfo/app.php
@@ -24,11 +24,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
+
+use OC\Search\Provider\File;
+
// required for translation purpose
// t('Files')
$l = \OC::$server->getL10N('files');
-\OC::$server->getSearch()->registerProvider('OC\Search\Provider\File', array('apps' => array('files')));
+\OC::$server->getSearch()->registerProvider(File::class, array('apps' => array('files')));
$templateManager = \OC_Helper::getFileTemplateManager();
$templateManager->registerTemplate('text/html', 'core/templates/filetemplates/template.html');
diff --git a/apps/files/lib/AppInfo/Application.php b/apps/files/lib/AppInfo/Application.php
index e55d1c549a5..064f2baa987 100644
--- a/apps/files/lib/AppInfo/Application.php
+++ b/apps/files/lib/AppInfo/Application.php
@@ -31,6 +31,7 @@ use OCP\AppFramework\App;
use \OCA\Files\Service\TagService;
use \OCP\IContainer;
use OCA\Files\Controller\ViewController;
+use OCA\Files\Capabilities;
class Application extends App {
public function __construct(array $urlParams=array()) {
@@ -95,6 +96,6 @@ class Application extends App {
/*
* Register capabilities
*/
- $container->registerCapability('OCA\Files\Capabilities');
+ $container->registerCapability(Capabilities::class);
}
}
diff --git a/apps/files/lib/Helper.php b/apps/files/lib/Helper.php
index 9d9717c9401..3ea1504bc8a 100644
--- a/apps/files/lib/Helper.php
+++ b/apps/files/lib/Helper.php
@@ -261,7 +261,7 @@ class Helper {
} else if ($sortAttribute === 'size') {
$sortFunc = 'compareSize';
}
- usort($files, array('\OCA\Files\Helper', $sortFunc));
+ usort($files, array(Helper::class, $sortFunc));
if ($sortDescending) {
$files = array_reverse($files);
}