aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/dropbox.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2012-11-30 16:27:11 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2012-11-30 16:27:11 +0100
commit92df70b6e5c4cba373cf0b24af02c328881cdd2d (patch)
treecaa914884d58cb9118330c3823c4525c7dfd65cf /apps/files_external/lib/dropbox.php
parentdf21ebeaf73bed10e972af6ef09f2bfb0df68e1c (diff)
downloadnextcloud-server-92df70b6e5c4cba373cf0b24af02c328881cdd2d.tar.gz
nextcloud-server-92df70b6e5c4cba373cf0b24af02c328881cdd2d.zip
fix checkstyle for files_external app, add whitespace for readability
Diffstat (limited to 'apps/files_external/lib/dropbox.php')
-rwxr-xr-xapps/files_external/lib/dropbox.php35
1 files changed, 24 insertions, 11 deletions
diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php
index c8220832702..33ca14cab15 100755
--- a/apps/files_external/lib/dropbox.php
+++ b/apps/files_external/lib/dropbox.php
@@ -31,7 +31,12 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common {
private static $tempFiles = array();
public function __construct($params) {
- if (isset($params['configured']) && $params['configured'] == 'true' && isset($params['app_key']) && isset($params['app_secret']) && isset($params['token']) && isset($params['token_secret'])) {
+ if (isset($params['configured']) && $params['configured'] == 'true'
+ && isset($params['app_key'])
+ && isset($params['app_secret'])
+ && isset($params['token'])
+ && isset($params['token_secret'])
+ ) {
$this->root=isset($params['root'])?$params['root']:'';
$oauth = new Dropbox_OAuth_Curl($params['app_key'], $params['app_secret']);
$oauth->setToken($params['token'], $params['token_secret']);
@@ -44,7 +49,7 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common {
private function getMetaData($path, $list = false) {
$path = $this->root.$path;
- if (!$list && isset($this->metaData[$path])) {
+ if ( ! $list && isset($this->metaData[$path])) {
return $this->metaData[$path];
} else {
if ($list) {
@@ -95,7 +100,8 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common {
}
public function opendir($path) {
- if ($contents = $this->getMetaData($path, true)) {
+ $contents = $this->getMetaData($path, true);
+ if ($contents) {
$files = array();
foreach ($contents as $file) {
$files[] = basename($file['path']);
@@ -107,7 +113,8 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common {
}
public function stat($path) {
- if ($metaData = $this->getMetaData($path)) {
+ $metaData = $this->getMetaData($path);
+ if ($metaData) {
$stat['size'] = $metaData['bytes'];
$stat['atime'] = time();
$stat['mtime'] = (isset($metaData['modified'])) ? strtotime($metaData['modified']) : time();
@@ -120,11 +127,14 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common {
public function filetype($path) {
if ($path == '' || $path == '/') {
return 'dir';
- } else if ($metaData = $this->getMetaData($path)) {
- if ($metaData['is_dir'] == 'true') {
- return 'dir';
- } else {
- return 'file';
+ } else {
+ $metaData = $this->getMetaData($path);
+ if ($metaData) {
+ if ($metaData['is_dir'] == 'true') {
+ return 'dir';
+ } else {
+ return 'file';
+ }
}
}
return false;
@@ -241,8 +251,11 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common {
public function getMimeType($path) {
if ($this->filetype($path) == 'dir') {
return 'httpd/unix-directory';
- } else if ($metaData = $this->getMetaData($path)) {
- return $metaData['mime_type'];
+ } else {
+ $metaData = $this->getMetaData($path);
+ if ($metaData) {
+ return $metaData['mime_type'];
+ }
}
return false;
}