diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 09:30:18 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 16:34:56 +0100 |
commit | b80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch) | |
tree | ec20e0ffa2f86b9b54939a83a785407319f94559 /apps/dav/lib | |
parent | 62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff) | |
download | nextcloud-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/dav/lib')
-rw-r--r-- | apps/dav/lib/CalDAV/CalDavBackend.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/CalDAV/Schedule/IMipPlugin.php | 4 | ||||
-rw-r--r-- | apps/dav/lib/CardDAV/CardDavBackend.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Directory.php | 8 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/File.php | 24 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesPlugin.php | 10 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesReportPlugin.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/MaintenancePlugin.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Node.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/SharesPlugin.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/TagsPlugin.php | 14 | ||||
-rw-r--r-- | apps/dav/lib/Files/BrowserErrorPagePlugin.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/SystemTag/SystemTagPlugin.php | 4 |
17 files changed, 47 insertions, 47 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 96459566a5a..7280288c02d 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -1944,7 +1944,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription } } - $valuesToInsert = array(); + $valuesToInsert = []; $query = $this->db->getQueryBuilder(); diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php index 982c579d3bb..3b66e84fc2b 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -237,13 +237,13 @@ class IMipPlugin extends SabreIMipPlugin { break; } - $data = array( + $data = [ 'attendee_name' => (string)$meetingAttendeeName ?: $defaultVal, 'invitee_name' => (string)$meetingInviteeName ?: $defaultVal, 'meeting_title' => (string)$meetingTitle ?: $defaultVal, 'meeting_description' => (string)$meetingDescription ?: $defaultVal, 'meeting_url' => (string)$meetingUrl ?: $defaultVal, - ); + ]; $fromEMail = \OCP\Util::getDefaultEmailAddress('invitations-noreply'); $fromName = $l10n->t('%1$s via %2$s', [$senderName, $this->defaults->getName()]); diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 24b91f7cec3..bd89b233aee 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -74,9 +74,9 @@ class CardDavBackend implements BackendInterface, SyncSupport { private $sharingBackend; /** @var array properties to index */ - public static $indexProperties = array( + public static $indexProperties = [ 'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME', - 'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD'); + 'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD']; /** * @var string[] Map of uid => display name @@ -909,7 +909,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are * @return array an array of contacts which are arrays of key-value-pairs */ - public function search($addressBookId, $pattern, $searchProperties, $options = array()) { + public function search($addressBookId, $pattern, $searchProperties, $options = []) { $query = $this->db->getQueryBuilder(); $query2 = $this->db->getQueryBuilder(); diff --git a/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php b/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php index 139044f9535..947b2960eab 100644 --- a/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php +++ b/apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php @@ -74,7 +74,7 @@ class AppEnabledPlugin extends ServerPlugin { public function initialize(\Sabre\DAV\Server $server) { $this->server = $server; - $this->server->on('beforeMethod', array($this, 'checkAppEnabled'), 30); + $this->server->on('beforeMethod', [$this, 'checkAppEnabled'], 30); } /** diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php index 1a069e548b4..22f0104940d 100644 --- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php @@ -67,7 +67,7 @@ class CommentPropertiesPlugin extends ServerPlugin { */ function initialize(\Sabre\DAV\Server $server) { $this->server = $server; - $this->server->on('propFind', array($this, 'handleGetProperties')); + $this->server->on('propFind', [$this, 'handleGetProperties']); } /** diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index d17cfb81777..9b44997fb60 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -267,7 +267,7 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node throw new Locked(); } - $nodes = array(); + $nodes = []; foreach ($folderContent as $info) { $node = $this->getChild($info->getName(), $info); $nodes[] = $node; @@ -336,13 +336,13 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node } else { $free = $storageInfo['free']; } - $this->quotaInfo = array( + $this->quotaInfo = [ $storageInfo['used'], $free - ); + ]; return $this->quotaInfo; } catch (\OCP\Files\StorageNotAvailableException $e) { - return array(0, 0); + return [0, 0]; } } diff --git a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php index dc595197965..cf617152eb8 100644 --- a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php +++ b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php @@ -103,7 +103,7 @@ class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin { */ public function initialize(\Sabre\DAV\Server $server) { - $server->on('exception', array($this, 'logException'), 10); + $server->on('exception', [$this, 'logException'], 10); } /** diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 098961ce130..0bd01de408b 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -359,20 +359,20 @@ class File extends Node implements IFile { $run = true; if (!$exists) { - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_create, array( + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_create, [ \OC\Files\Filesystem::signal_param_path => $hookPath, \OC\Files\Filesystem::signal_param_run => &$run, - )); + ]); } else { - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_update, array( + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_update, [ \OC\Files\Filesystem::signal_param_path => $hookPath, \OC\Files\Filesystem::signal_param_run => &$run, - )); + ]); } - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_write, array( + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_write, [ \OC\Files\Filesystem::signal_param_path => $hookPath, \OC\Files\Filesystem::signal_param_run => &$run, - )); + ]); return $run; } @@ -385,17 +385,17 @@ class File extends Node implements IFile { } $hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($path)); if (!$exists) { - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, array( + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, [ \OC\Files\Filesystem::signal_param_path => $hookPath - )); + ]); } else { - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_update, array( + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_update, [ \OC\Files\Filesystem::signal_param_path => $hookPath - )); + ]); } - \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, array( + \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, [ \OC\Files\Filesystem::signal_param_path => $hookPath - )); + ]); } /** diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 498058f7c03..a35db1e77e4 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -173,12 +173,12 @@ class FilesPlugin extends ServerPlugin { $server->protectedProperties = array_diff($server->protectedProperties, $allowedProperties); $this->server = $server; - $this->server->on('propFind', array($this, 'handleGetProperties')); - $this->server->on('propPatch', array($this, 'handleUpdateProperties')); - $this->server->on('afterBind', array($this, 'sendFileIdHeader')); - $this->server->on('afterWriteContent', array($this, 'sendFileIdHeader')); + $this->server->on('propFind', [$this, 'handleGetProperties']); + $this->server->on('propPatch', [$this, 'handleUpdateProperties']); + $this->server->on('afterBind', [$this, 'sendFileIdHeader']); + $this->server->on('afterWriteContent', [$this, 'sendFileIdHeader']); $this->server->on('afterMethod:GET', [$this,'httpGet']); - $this->server->on('afterMethod:GET', array($this, 'handleDownloadToken')); + $this->server->on('afterMethod:GET', [$this, 'handleDownloadToken']); $this->server->on('afterResponse', function($request, ResponseInterface $response) { $body = $response->getBody(); if (is_resource($body)) { diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php index 41de6ea4ed8..a2de82fa9c5 100644 --- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php @@ -154,7 +154,7 @@ class FilesReportPlugin extends ServerPlugin { $server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc'; $this->server = $server; - $this->server->on('report', array($this, 'onReport')); + $this->server->on('report', [$this, 'onReport']); } /** diff --git a/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php b/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php index d015bcbc21c..4076abe59fe 100644 --- a/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php +++ b/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php @@ -67,7 +67,7 @@ class MaintenancePlugin extends ServerPlugin { */ public function initialize(\Sabre\DAV\Server $server) { $this->server = $server; - $this->server->on('beforeMethod', array($this, 'checkMaintenanceMode'), 1); + $this->server->on('beforeMethod', [$this, 'checkMaintenanceMode'], 1); } /** diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php index f178b2fbfbd..5f9ecf88142 100644 --- a/apps/dav/lib/Connector/Sabre/Node.php +++ b/apps/dav/lib/Connector/Sabre/Node.php @@ -200,15 +200,15 @@ abstract class Node implements \Sabre\DAV\INode { * @return int file id of updated file or -1 on failure */ public function setETag($etag) { - return $this->fileView->putFileInfo($this->path, array('etag' => $etag)); + return $this->fileView->putFileInfo($this->path, ['etag' => $etag]); } public function setCreationTime(int $time) { - return $this->fileView->putFileInfo($this->path, array('creation_time' => $time)); + return $this->fileView->putFileInfo($this->path, ['creation_time' => $time]); } public function setUploadTime(int $time) { - return $this->fileView->putFileInfo($this->path, array('upload_time' => $time)); + return $this->fileView->putFileInfo($this->path, ['upload_time' => $time]); } /** diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php index a4baa65948e..9d543e55a4b 100644 --- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php @@ -107,7 +107,7 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin { $server->protectedProperties[] = self::SHAREES_PROPERTYNAME; $this->server = $server; - $this->server->on('propFind', array($this, 'handleGetProperties')); + $this->server->on('propFind', [$this, 'handleGetProperties']); } private function getShare(\OCP\Files\Node $node): array { diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php index fe19b434648..2ac7c01f426 100644 --- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php +++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php @@ -98,7 +98,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin $this->tree = $tree; $this->tagManager = $tagManager; $this->tagger = null; - $this->cachedTags = array(); + $this->cachedTags = []; } /** @@ -118,8 +118,8 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin $server->xml->elementMap[self::TAGS_PROPERTYNAME] = TagList::class; $this->server = $server; - $this->server->on('propFind', array($this, 'handleGetProperties')); - $this->server->on('propPatch', array($this, 'handleUpdateProperties')); + $this->server->on('propFind', [$this, 'handleGetProperties']); + $this->server->on('propPatch', [$this, 'handleUpdateProperties']); } /** @@ -151,7 +151,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin unset($tags[$favPos]); } } - return array($tags, $isFav); + return [$tags, $isFav]; } /** @@ -164,10 +164,10 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin if (isset($this->cachedTags[$fileId])) { return $this->cachedTags[$fileId]; } else { - $tags = $this->getTagger()->getTagsForObjects(array($fileId)); + $tags = $this->getTagger()->getTagsForObjects([$fileId]); if ($tags !== false) { if (empty($tags)) { - return array(); + return []; } return current($tags); } @@ -232,7 +232,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin $tags = $this->getTagger()->getTagsForObjects($fileIds); if ($tags === false) { // the tags API returns false on error... - $tags = array(); + $tags = []; } $this->cachedTags = $this->cachedTags + $tags; diff --git a/apps/dav/lib/Files/BrowserErrorPagePlugin.php b/apps/dav/lib/Files/BrowserErrorPagePlugin.php index 9bc169601af..7b0d39f2fbb 100644 --- a/apps/dav/lib/Files/BrowserErrorPagePlugin.php +++ b/apps/dav/lib/Files/BrowserErrorPagePlugin.php @@ -48,7 +48,7 @@ class BrowserErrorPagePlugin extends ServerPlugin { */ function initialize(Server $server) { $this->server = $server; - $server->on('exception', array($this, 'logException'), 1000); + $server->on('exception', [$this, 'logException'], 1000); } /** diff --git a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php index b940fa55b5b..f580b7fe47a 100644 --- a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php +++ b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php @@ -88,7 +88,7 @@ class RemoveOrphanEventsAndContacts implements IRepairStep { $result = $qb->execute(); - $orphanItems = array(); + $orphanItems = []; while ($row = $result->fetch()) { $orphanItems[] = (int) $row['id']; } diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php index c86f621a67d..d44b21b24c9 100644 --- a/apps/dav/lib/SystemTag/SystemTagPlugin.php +++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php @@ -107,8 +107,8 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { $server->protectedProperties[] = self::ID_PROPERTYNAME; - $server->on('propFind', array($this, 'handleGetProperties')); - $server->on('propPatch', array($this, 'handleUpdateProperties')); + $server->on('propFind', [$this, 'handleGetProperties']); + $server->on('propPatch', [$this, 'handleUpdateProperties']); $server->on('method:POST', [$this, 'httpPost']); $this->server = $server; |