aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 09:30:18 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 16:34:56 +0100
commitb80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch)
treeec20e0ffa2f86b9b54939a83a785407319f94559 /apps/files_external
parent62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff)
downloadnextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.tar.gz
nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.zip
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/ajax/applicable.php2
-rw-r--r--apps/files_external/lib/Controller/AjaxController.php6
-rw-r--r--apps/files_external/lib/Controller/ApiController.php4
-rw-r--r--apps/files_external/lib/Controller/GlobalStoragesController.php2
-rw-r--r--apps/files_external/lib/Controller/UserGlobalStoragesController.php6
-rw-r--r--apps/files_external/lib/Controller/UserStoragesController.php2
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php28
-rw-r--r--apps/files_external/lib/Lib/Storage/FTP.php4
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTP.php12
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php2
-rw-r--r--apps/files_external/lib/Lib/Storage/Swift.php4
-rw-r--r--apps/files_external/lib/config.php8
-rw-r--r--apps/files_external/tests/Controller/StoragesControllerTest.php26
-rw-r--r--apps/files_external/tests/Controller/UserStoragesControllerTest.php4
-rw-r--r--apps/files_external/tests/OwnCloudFunctionsTest.php68
-rw-r--r--apps/files_external/tests/Service/StoragesServiceTest.php12
-rw-r--r--apps/files_external/tests/Storage/FtpTest.php4
-rw-r--r--apps/files_external/tests/Storage/SmbTest.php2
-rw-r--r--apps/files_external/tests/config.php36
19 files changed, 116 insertions, 116 deletions
diff --git a/apps/files_external/ajax/applicable.php b/apps/files_external/ajax/applicable.php
index 0a6b9f5af46..bda2c919596 100644
--- a/apps/files_external/ajax/applicable.php
+++ b/apps/files_external/ajax/applicable.php
@@ -51,6 +51,6 @@ foreach (\OC::$server->getUserManager()->searchDisplayName($pattern, $limit, $of
$users[$user->getUID()] = $user->getDisplayName();
}
-$results = array('groups' => $groups, 'users' => $users);
+$results = ['groups' => $groups, 'users' => $users];
\OC_JSON::success($results);
diff --git a/apps/files_external/lib/Controller/AjaxController.php b/apps/files_external/lib/Controller/AjaxController.php
index 347fa02e1b0..b9e414a410a 100644
--- a/apps/files_external/lib/Controller/AjaxController.php
+++ b/apps/files_external/lib/Controller/AjaxController.php
@@ -88,12 +88,12 @@ class AjaxController extends Controller {
public function getSshKeys($keyLength = 1024) {
$key = $this->generateSshKeys($keyLength);
return new JSONResponse(
- array('data' => array(
+ ['data' => [
'private_key' => $key['privatekey'],
'public_key' => $key['publickey']
- ),
+ ],
'status' => 'success'
- ));
+ ]);
}
/**
diff --git a/apps/files_external/lib/Controller/ApiController.php b/apps/files_external/lib/Controller/ApiController.php
index 1882ea31504..aa0c8ddb6a1 100644
--- a/apps/files_external/lib/Controller/ApiController.php
+++ b/apps/files_external/lib/Controller/ApiController.php
@@ -74,7 +74,7 @@ class ApiController extends OCSController {
$permissions |= \OCP\Constants::PERMISSION_DELETE;
}
- $entry = array(
+ $entry = [
'name' => basename($mountPoint),
'path' => $path,
'type' => 'dir',
@@ -83,7 +83,7 @@ class ApiController extends OCSController {
'permissions' => $permissions,
'id' => $mountConfig['id'],
'class' => $mountConfig['class']
- );
+ ];
return $entry;
}
diff --git a/apps/files_external/lib/Controller/GlobalStoragesController.php b/apps/files_external/lib/Controller/GlobalStoragesController.php
index c8fc4b00ef8..a3c9fbb284c 100644
--- a/apps/files_external/lib/Controller/GlobalStoragesController.php
+++ b/apps/files_external/lib/Controller/GlobalStoragesController.php
@@ -171,7 +171,7 @@ class GlobalStoragesController extends StoragesController {
} catch (NotFoundException $e) {
return new DataResponse(
[
- 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+ 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
],
Http::STATUS_NOT_FOUND
);
diff --git a/apps/files_external/lib/Controller/UserGlobalStoragesController.php b/apps/files_external/lib/Controller/UserGlobalStoragesController.php
index 8e0dac5a898..a3a258c599a 100644
--- a/apps/files_external/lib/Controller/UserGlobalStoragesController.php
+++ b/apps/files_external/lib/Controller/UserGlobalStoragesController.php
@@ -124,7 +124,7 @@ class UserGlobalStoragesController extends StoragesController {
} catch (NotFoundException $e) {
return new DataResponse(
[
- 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+ 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
],
Http::STATUS_NOT_FOUND
);
@@ -164,7 +164,7 @@ class UserGlobalStoragesController extends StoragesController {
} else {
return new DataResponse(
[
- 'message' => (string)$this->l10n->t('Storage with ID "%d" is not user editable', array($id))
+ 'message' => (string)$this->l10n->t('Storage with ID "%d" is not user editable', [$id])
],
Http::STATUS_FORBIDDEN
);
@@ -172,7 +172,7 @@ class UserGlobalStoragesController extends StoragesController {
} catch (NotFoundException $e) {
return new DataResponse(
[
- 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+ 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
],
Http::STATUS_NOT_FOUND
);
diff --git a/apps/files_external/lib/Controller/UserStoragesController.php b/apps/files_external/lib/Controller/UserStoragesController.php
index 46285c4758a..df42198aeb3 100644
--- a/apps/files_external/lib/Controller/UserStoragesController.php
+++ b/apps/files_external/lib/Controller/UserStoragesController.php
@@ -199,7 +199,7 @@ class UserStoragesController extends StoragesController {
} catch (NotFoundException $e) {
return new DataResponse(
[
- 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+ 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
],
Http::STATUS_NOT_FOUND
);
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index 60e39a4d300..0d7cbacd8b5 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -128,10 +128,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
private function headObject($key) {
if (!isset($this->objectCache[$key])) {
try {
- $this->objectCache[$key] = $this->getConnection()->headObject(array(
+ $this->objectCache[$key] = $this->getConnection()->headObject([
'Bucket' => $this->bucket,
'Key' => $key
- ));
+ ]);
} catch (S3Exception $e) {
if ($e->getStatusCode() >= 500) {
throw $e;
@@ -191,7 +191,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
$stmt = \OC::$server->getDatabaseConnection()->prepare(
'SELECT `numeric_id`, `id` FROM `*PREFIX*storages` WHERE `id` IN (?, ?)'
);
- $stmt->execute(array($oldId, $this->id));
+ $stmt->execute([$oldId, $this->id]);
while ($row = $stmt->fetch()) {
$storages[$row['id']] = $row['numeric_id'];
}
@@ -204,7 +204,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
$stmt = \OC::$server->getDatabaseConnection()->prepare(
'UPDATE `*PREFIX*storages` SET `id` = ? WHERE `id` = ?'
);
- $stmt->execute(array($this->id, $oldId));
+ $stmt->execute([$this->id, $oldId]);
}
// only the bucket based id may exist, do nothing
}
@@ -235,12 +235,12 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
try {
- $this->getConnection()->putObject(array(
+ $this->getConnection()->putObject([
'Bucket' => $this->bucket,
'Key' => $path . '/',
'Body' => '',
'ContentType' => 'httpd/unix-directory'
- ));
+ ]);
$this->testTimeout();
} catch (S3Exception $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files_external']);
@@ -284,9 +284,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
private function batchDelete($path = null) {
- $params = array(
+ $params = [
'Bucket' => $this->bucket
- );
+ ];
if ($path !== null) {
$params['Prefix'] = $path . '/';
}
@@ -326,7 +326,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
try {
- $files = array();
+ $files = [];
$results = $this->getConnection()->getPaginator('ListObjects', [
'Bucket' => $this->bucket,
'Delimiter' => '/',
@@ -550,7 +550,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
public function touch($path, $mtime = null) {
$path = $this->normalizePath($path);
- $metadata = array();
+ $metadata = [];
if (is_null($mtime)) {
$mtime = time();
}
@@ -599,11 +599,11 @@ class AmazonS3 extends \OC\Files\Storage\Common {
if ($this->is_file($path1)) {
try {
- $this->getConnection()->copyObject(array(
+ $this->getConnection()->copyObject([
'Bucket' => $this->bucket,
'Key' => $this->cleanKey($path2),
'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1)
- ));
+ ]);
$this->testTimeout();
} catch (S3Exception $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files_external']);
@@ -613,11 +613,11 @@ class AmazonS3 extends \OC\Files\Storage\Common {
$this->remove($path2);
try {
- $this->getConnection()->copyObject(array(
+ $this->getConnection()->copyObject([
'Bucket' => $this->bucket,
'Key' => $path2 . '/',
'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1 . '/')
- ));
+ ]);
$this->testTimeout();
} catch (S3Exception $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files_external']);
diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php
index 8f014ce921c..adf7f29a3d6 100644
--- a/apps/files_external/lib/Lib/Storage/FTP.php
+++ b/apps/files_external/lib/Lib/Storage/FTP.php
@@ -109,7 +109,7 @@ class FTP extends StreamWrapper{
case 'a':
case 'ab':
//these are supported by the wrapper
- $context = stream_context_create(array('ftp' => array('overwrite' => true)));
+ $context = stream_context_create(['ftp' => ['overwrite' => true]]);
$handle = fopen($this->constructUrl($path), $mode, false, $context);
return RetryWrapper::wrap($handle);
case 'r+':
@@ -150,7 +150,7 @@ class FTP extends StreamWrapper{
if (function_exists('ftp_login')) {
return true;
} else {
- return array('ftp');
+ return ['ftp'];
}
}
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php
index 5d83bf253e4..eaead3eea45 100644
--- a/apps/files_external/lib/Lib/Storage/SFTP.php
+++ b/apps/files_external/lib/Lib/Storage/SFTP.php
@@ -251,8 +251,8 @@ class SFTP extends \OC\Files\Storage\Common {
try {
$keyPath = $this->hostKeysPath();
if (file_exists($keyPath)) {
- $hosts = array();
- $keys = array();
+ $hosts = [];
+ $keys = [];
$lines = file($keyPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if ($lines) {
foreach ($lines as $line) {
@@ -267,7 +267,7 @@ class SFTP extends \OC\Files\Storage\Common {
}
} catch (\Exception $e) {
}
- return array();
+ return [];
}
/**
@@ -307,7 +307,7 @@ class SFTP extends \OC\Files\Storage\Common {
}
$id = md5('sftp:' . $path);
- $dirStream = array();
+ $dirStream = [];
foreach($list as $file) {
if ($file !== '.' && $file !== '..') {
$dirStream[] = $file;
@@ -391,7 +391,7 @@ class SFTP extends \OC\Files\Storage\Common {
case 'x+':
case 'c':
case 'c+':
- $context = stream_context_create(array('sftp' => array('session' => $this->getConnection())));
+ $context = stream_context_create(['sftp' => ['session' => $this->getConnection()]]);
$handle = fopen($this->constructUrl($path), $mode, false, $context);
return RetryWrapper::wrap($handle);
}
@@ -464,7 +464,7 @@ class SFTP extends \OC\Files\Storage\Common {
$mtime = $stat ? $stat['mtime'] : -1;
$size = $stat ? $stat['size'] : 0;
- return array('mtime' => $mtime, 'size' => $size, 'ctime' => -1);
+ return ['mtime' => $mtime, 'size' => $size, 'ctime' => -1];
} catch (\Exception $e) {
return false;
}
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index 6cf7bb7db85..8f7d594cd67 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -472,7 +472,7 @@ class SMB extends Common implements INotifyStorage {
}
try {
- $this->statCache = array();
+ $this->statCache = [];
$content = $this->share->dir($this->buildPath($path));
foreach ($content as $file) {
if ($file->isDirectory()) {
diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php
index 0072f91d4ed..daa222def04 100644
--- a/apps/files_external/lib/Lib/Storage/Swift.php
+++ b/apps/files_external/lib/Lib/Storage/Swift.php
@@ -351,7 +351,7 @@ class Swift extends \OC\Files\Storage\Common {
$mtime = floor($mtime);
}
- $stat = array();
+ $stat = [];
$stat['size'] = (int)$object->contentLength;
$stat['mtime'] = $mtime;
$stat['atime'] = time();
@@ -602,7 +602,7 @@ class Swift extends \OC\Files\Storage\Common {
}
$path = $this->normalizePath($path);
$dh = $this->opendir($path);
- $content = array();
+ $content = [];
while (($file = readdir($dh)) !== false) {
$content[] = $file;
}
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index f799fd25f57..a65b3b3a9c2 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -96,7 +96,7 @@ class OC_Mount_Config {
* @deprecated 8.2.0 use UserGlobalStoragesService::getStorages() and UserStoragesService::getStorages()
*/
public static function getAbsoluteMountPoints($uid) {
- $mountPoints = array();
+ $mountPoints = [];
$userGlobalStoragesService = self::$app->getContainer()->query(UserGlobalStoragesService::class);
$userStoragesService = self::$app->getContainer()->query(UserStoragesService::class);
@@ -296,7 +296,7 @@ class OC_Mount_Config {
return $mountPoints;
}
}
- return array();
+ return [];
}
/**
@@ -430,14 +430,14 @@ class OC_Mount_Config {
*/
public static function makeConfigHash($config) {
$data = json_encode(
- array(
+ [
'c' => $config['backend'],
'a' => $config['authMechanism'],
'm' => $config['mountpoint'],
'o' => $config['options'],
'p' => isset($config['priority']) ? $config['priority'] : -1,
'mo' => isset($config['mountOptions']) ? $config['mountOptions'] : [],
- )
+ ]
);
return hash('md5', $data);
}
diff --git a/apps/files_external/tests/Controller/StoragesControllerTest.php b/apps/files_external/tests/Controller/StoragesControllerTest.php
index 3ecf47419b5..56311a7be4c 100644
--- a/apps/files_external/tests/Controller/StoragesControllerTest.php
+++ b/apps/files_external/tests/Controller/StoragesControllerTest.php
@@ -117,7 +117,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -159,7 +159,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -172,11 +172,11 @@ abstract class StoragesControllerTest extends \Test\TestCase {
}
function mountPointNamesProvider() {
- return array(
- array(''),
- array('/'),
- array('//'),
- );
+ return [
+ [''],
+ ['/'],
+ ['//'],
+ ];
}
/**
@@ -201,7 +201,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
$mountPoint,
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -215,7 +215,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
$mountPoint,
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -238,7 +238,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OC\Files\Storage\InvalidStorage',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -252,7 +252,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OC\Files\Storage\InvalidStorage',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -292,7 +292,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
@@ -388,7 +388,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
diff --git a/apps/files_external/tests/Controller/UserStoragesControllerTest.php b/apps/files_external/tests/Controller/UserStoragesControllerTest.php
index 7d8f60380c6..5f82121cf7a 100644
--- a/apps/files_external/tests/Controller/UserStoragesControllerTest.php
+++ b/apps/files_external/tests/Controller/UserStoragesControllerTest.php
@@ -86,7 +86,7 @@ class UserStoragesControllerTest extends StoragesControllerTest {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\Auth\Mechanism',
- array(),
+ [],
[],
[],
[],
@@ -100,7 +100,7 @@ class UserStoragesControllerTest extends StoragesControllerTest {
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\Auth\Mechanism',
- array(),
+ [],
[],
[],
[],
diff --git a/apps/files_external/tests/OwnCloudFunctionsTest.php b/apps/files_external/tests/OwnCloudFunctionsTest.php
index d87288edb10..060f8c61a44 100644
--- a/apps/files_external/tests/OwnCloudFunctionsTest.php
+++ b/apps/files_external/tests/OwnCloudFunctionsTest.php
@@ -36,72 +36,72 @@ namespace OCA\Files_External\Tests;
class OwnCloudFunctionsTest extends \Test\TestCase {
function configUrlProvider() {
- return array(
- array(
- array(
+ return [
+ [
+ [
'host' => 'testhost',
'root' => 'testroot',
'secure' => false
- ),
+ ],
'http://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'testhost',
'root' => 'testroot',
'secure' => true
- ),
+ ],
'https://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'http://testhost',
'root' => 'testroot',
'secure' => false
- ),
+ ],
'http://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'https://testhost',
'root' => 'testroot',
'secure' => false
- ),
+ ],
'https://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'https://testhost/testroot',
'root' => '',
'secure' => false
- ),
+ ],
'https://testhost/testroot/remote.php/webdav/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'https://testhost/testroot',
'root' => 'subdir',
'secure' => false
- ),
+ ],
'https://testhost/testroot/remote.php/webdav/subdir/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'http://testhost/testroot',
'root' => 'subdir',
'secure' => true
- ),
+ ],
'http://testhost/testroot/remote.php/webdav/subdir/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'http://testhost/testroot/',
'root' => '/subdir',
'secure' => false
- ),
+ ],
'http://testhost/testroot/remote.php/webdav/subdir/',
- ),
- );
+ ],
+ ];
}
/**
diff --git a/apps/files_external/tests/Service/StoragesServiceTest.php b/apps/files_external/tests/Service/StoragesServiceTest.php
index 9d3a44042e0..dd35ee8f92c 100644
--- a/apps/files_external/tests/Service/StoragesServiceTest.php
+++ b/apps/files_external/tests/Service/StoragesServiceTest.php
@@ -95,7 +95,7 @@ abstract class StoragesServiceTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
$this->dbConfig = new CleaningDBConfig(\OC::$server->getDatabaseConnection(), \OC::$server->getCrypto());
- self::$hookCalls = array();
+ self::$hookCalls = [];
$config = \OC::$server->getConfig();
$this->dataDir = $config->getSystemValue(
'datadirectory',
@@ -177,7 +177,7 @@ abstract class StoragesServiceTest extends \Test\TestCase {
protected function tearDown(): void {
\OC_Mount_Config::$skipTest = false;
- self::$hookCalls = array();
+ self::$hookCalls = [];
if ($this->dbConfig) {
$this->dbConfig->clean();
}
@@ -448,17 +448,17 @@ abstract class StoragesServiceTest extends \Test\TestCase {
}
public static function createHookCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_create_mount,
'params' => $params
- );
+ ];
}
public static function deleteHookCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_delete_mount,
'params' => $params
- );
+ ];
}
/**
diff --git a/apps/files_external/tests/Storage/FtpTest.php b/apps/files_external/tests/Storage/FtpTest.php
index 65a1566ec1e..6b9ce2d5b31 100644
--- a/apps/files_external/tests/Storage/FtpTest.php
+++ b/apps/files_external/tests/Storage/FtpTest.php
@@ -63,11 +63,11 @@ class FtpTest extends \Test\Files\Storage\Storage {
}
public function testConstructUrl(){
- $config = array ( 'host' => 'localhost',
+ $config = [ 'host' => 'localhost',
'user' => 'ftp',
'password' => 'ftp',
'root' => '/',
- 'secure' => false );
+ 'secure' => false ];
$instance = new FTP($config);
$this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
diff --git a/apps/files_external/tests/Storage/SmbTest.php b/apps/files_external/tests/Storage/SmbTest.php
index 2af9d00ebe9..87a5668be49 100644
--- a/apps/files_external/tests/Storage/SmbTest.php
+++ b/apps/files_external/tests/Storage/SmbTest.php
@@ -73,7 +73,7 @@ class SmbTest extends \Test\Files\Storage\Storage {
public function directoryProvider() {
// doesn't support leading/trailing spaces
- return array(array('folder'));
+ return [['folder']];
}
public function testRenameWithSpaces() {
diff --git a/apps/files_external/tests/config.php b/apps/files_external/tests/config.php
index a080b33e7fe..d6d3731c5a5 100644
--- a/apps/files_external/tests/config.php
+++ b/apps/files_external/tests/config.php
@@ -33,15 +33,15 @@ if (file_exists($privateConfigFile)) {
}
// this is now more a template now for your private configurations
-return array(
- 'ftp'=>array(
+return [
+ 'ftp'=>[
'run'=>false,
'host'=>'localhost',
'user'=>'test',
'password'=>'test',
'root'=>'/test',
- ),
- 'webdav'=>array(
+ ],
+ 'webdav'=>[
'run'=>false,
'host'=>'localhost',
'user'=>'test',
@@ -51,15 +51,15 @@ return array(
// (only in tests)
// set to higher value for lighttpd webdav
'wait'=> 0
- ),
- 'owncloud'=>array(
+ ],
+ 'owncloud'=>[
'run'=>false,
'host'=>'localhost/owncloud',
'user'=>'test',
'password'=>'test',
'root'=>'',
- ),
- 'swift' => array(
+ ],
+ 'swift' => [
'run' => false,
'user' => 'test',
'bucket' => 'test',
@@ -70,16 +70,16 @@ return array(
//'service_name' => 'swift', //should be 'swift' for OpenStack Object Storage and 'cloudFiles' for Rackspace Cloud Files (default value)
//'url' => 'https://identity.api.rackspacecloud.com/v2.0/', //to be used with Rackspace Cloud Files and OpenStack Object Storage
//'timeout' => 5 // timeout of HTTP requests in seconds
- ),
- 'smb'=>array(
+ ],
+ 'smb'=>[
'run'=>false,
'user'=>'test',
'password'=>'test',
'host'=>'localhost',
'share'=>'/test',
'root'=>'/test/',
- ),
- 'amazons3'=>array(
+ ],
+ 'amazons3'=>[
'run'=>false,
'key'=>'test',
'secret'=>'test',
@@ -90,20 +90,20 @@ return array(
//'region' => 'eu-west-1',
//'test'=>'true',
//'timeout'=>20
- ),
- 'sftp' => array (
+ ],
+ 'sftp' => [
'run'=>false,
'host'=>'localhost',
'user'=>'test',
'password'=>'test',
'root'=>'/test'
- ),
- 'sftp_key' => array (
+ ],
+ 'sftp_key' => [
'run'=>false,
'host'=>'localhost',
'user'=>'test',
'public_key'=>'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDJPTvz3OLonF2KSGEKP/nd4CPmRYvemG2T4rIiNYjDj0U5y+2sKEWbjiUlQl2bsqYuVoJ+/UNJlGQbbZ08kQirFeo1GoWBzqioaTjUJfbLN6TzVVKXxR9YIVmH7Ajg2iEeGCndGgbmnPfj+kF9TR9IH8vMVvtubQwf7uEwB0ALhw== phpseclib-generated-key',
'private_key'=>'test',
'root'=>'/test'
- ),
-);
+ ],
+];