[Pkg-owncloud-commits] [php-sabredav] 203/275: New coding standards.
David Prévot
taffit at moszumanska.debian.org
Thu Sep 25 14:56:08 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabredav.
commit 42d809ec91c5bac60cbed219ea27822513618e52
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Sat Aug 30 14:23:41 2014 +0200
New coding standards.
---
lib/CalDAV/Backend/AbstractBackend.php | 10 ++--
lib/CalDAV/Backend/BackendInterface.php | 24 ++++-----
lib/CalDAV/Backend/NotificationSupport.php | 4 +-
lib/CalDAV/Backend/PDO.php | 42 +++++++--------
lib/CalDAV/Backend/SchedulingSupport.php | 8 +--
lib/CalDAV/Backend/SubscriptionSupport.php | 8 +--
lib/CalDAV/Calendar.php | 52 +++++++++---------
lib/CalDAV/CalendarHome.php | 62 +++++++++++-----------
lib/CalDAV/CalendarObject.php | 52 +++++++++---------
lib/CalDAV/CalendarQueryParser.php | 32 +++++------
lib/CalDAV/CalendarQueryValidator.php | 2 +-
lib/CalDAV/CalendarRoot.php | 6 +--
lib/CalDAV/Exception/InvalidComponentType.php | 2 +-
lib/CalDAV/ICSExportPlugin.php | 6 +--
lib/CalDAV/ICalendar.php | 1 -
lib/CalDAV/ICalendarObject.php | 1 -
lib/CalDAV/ICalendarObjectContainer.php | 3 +-
lib/CalDAV/Notifications/Collection.php | 30 +++++------
lib/CalDAV/Notifications/ICollection.php | 1 -
lib/CalDAV/Notifications/Node.php | 32 +++++------
lib/CalDAV/Notifications/Notification/Invite.php | 14 ++---
.../Notifications/Notification/InviteReply.php | 14 ++---
.../Notifications/Notification/SystemStatus.php | 10 ++--
lib/CalDAV/Principal/Collection.php | 2 +-
lib/CalDAV/Principal/ProxyRead.php | 24 ++++-----
lib/CalDAV/Principal/ProxyWrite.php | 22 ++++----
lib/CalDAV/Principal/User.php | 22 ++++----
lib/CalDAV/Property/AllowedSharingModes.php | 4 +-
lib/CalDAV/Property/EmailAddressSet.php | 6 +--
lib/CalDAV/Property/Invite.php | 6 +--
lib/CalDAV/Property/ScheduleCalendarTransp.php | 6 +--
.../Property/SupportedCalendarComponentSet.php | 6 +--
lib/CalDAV/Property/SupportedCalendarData.php | 2 +-
lib/CalDAV/Property/SupportedCollationSet.php | 2 +-
lib/CalDAV/Schedule/IMipPlugin.php | 8 +--
lib/CalDAV/Schedule/IOutbox.php | 1 -
lib/CalDAV/Schedule/ISchedulingObject.php | 1 -
lib/CalDAV/Schedule/Inbox.php | 20 +++----
lib/CalDAV/Schedule/Outbox.php | 26 ++++-----
lib/CalDAV/Schedule/Plugin.php | 24 ++++-----
lib/CalDAV/Schedule/SchedulingObject.php | 53 +++++++++---------
lib/CalDAV/ShareableCalendar.php | 6 +--
lib/CalDAV/SharedCalendar.php | 12 ++---
lib/CalDAV/SharingPlugin.php | 46 ++++++++--------
lib/CalDAV/Subscriptions/Plugin.php | 6 +--
lib/CalDAV/Subscriptions/Subscription.php | 24 ++++-----
lib/DAV/Auth/Backend/AbstractBasic.php | 4 +-
lib/DAV/Auth/Backend/AbstractDigest.php | 6 +--
lib/DAV/Auth/Backend/Apache.php | 4 +-
lib/DAV/Auth/Backend/BasicCallBack.php | 2 +-
lib/DAV/Auth/Backend/File.php | 8 +--
lib/DAV/Auth/Backend/PDO.php | 6 +--
lib/DAV/Auth/Plugin.php | 14 ++---
lib/DAV/Browser/GuessContentType.php | 8 +--
lib/DAV/Browser/MapGetToPropFind.php | 4 +-
lib/DAV/Browser/Plugin.php | 14 ++---
lib/DAV/Browser/PropFindAll.php | 12 ++---
lib/DAV/Client.php | 48 ++++++++---------
lib/DAV/Collection.php | 8 +--
lib/DAV/Exception.php | 8 +--
lib/DAV/Exception/BadRequest.php | 2 +-
lib/DAV/Exception/Conflict.php | 2 +-
lib/DAV/Exception/ConflictingLock.php | 2 +-
lib/DAV/Exception/Forbidden.php | 2 +-
lib/DAV/Exception/InsufficientStorage.php | 2 +-
lib/DAV/Exception/InvalidResourceType.php | 2 +-
lib/DAV/Exception/InvalidSyncToken.php | 2 +-
lib/DAV/Exception/LengthRequired.php | 2 +-
lib/DAV/Exception/LockTokenMatchesRequestUri.php | 4 +-
lib/DAV/Exception/Locked.php | 6 +--
lib/DAV/Exception/MethodNotAllowed.php | 8 +--
lib/DAV/Exception/NotAuthenticated.php | 2 +-
lib/DAV/Exception/NotFound.php | 2 +-
lib/DAV/Exception/NotImplemented.php | 2 +-
lib/DAV/Exception/PaymentRequired.php | 2 +-
lib/DAV/Exception/PreconditionFailed.php | 6 +--
lib/DAV/Exception/ReportNotSupported.php | 2 +-
lib/DAV/Exception/RequestedRangeNotSatisfiable.php | 2 +-
lib/DAV/Exception/ServiceUnavailable.php | 2 +-
lib/DAV/Exception/TooManyMatches.php | 2 +-
lib/DAV/Exception/UnsupportedMediaType.php | 2 +-
lib/DAV/FS/Directory.php | 20 +++----
lib/DAV/FS/File.php | 12 ++---
lib/DAV/FS/Node.php | 8 +--
lib/DAV/FSExt/Directory.php | 20 +++----
lib/DAV/FSExt/File.php | 14 ++---
lib/DAV/FSExt/Node.php | 16 +++---
lib/DAV/File.php | 10 ++--
lib/DAV/IMultiGet.php | 2 +-
lib/DAV/IProperties.php | 4 +-
lib/DAV/Locks/Backend/BackendInterface.php | 6 +--
lib/DAV/Locks/Backend/FS.php | 14 ++---
lib/DAV/Locks/Backend/File.php | 14 ++---
lib/DAV/Locks/Backend/PDO.php | 34 ++++++++----
lib/DAV/Locks/Plugin.php | 34 ++++++------
lib/DAV/Mount/Plugin.php | 6 +--
lib/DAV/Node.php | 6 +--
lib/DAV/ObjectTree.php | 14 ++---
lib/DAV/PartialUpdate/Plugin.php | 34 ++++++------
lib/DAV/PropFind.php | 24 ++++-----
lib/DAV/PropPatch.php | 18 +++----
lib/DAV/Property/GetLastModified.php | 6 +--
lib/DAV/Property/Href.php | 6 +--
lib/DAV/Property/HrefList.php | 8 +--
lib/DAV/Property/LockDiscovery.php | 4 +-
lib/DAV/Property/ResourceType.php | 20 +++----
lib/DAV/Property/Response.php | 12 ++---
lib/DAV/Property/ResponseList.php | 10 ++--
lib/DAV/Property/SupportedLock.php | 4 +-
lib/DAV/Property/SupportedMethodSet.php | 6 +--
lib/DAV/Property/SupportedReportSet.php | 14 ++---
lib/DAV/PropertyInterface.php | 4 +-
.../PropertyStorage/Backend/BackendInterface.php | 8 +--
lib/DAV/PropertyStorage/Backend/PDO.php | 10 ++--
lib/DAV/PropertyStorage/Plugin.php | 12 ++---
lib/DAV/ServerPlugin.php | 10 ++--
lib/DAV/SimpleCollection.php | 12 ++---
lib/DAV/SimpleFile.php | 14 ++---
lib/DAV/StringUtil.php | 6 +--
lib/DAV/Sync/ISyncCollection.php | 4 +-
lib/DAV/Sync/Plugin.php | 24 ++++-----
lib/DAV/TemporaryFileFilterPlugin.php | 20 +++----
lib/DAV/Tree.php | 16 +++---
lib/DAV/Tree/Filesystem.php | 8 +--
lib/DAV/XMLUtil.php | 10 ++--
lib/DAVACL/Property/Acl.php | 8 +--
lib/DAVACL/Property/AclRestrictions.php | 2 +-
127 files changed, 763 insertions(+), 754 deletions(-)
diff --git a/lib/CalDAV/Backend/AbstractBackend.php b/lib/CalDAV/Backend/AbstractBackend.php
index 3d47803..46e2285 100644
--- a/lib/CalDAV/Backend/AbstractBackend.php
+++ b/lib/CalDAV/Backend/AbstractBackend.php
@@ -32,7 +32,7 @@ abstract class AbstractBackend implements BackendInterface {
* @param \Sabre\DAV\PropPatch $propPatch
* @return void
*/
- public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch) {
+ function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch) {
}
@@ -48,7 +48,7 @@ abstract class AbstractBackend implements BackendInterface {
* @param array $uris
* @return array
*/
- public function getMultipleCalendarObjects($calendarId, array $uris) {
+ function getMultipleCalendarObjects($calendarId, array $uris) {
return array_map(function($uri) use ($calendarId) {
return $this->getCalendarObject($calendarId, $uri);
@@ -105,9 +105,9 @@ abstract class AbstractBackend implements BackendInterface {
* @param array $filters
* @return array
*/
- public function calendarQuery($calendarId, array $filters) {
+ function calendarQuery($calendarId, array $filters) {
- $result = array();
+ $result = [];
$objects = $this->getCalendarObjects($calendarId);
foreach($objects as $object) {
@@ -165,7 +165,7 @@ abstract class AbstractBackend implements BackendInterface {
* @param string $uid
* @return string|null
*/
- public function getCalendarObjectByUID($principalUri, $uid) {
+ function getCalendarObjectByUID($principalUri, $uid) {
// Note: this is a super slow naive implementation of this method. You
// are highly recommended to optimize it, if your backend allows it.
diff --git a/lib/CalDAV/Backend/BackendInterface.php b/lib/CalDAV/Backend/BackendInterface.php
index 190c29d..d555bae 100644
--- a/lib/CalDAV/Backend/BackendInterface.php
+++ b/lib/CalDAV/Backend/BackendInterface.php
@@ -33,7 +33,7 @@ interface BackendInterface {
* @param string $principalUri
* @return array
*/
- public function getCalendarsForUser($principalUri);
+ function getCalendarsForUser($principalUri);
/**
* Creates a new calendar for a principal.
@@ -46,7 +46,7 @@ interface BackendInterface {
* @param array $properties
* @return void
*/
- public function createCalendar($principalUri,$calendarUri,array $properties);
+ function createCalendar($principalUri,$calendarUri,array $properties);
/**
* Updates properties for a calendar.
@@ -64,7 +64,7 @@ interface BackendInterface {
* @param \Sabre\DAV\PropPatch $propPatch
* @return void
*/
- public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch);
+ function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch);
/**
* Delete a calendar and all it's objects
@@ -72,7 +72,7 @@ interface BackendInterface {
* @param mixed $calendarId
* @return void
*/
- public function deleteCalendar($calendarId);
+ function deleteCalendar($calendarId);
/**
* Returns all calendar objects within a calendar.
@@ -107,7 +107,7 @@ interface BackendInterface {
* @param mixed $calendarId
* @return array
*/
- public function getCalendarObjects($calendarId);
+ function getCalendarObjects($calendarId);
/**
* Returns information from a single calendar object, based on it's object
@@ -125,7 +125,7 @@ interface BackendInterface {
* @param string $objectUri
* @return array|null
*/
- public function getCalendarObject($calendarId,$objectUri);
+ function getCalendarObject($calendarId,$objectUri);
/**
* Returns a list of calendar objects.
@@ -139,7 +139,7 @@ interface BackendInterface {
* @param array $uris
* @return array
*/
- public function getMultipleCalendarObjects($calendarId, array $uris);
+ function getMultipleCalendarObjects($calendarId, array $uris);
/**
* Creates a new calendar object.
@@ -159,7 +159,7 @@ interface BackendInterface {
* @param string $calendarData
* @return string|null
*/
- public function createCalendarObject($calendarId,$objectUri,$calendarData);
+ function createCalendarObject($calendarId,$objectUri,$calendarData);
/**
* Updates an existing calendarobject, based on it's uri.
@@ -179,7 +179,7 @@ interface BackendInterface {
* @param string $calendarData
* @return string|null
*/
- public function updateCalendarObject($calendarId,$objectUri,$calendarData);
+ function updateCalendarObject($calendarId,$objectUri,$calendarData);
/**
* Deletes an existing calendar object.
@@ -190,7 +190,7 @@ interface BackendInterface {
* @param string $objectUri
* @return void
*/
- public function deleteCalendarObject($calendarId,$objectUri);
+ function deleteCalendarObject($calendarId,$objectUri);
/**
* Performs a calendar-query on the contents of this calendar.
@@ -241,7 +241,7 @@ interface BackendInterface {
* @param array $filters
* @return array
*/
- public function calendarQuery($calendarId, array $filters);
+ function calendarQuery($calendarId, array $filters);
/**
* Searches through all of a users calendars and calendar objects to find
@@ -262,6 +262,6 @@ interface BackendInterface {
* @param string $uid
* @return string|null
*/
- public function getCalendarObjectByUID($principalUri, $uid);
+ function getCalendarObjectByUID($principalUri, $uid);
}
diff --git a/lib/CalDAV/Backend/NotificationSupport.php b/lib/CalDAV/Backend/NotificationSupport.php
index 96533ad..f180085 100644
--- a/lib/CalDAV/Backend/NotificationSupport.php
+++ b/lib/CalDAV/Backend/NotificationSupport.php
@@ -31,7 +31,7 @@ interface NotificationSupport extends BackendInterface {
* @param string $principalUri
* @return array
*/
- public function getNotificationsForPrincipal($principalUri);
+ function getNotificationsForPrincipal($principalUri);
/**
* This deletes a specific notifcation.
@@ -42,6 +42,6 @@ interface NotificationSupport extends BackendInterface {
* @param \Sabre\CalDAV\Notifications\INotificationType $notification
* @return void
*/
- public function deleteNotification($principalUri, \Sabre\CalDAV\Notifications\INotificationType $notification);
+ function deleteNotification($principalUri, \Sabre\CalDAV\Notifications\INotificationType $notification);
}
diff --git a/lib/CalDAV/Backend/PDO.php b/lib/CalDAV/Backend/PDO.php
index 153c3d6..a354854 100755
--- a/lib/CalDAV/Backend/PDO.php
+++ b/lib/CalDAV/Backend/PDO.php
@@ -114,7 +114,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $calendarSubscriptionsTableName
* @todo we have to do something about this signature. It's bullshit.
*/
- public function __construct(\PDO $pdo, $calendarTableName = 'calendars', $calendarObjectTableName = 'calendarobjects', $calendarChangesTableName = 'calendarchanges', $calendarSubscriptionsTableName = "calendarsubscriptions", $schedulingObjectTableName = "schedulingobjects") {
+ function __construct(\PDO $pdo, $calendarTableName = 'calendars', $calendarObjectTableName = 'calendarobjects', $calendarChangesTableName = 'calendarchanges', $calendarSubscriptionsTableName = "calendarsubscriptions", $schedulingObjectTableName = "schedulingobjects") {
$this->pdo = $pdo;
$this->calendarTableName = $calendarTableName;
@@ -146,7 +146,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $principalUri
* @return array
*/
- public function getCalendarsForUser($principalUri) {
+ function getCalendarsForUser($principalUri) {
$fields = array_values($this->propertyMap);
$fields[] = 'id';
@@ -203,7 +203,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param array $properties
* @return string
*/
- public function createCalendar($principalUri, $calendarUri, array $properties) {
+ function createCalendar($principalUri, $calendarUri, array $properties) {
$fieldNames = [
'principaluri',
@@ -265,7 +265,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param \Sabre\DAV\PropPatch $propPatch
* @return void
*/
- public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch) {
+ function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch) {
$supportedProperties = array_keys($this->propertyMap);
$supportedProperties[] = '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-calendar-transp';
@@ -309,7 +309,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $calendarId
* @return void
*/
- public function deleteCalendar($calendarId) {
+ function deleteCalendar($calendarId) {
$stmt = $this->pdo->prepare('DELETE FROM '.$this->calendarObjectTableName.' WHERE calendarid = ?');
$stmt->execute([$calendarId]);
@@ -355,7 +355,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $calendarId
* @return array
*/
- public function getCalendarObjects($calendarId) {
+ function getCalendarObjects($calendarId) {
$stmt = $this->pdo->prepare('SELECT id, uri, lastmodified, etag, calendarid, size, componenttype FROM '.$this->calendarObjectTableName.' WHERE calendarid = ?');
$stmt->execute([$calendarId]);
@@ -393,7 +393,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $objectUri
* @return array|null
*/
- public function getCalendarObject($calendarId,$objectUri) {
+ function getCalendarObject($calendarId,$objectUri) {
$stmt = $this->pdo->prepare('SELECT id, uri, lastmodified, etag, calendarid, size, calendardata, componenttype FROM '.$this->calendarObjectTableName.' WHERE calendarid = ? AND uri = ?');
$stmt->execute([$calendarId, $objectUri]);
@@ -426,7 +426,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param array $uris
* @return array
*/
- public function getMultipleCalendarObjects($calendarId, array $uris) {
+ function getMultipleCalendarObjects($calendarId, array $uris) {
$query = 'SELECT id, uri, lastmodified, etag, calendarid, size, calendardata, componenttype FROM '.$this->calendarObjectTableName.' WHERE calendarid = ? AND uri IN (';
// Inserting a whole bunch of question marks
@@ -474,7 +474,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $calendarData
* @return string|null
*/
- public function createCalendarObject($calendarId,$objectUri,$calendarData) {
+ function createCalendarObject($calendarId,$objectUri,$calendarData) {
$extraData = $this->getDenormalizedData($calendarData);
@@ -515,7 +515,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $calendarData
* @return string|null
*/
- public function updateCalendarObject($calendarId,$objectUri,$calendarData) {
+ function updateCalendarObject($calendarId,$objectUri,$calendarData) {
$extraData = $this->getDenormalizedData($calendarData);
@@ -616,7 +616,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $objectUri
* @return void
*/
- public function deleteCalendarObject($calendarId,$objectUri) {
+ function deleteCalendarObject($calendarId,$objectUri) {
$stmt = $this->pdo->prepare('DELETE FROM '.$this->calendarObjectTableName.' WHERE calendarid = ? AND uri = ?');
$stmt->execute([$calendarId, $objectUri]);
@@ -677,7 +677,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param array $filters
* @return array
*/
- public function calendarQuery($calendarId, array $filters) {
+ function calendarQuery($calendarId, array $filters) {
$componentType = null;
$requirePostFilter = true;
@@ -807,7 +807,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param int $limit
* @return array
*/
- public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null) {
+ function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null) {
// Current synctoken
$stmt = $this->pdo->prepare('SELECT synctoken FROM ' .$this->calendarTableName . ' WHERE id = ?');
@@ -924,7 +924,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $principalUri
* @return array
*/
- public function getSubscriptionsForUser($principalUri) {
+ function getSubscriptionsForUser($principalUri) {
$fields = array_values($this->subscriptionPropertyMap);
$fields[] = 'id';
@@ -976,7 +976,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param array $properties
* @return mixed
*/
- public function createSubscription($principalUri, $uri, array $properties) {
+ function createSubscription($principalUri, $uri, array $properties) {
$fieldNames = [
'principaluri',
@@ -1027,7 +1027,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param \Sabre\DAV\PropPatch $propPatch
* @return void
*/
- public function updateSubscription($subscriptionId, DAV\PropPatch $propPatch) {
+ function updateSubscription($subscriptionId, DAV\PropPatch $propPatch) {
$supportedProperties = array_keys($this->subscriptionPropertyMap);
$supportedProperties[] = '{http://calendarserver.org/ns/}source';
@@ -1070,7 +1070,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param mixed $subscriptionId
* @return void
*/
- public function deleteSubscription($subscriptionId) {
+ function deleteSubscription($subscriptionId) {
$stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarSubscriptionsTableName . ' WHERE id = ?');
$stmt->execute([$subscriptionId]);
@@ -1093,7 +1093,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $objectUri
* @return array
*/
- public function getSchedulingObject($principalUri, $objectUri) {
+ function getSchedulingObject($principalUri, $objectUri) {
$stmt = $this->pdo->prepare('SELECT uri, calendardata, lastmodified, etag, size FROM '.$this->schedulingObjectTableName.' WHERE principaluri = ? AND uri = ?');
$stmt->execute([$principalUri, $objectUri]);
@@ -1122,7 +1122,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $principalUri
* @return array
*/
- public function getSchedulingObjects($principalUri) {
+ function getSchedulingObjects($principalUri) {
$stmt = $this->pdo->prepare('SELECT id, calendardata, uri, lastmodified, etag, size FROM '.$this->schedulingObjectTableName.' WHERE principaluri = ?');
$stmt->execute([$principalUri]);
@@ -1149,7 +1149,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $objectUri
* @return void
*/
- public function deleteSchedulingObject($principalUri, $objectUri) {
+ function deleteSchedulingObject($principalUri, $objectUri) {
$stmt = $this->pdo->prepare('DELETE FROM '.$this->schedulingObjectTableName.' WHERE principaluri = ? AND uri = ?');
$stmt->execute([$principalUri, $objectUri]);
@@ -1164,7 +1164,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* @param string $objectData
* @return void
*/
- public function createSchedulingObject($principalUri, $objectUri, $objectData) {
+ function createSchedulingObject($principalUri, $objectUri, $objectData) {
$stmt = $this->pdo->prepare('INSERT INTO '.$this->schedulingObjectTableName.' (principaluri, calendardata, uri, lastmodified, etag, size) VALUES (?, ?, ?, ?, ?, ?)');
$stmt->execute([$principalUri, $objectData, $objectUri, time(), md5($objectData), strlen($objectData) ]);
diff --git a/lib/CalDAV/Backend/SchedulingSupport.php b/lib/CalDAV/Backend/SchedulingSupport.php
index dcb60dd..8226e67 100644
--- a/lib/CalDAV/Backend/SchedulingSupport.php
+++ b/lib/CalDAV/Backend/SchedulingSupport.php
@@ -28,7 +28,7 @@ interface SchedulingSupport extends BackendInterface {
* @param string $objectUri
* @return array
*/
- public function getSchedulingObject($principalUri, $objectUri);
+ function getSchedulingObject($principalUri, $objectUri);
/**
* Returns all scheduling objects for the inbox collection.
@@ -41,7 +41,7 @@ interface SchedulingSupport extends BackendInterface {
* @param string $principalUri
* @return array
*/
- public function getSchedulingObjects($principalUri);
+ function getSchedulingObjects($principalUri);
/**
* Deletes a scheduling object from the inbox collection.
@@ -50,7 +50,7 @@ interface SchedulingSupport extends BackendInterface {
* @param string $objectUri
* @return void
*/
- public function deleteSchedulingObject($principalUri, $objectUri);
+ function deleteSchedulingObject($principalUri, $objectUri);
/**
* Creates a new scheduling object. This should land in a users' inbox.
@@ -60,6 +60,6 @@ interface SchedulingSupport extends BackendInterface {
* @param string $objectData
* @return void
*/
- public function createSchedulingObject($principalUri, $objectUri, $objectData);
+ function createSchedulingObject($principalUri, $objectUri, $objectData);
}
diff --git a/lib/CalDAV/Backend/SubscriptionSupport.php b/lib/CalDAV/Backend/SubscriptionSupport.php
index 699378d..121ee8f 100644
--- a/lib/CalDAV/Backend/SubscriptionSupport.php
+++ b/lib/CalDAV/Backend/SubscriptionSupport.php
@@ -45,7 +45,7 @@ interface SubscriptionSupport extends BackendInterface {
* @param string $principalUri
* @return array
*/
- public function getSubscriptionsForUser($principalUri);
+ function getSubscriptionsForUser($principalUri);
/**
* Creates a new subscription for a principal.
@@ -58,7 +58,7 @@ interface SubscriptionSupport extends BackendInterface {
* @param array $properties
* @return mixed
*/
- public function createSubscription($principalUri, $uri, array $properties);
+ function createSubscription($principalUri, $uri, array $properties);
/**
* Updates a subscription
@@ -76,7 +76,7 @@ interface SubscriptionSupport extends BackendInterface {
* @param \Sabre\DAV\PropPatch $propPatch
* @return void
*/
- public function updateSubscription($subscriptionId, DAV\PropPatch $propPatch);
+ function updateSubscription($subscriptionId, DAV\PropPatch $propPatch);
/**
* Deletes a subscription.
@@ -84,6 +84,6 @@ interface SubscriptionSupport extends BackendInterface {
* @param mixed $subscriptionId
* @return void
*/
- public function deleteSubscription($subscriptionId);
+ function deleteSubscription($subscriptionId);
}
diff --git a/lib/CalDAV/Calendar.php b/lib/CalDAV/Calendar.php
index ff665e7..d8c97de 100644
--- a/lib/CalDAV/Calendar.php
+++ b/lib/CalDAV/Calendar.php
@@ -39,7 +39,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param Backend\BackendInterface $caldavBackend
* @param array $calendarInfo
*/
- public function __construct(Backend\BackendInterface $caldavBackend, $calendarInfo) {
+ function __construct(Backend\BackendInterface $caldavBackend, $calendarInfo) {
$this->caldavBackend = $caldavBackend;
$this->calendarInfo = $calendarInfo;
@@ -51,7 +51,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* @return string
*/
- public function getName() {
+ function getName() {
return $this->calendarInfo['uri'];
@@ -69,7 +69,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param PropPatch $propPatch
* @return void
*/
- public function propPatch(PropPatch $propPatch) {
+ function propPatch(PropPatch $propPatch) {
return $this->caldavBackend->updateCalendar($this->calendarInfo['id'], $propPatch);
@@ -81,7 +81,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param array $requestedProperties
* @return array
*/
- public function getProperties($requestedProperties) {
+ function getProperties($requestedProperties) {
$response = [];
@@ -103,7 +103,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param string $name
* @return \Sabre\CalDAV\ICalendarObject
*/
- public function getChild($name) {
+ function getChild($name) {
$obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'],$name);
@@ -120,7 +120,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* @return array
*/
- public function getChildren() {
+ function getChildren() {
$objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id']);
$children = [];
@@ -140,7 +140,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* @return array
*/
- public function getMultipleChildren(array $paths) {
+ function getMultipleChildren(array $paths) {
$objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths);
$children = [];
@@ -158,7 +158,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param string $name
* @return bool
*/
- public function childExists($name) {
+ function childExists($name) {
$obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'],$name);
if (!$obj)
@@ -176,7 +176,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param string $name
* @return void
*/
- public function createDirectory($name) {
+ function createDirectory($name) {
throw new DAV\Exception\MethodNotAllowed('Creating collections in calendar objects is not allowed');
@@ -191,7 +191,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param resource $calendarData
* @return string|null
*/
- public function createFile($name,$calendarData = null) {
+ function createFile($name,$calendarData = null) {
if (is_resource($calendarData)) {
$calendarData = stream_get_contents($calendarData);
@@ -205,7 +205,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* @return void
*/
- public function delete() {
+ function delete() {
$this->caldavBackend->deleteCalendar($this->calendarInfo['id']);
@@ -218,7 +218,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param string $newName
* @return void
*/
- public function setName($newName) {
+ function setName($newName) {
throw new DAV\Exception\MethodNotAllowed('Renaming calendars is not yet supported');
@@ -229,7 +229,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* @return void
*/
- public function getLastModified() {
+ function getLastModified() {
return null;
@@ -242,7 +242,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* @return string|null
*/
- public function getOwner() {
+ function getOwner() {
return $this->calendarInfo['principaluri'];
@@ -255,7 +255,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* @return string|null
*/
- public function getGroup() {
+ function getGroup() {
return null;
@@ -273,7 +273,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* @return array
*/
- public function getACL() {
+ function getACL() {
return [
[
@@ -318,7 +318,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* @return array
*/
- public function getChildACL() {
+ function getChildACL() {
return [
[
@@ -359,7 +359,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param array $acl
* @return void
*/
- public function setACL(array $acl) {
+ function setACL(array $acl) {
throw new DAV\Exception\MethodNotAllowed('Changing ACL is not yet supported');
@@ -377,7 +377,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* @return array|null
*/
- public function getSupportedPrivilegeSet() {
+ function getSupportedPrivilegeSet() {
$default = DAVACL\Plugin::getDefaultSupportedPrivilegeSet();
@@ -413,7 +413,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param array $filters
* @return array
*/
- public function calendarQuery(array $filters) {
+ function calendarQuery(array $filters) {
return $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters);
@@ -428,7 +428,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* @return string|null
*/
- public function getSyncToken() {
+ function getSyncToken() {
if (
$this->caldavBackend instanceof Backend\SyncSupport &&
@@ -451,7 +451,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
*
* This function should return an array, such as the following:
*
- * array(
+ * [
* 'syncToken' => 'The current synctoken',
* 'added' => [
* 'new.txt',
@@ -459,11 +459,11 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* 'modified' => [
* 'modified.txt',
* ],
- * 'deleted' => array(
+ * 'deleted' => [
* 'foo.php.bak',
* 'old.txt'
- * )
- * );
+ * ]
+ * ];
*
* The syncToken property should reflect the *current* syncToken of the
* collection, as reported getSyncToken(). This is needed here too, to
@@ -500,7 +500,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection,
* @param int $limit
* @return array
*/
- public function getChanges($syncToken, $syncLevel, $limit = null) {
+ function getChanges($syncToken, $syncLevel, $limit = null) {
if (!$this->caldavBackend instanceof Backend\SyncSupport) {
return null;
diff --git a/lib/CalDAV/CalendarHome.php b/lib/CalDAV/CalendarHome.php
index 18bec17..4f24a11 100644
--- a/lib/CalDAV/CalendarHome.php
+++ b/lib/CalDAV/CalendarHome.php
@@ -41,7 +41,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* @param Backend\BackendInterface $caldavBackend
* @param mixed $userUri
*/
- public function __construct(Backend\BackendInterface $caldavBackend, $principalInfo) {
+ function __construct(Backend\BackendInterface $caldavBackend, $principalInfo) {
$this->caldavBackend = $caldavBackend;
$this->principalInfo = $principalInfo;
@@ -53,7 +53,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
*
* @return string
*/
- public function getName() {
+ function getName() {
list(,$name) = URLUtil::splitPath($this->principalInfo['uri']);
return $name;
@@ -66,7 +66,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* @param string $name
* @return void
*/
- public function setName($name) {
+ function setName($name) {
throw new DAV\Exception\Forbidden();
@@ -77,7 +77,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
*
* @return void
*/
- public function delete() {
+ function delete() {
throw new DAV\Exception\Forbidden();
@@ -88,7 +88,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
*
* @return int
*/
- public function getLastModified() {
+ function getLastModified() {
return null;
@@ -103,7 +103,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* @param resource $data
* @return void
*/
- public function createFile($filename, $data=null) {
+ function createFile($filename, $data=null) {
throw new DAV\Exception\MethodNotAllowed('Creating new files in this collection is not supported');
@@ -117,7 +117,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* @param string $filename
* @return void
*/
- public function createDirectory($filename) {
+ function createDirectory($filename) {
throw new DAV\Exception\MethodNotAllowed('Creating new collections in this collection is not supported');
@@ -130,7 +130,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* @todo needs optimizing
* @return Calendar
*/
- public function getChild($name) {
+ function getChild($name) {
foreach($this->getChildren() as $child) {
if ($name==$child->getName())
@@ -148,7 +148,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* @todo needs optimizing
* @return bool
*/
- public function childExists($name) {
+ function childExists($name) {
foreach($this->getChildren() as $child) {
if ($name==$child->getName())
@@ -164,10 +164,10 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
*
* @return array
*/
- public function getChildren() {
+ function getChildren() {
$calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']);
- $objs = array();
+ $objs = [];
foreach($calendars as $calendar) {
if ($this->caldavBackend instanceof Backend\SharingSupport) {
if (isset($calendar['{http://calendarserver.org/ns/}shared-url'])) {
@@ -209,7 +209,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* @param array $properties
* @return void
*/
- public function createExtendedCollection($name, array $resourceType, array $properties) {
+ function createExtendedCollection($name, array $resourceType, array $properties) {
$isCalendar = false;
$isSubscription = false;
@@ -252,7 +252,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
*
* @return string|null
*/
- public function getOwner() {
+ function getOwner() {
return $this->principalInfo['uri'];
@@ -265,7 +265,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
*
* @return string|null
*/
- public function getGroup() {
+ function getGroup() {
return null;
@@ -283,36 +283,36 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
*
* @return array
*/
- public function getACL() {
+ function getACL() {
- return array(
- array(
+ return [
+ [
'privilege' => '{DAV:}read',
'principal' => $this->principalInfo['uri'],
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}write',
'principal' => $this->principalInfo['uri'],
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}read',
'principal' => $this->principalInfo['uri'] . '/calendar-proxy-write',
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}write',
'principal' => $this->principalInfo['uri'] . '/calendar-proxy-write',
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}read',
'principal' => $this->principalInfo['uri'] . '/calendar-proxy-read',
'protected' => true,
- ),
+ ],
- );
+ ];
}
@@ -324,7 +324,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* @param array $acl
* @return void
*/
- public function setACL(array $acl) {
+ function setACL(array $acl) {
throw new DAV\Exception\MethodNotAllowed('Changing ACL is not yet supported');
@@ -342,7 +342,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
*
* @return array|null
*/
- public function getSupportedPrivilegeSet() {
+ function getSupportedPrivilegeSet() {
return null;
@@ -361,7 +361,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* @param string $summary A description of the reply
* @return null|string
*/
- public function shareReply($href, $status, $calendarUri, $inReplyTo, $summary = null) {
+ function shareReply($href, $status, $calendarUri, $inReplyTo, $summary = null) {
if (!$this->caldavBackend instanceof Backend\SharingSupport) {
throw new DAV\Exception\NotImplemented('Sharing support is not implemented by this backend.');
@@ -389,7 +389,7 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
* @param string $uid
* @return string|null
*/
- public function getCalendarObjectByUID($uid) {
+ function getCalendarObjectByUID($uid) {
return $this->caldavBackend->getCalendarObjectByUID($this->principalInfo['uri'], $uid);
diff --git a/lib/CalDAV/CalendarObject.php b/lib/CalDAV/CalendarObject.php
index 99b5d5b..b9e525e 100644
--- a/lib/CalDAV/CalendarObject.php
+++ b/lib/CalDAV/CalendarObject.php
@@ -50,7 +50,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
* @param array $calendarInfo
* @param array $objectData
*/
- public function __construct(Backend\BackendInterface $caldavBackend,array $calendarInfo,array $objectData) {
+ function __construct(Backend\BackendInterface $caldavBackend,array $calendarInfo,array $objectData) {
$this->caldavBackend = $caldavBackend;
@@ -71,7 +71,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
*
* @return string
*/
- public function getName() {
+ function getName() {
return $this->objectData['uri'];
@@ -82,7 +82,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
*
* @return string
*/
- public function get() {
+ function get() {
// Pre-populating the 'calendardata' is optional, if we don't have it
// already we fetch it from the backend.
@@ -99,7 +99,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
* @param string|resource $calendarData
* @return string
*/
- public function put($calendarData) {
+ function put($calendarData) {
if (is_resource($calendarData)) {
$calendarData = stream_get_contents($calendarData);
@@ -117,7 +117,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
*
* @return void
*/
- public function delete() {
+ function delete() {
$this->caldavBackend->deleteCalendarObject($this->calendarInfo['id'],$this->objectData['uri']);
@@ -128,7 +128,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
*
* @return string
*/
- public function getContentType() {
+ function getContentType() {
$mime = 'text/calendar; charset=utf-8';
if (isset($this->objectData['component']) && $this->objectData['component']) {
@@ -145,7 +145,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
*
* @return string
*/
- public function getETag() {
+ function getETag() {
if (isset($this->objectData['etag'])) {
return $this->objectData['etag'];
@@ -160,7 +160,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
*
* @return int
*/
- public function getLastModified() {
+ function getLastModified() {
return $this->objectData['lastmodified'];
@@ -171,7 +171,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
*
* @return int
*/
- public function getSize() {
+ function getSize() {
if (array_key_exists('size',$this->objectData)) {
return $this->objectData['size'];
@@ -188,7 +188,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
*
* @return string|null
*/
- public function getOwner() {
+ function getOwner() {
return $this->calendarInfo['principaluri'];
@@ -201,7 +201,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
*
* @return string|null
*/
- public function getGroup() {
+ function getGroup() {
return null;
@@ -219,7 +219,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
*
* @return array
*/
- public function getACL() {
+ function getACL() {
// An alternative acl may be specified in the object data.
if (isset($this->objectData['acl'])) {
@@ -227,34 +227,34 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
}
// The default ACL
- return array(
- array(
+ return [
+ [
'privilege' => '{DAV:}read',
'principal' => $this->calendarInfo['principaluri'],
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}write',
'principal' => $this->calendarInfo['principaluri'],
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}read',
'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-write',
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}write',
'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-write',
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}read',
'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-read',
'protected' => true,
- ),
+ ],
- );
+ ];
}
@@ -266,7 +266,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
* @param array $acl
* @return void
*/
- public function setACL(array $acl) {
+ function setACL(array $acl) {
throw new \Sabre\DAV\Exception\MethodNotAllowed('Changing ACL is not yet supported');
@@ -284,7 +284,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
*
* @return array|null
*/
- public function getSupportedPrivilegeSet() {
+ function getSupportedPrivilegeSet() {
return null;
diff --git a/lib/CalDAV/CalendarQueryParser.php b/lib/CalDAV/CalendarQueryParser.php
index e34a2ec..4df15d3 100644
--- a/lib/CalDAV/CalendarQueryParser.php
+++ b/lib/CalDAV/CalendarQueryParser.php
@@ -64,7 +64,7 @@ class CalendarQueryParser {
*
* @param \DOMDocument $dom
*/
- public function __construct(\DOMDocument $dom) {
+ function __construct(\DOMDocument $dom) {
$this->dom = $dom;
$this->xpath = new \DOMXPath($dom);
@@ -78,7 +78,7 @@ class CalendarQueryParser {
*
* @return void
*/
- public function parse() {
+ function parse() {
$filterNode = null;
@@ -112,26 +112,26 @@ class CalendarQueryParser {
protected function parseCompFilters(\DOMElement $parentNode) {
$compFilterNodes = $this->xpath->query('cal:comp-filter', $parentNode);
- $result = array();
+ $result = [];
for($ii=0; $ii < $compFilterNodes->length; $ii++) {
$compFilterNode = $compFilterNodes->item($ii);
- $compFilter = array();
+ $compFilter = [];
$compFilter['name'] = $compFilterNode->getAttribute('name');
$compFilter['is-not-defined'] = $this->xpath->query('cal:is-not-defined', $compFilterNode)->length>0;
$compFilter['comp-filters'] = $this->parseCompFilters($compFilterNode);
$compFilter['prop-filters'] = $this->parsePropFilters($compFilterNode);
$compFilter['time-range'] = $this->parseTimeRange($compFilterNode);
- if ($compFilter['time-range'] && !in_array($compFilter['name'],array(
+ if ($compFilter['time-range'] && !in_array($compFilter['name'], [
'VEVENT',
'VTODO',
'VJOURNAL',
'VFREEBUSY',
'VALARM',
- ))) {
+ ])) {
throw new \Sabre\DAV\Exception\BadRequest('The time-range filter is not defined for the ' . $compFilter['name'] . ' component');
};
@@ -152,12 +152,12 @@ class CalendarQueryParser {
protected function parsePropFilters(\DOMElement $parentNode) {
$propFilterNodes = $this->xpath->query('cal:prop-filter', $parentNode);
- $result = array();
+ $result = [];
for ($ii=0; $ii < $propFilterNodes->length; $ii++) {
$propFilterNode = $propFilterNodes->item($ii);
- $propFilter = array();
+ $propFilter = [];
$propFilter['name'] = $propFilterNode->getAttribute('name');
$propFilter['is-not-defined'] = $this->xpath->query('cal:is-not-defined', $propFilterNode)->length>0;
$propFilter['param-filters'] = $this->parseParamFilters($propFilterNode);
@@ -181,12 +181,12 @@ class CalendarQueryParser {
protected function parseParamFilters(\DOMElement $parentNode) {
$paramFilterNodes = $this->xpath->query('cal:param-filter', $parentNode);
- $result = array();
+ $result = [];
for($ii=0;$ii<$paramFilterNodes->length;$ii++) {
$paramFilterNode = $paramFilterNodes->item($ii);
- $paramFilter = array();
+ $paramFilter = [];
$paramFilter['name'] = $paramFilterNode->getAttribute('name');
$paramFilter['is-not-defined'] = $this->xpath->query('cal:is-not-defined', $paramFilterNode)->length>0;
$paramFilter['text-match'] = $this->parseTextMatch($paramFilterNode);
@@ -218,11 +218,11 @@ class CalendarQueryParser {
$collation = $textMatchNode->getAttribute('collation');
if (!$collation) $collation = 'i;ascii-casemap';
- return array(
+ return [
'negate-condition' => $negateCondition,
'collation' => $collation,
'value' => $textMatchNode->nodeValue
- );
+ ];
}
@@ -256,10 +256,10 @@ class CalendarQueryParser {
throw new \Sabre\DAV\Exception\BadRequest('The end-date must be larger than the start-date in the time-range filter');
}
- return array(
+ return [
'start' => $start,
'end' => $end,
- );
+ ];
}
@@ -291,10 +291,10 @@ class CalendarQueryParser {
throw new \Sabre\DAV\Exception\BadRequest('The end-date must be larger than the start-date in the expand element.');
}
- return array(
+ return [
'start' => $start,
'end' => $end,
- );
+ ];
}
diff --git a/lib/CalDAV/CalendarQueryValidator.php b/lib/CalDAV/CalendarQueryValidator.php
index ddc5a59..b5e8dde 100644
--- a/lib/CalDAV/CalendarQueryValidator.php
+++ b/lib/CalDAV/CalendarQueryValidator.php
@@ -29,7 +29,7 @@ class CalendarQueryValidator {
* @param array $filters
* @return bool
*/
- public function validate(VObject\Component\VCalendar $vObject,array $filters) {
+ function validate(VObject\Component\VCalendar $vObject,array $filters) {
// The top level object is always a component filter.
// We'll parse it manually, as it's pretty simple.
diff --git a/lib/CalDAV/CalendarRoot.php b/lib/CalDAV/CalendarRoot.php
index 94f98cb..b2e1bdb 100644
--- a/lib/CalDAV/CalendarRoot.php
+++ b/lib/CalDAV/CalendarRoot.php
@@ -40,7 +40,7 @@ class CalendarRoot extends \Sabre\DAVACL\AbstractPrincipalCollection {
* @param Backend\BackendInterface $caldavBackend
* @param string $principalPrefix
*/
- public function __construct(PrincipalBackend\BackendInterface $principalBackend,Backend\BackendInterface $caldavBackend, $principalPrefix = 'principals') {
+ function __construct(PrincipalBackend\BackendInterface $principalBackend,Backend\BackendInterface $caldavBackend, $principalPrefix = 'principals') {
parent::__construct($principalBackend, $principalPrefix);
$this->caldavBackend = $caldavBackend;
@@ -55,7 +55,7 @@ class CalendarRoot extends \Sabre\DAVACL\AbstractPrincipalCollection {
*
* @return string
*/
- public function getName() {
+ function getName() {
return Plugin::CALENDAR_ROOT;
@@ -71,7 +71,7 @@ class CalendarRoot extends \Sabre\DAVACL\AbstractPrincipalCollection {
* @param array $principal
* @return \Sabre\DAV\INode
*/
- public function getChildForPrincipal(array $principal) {
+ function getChildForPrincipal(array $principal) {
return new CalendarHome($this->caldavBackend, $principal);
diff --git a/lib/CalDAV/Exception/InvalidComponentType.php b/lib/CalDAV/Exception/InvalidComponentType.php
index f2a64e3..a3e4767 100644
--- a/lib/CalDAV/Exception/InvalidComponentType.php
+++ b/lib/CalDAV/Exception/InvalidComponentType.php
@@ -23,7 +23,7 @@ class InvalidComponentType extends DAV\Exception\Forbidden {
* @param \DOMElement $errorNode
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $errorNode) {
+ function serialize(DAV\Server $server, \DOMElement $errorNode) {
$doc = $errorNode->ownerDocument;
diff --git a/lib/CalDAV/ICSExportPlugin.php b/lib/CalDAV/ICSExportPlugin.php
index 22007a8..829c961 100644
--- a/lib/CalDAV/ICSExportPlugin.php
+++ b/lib/CalDAV/ICSExportPlugin.php
@@ -59,7 +59,7 @@ class ICSExportPlugin extends DAV\ServerPlugin {
* @param \Sabre\DAV\Server $server
* @return void
*/
- public function initialize(DAV\Server $server) {
+ function initialize(DAV\Server $server) {
$this->server = $server;
$this->server->on('method:GET', [$this,'httpGet'], 90);
@@ -73,7 +73,7 @@ class ICSExportPlugin extends DAV\ServerPlugin {
* @param ResponseInterface $response
* @return bool
*/
- public function httpGet(RequestInterface $request, ResponseInterface $response) {
+ function httpGet(RequestInterface $request, ResponseInterface $response) {
$queryParams = $request->getQueryParameters();
if (!array_key_exists('export', $queryParams)) return;
@@ -236,7 +236,7 @@ class ICSExportPlugin extends DAV\ServerPlugin {
* @param array $inputObjects
* @return VObject\Component\VCalendar
*/
- public function mergeObjects(array $properties, array $inputObjects) {
+ function mergeObjects(array $properties, array $inputObjects) {
$calendar = new VObject\Component\VCalendar();
$calendar->version = '2.0';
diff --git a/lib/CalDAV/ICalendar.php b/lib/CalDAV/ICalendar.php
index 871b1c6..ec337d3 100644
--- a/lib/CalDAV/ICalendar.php
+++ b/lib/CalDAV/ICalendar.php
@@ -16,5 +16,4 @@ use Sabre\DAVACL;
*/
interface ICalendar extends ICalendarObjectContainer, DAVACL\IACL {
-
}
diff --git a/lib/CalDAV/ICalendarObject.php b/lib/CalDAV/ICalendarObject.php
index 0776abf..0995723 100644
--- a/lib/CalDAV/ICalendarObject.php
+++ b/lib/CalDAV/ICalendarObject.php
@@ -18,4 +18,3 @@ use Sabre\DAV;
interface ICalendarObject extends DAV\IFile {
}
-
diff --git a/lib/CalDAV/ICalendarObjectContainer.php b/lib/CalDAV/ICalendarObjectContainer.php
index 8bd1e9a..d562dbe 100644
--- a/lib/CalDAV/ICalendarObjectContainer.php
+++ b/lib/CalDAV/ICalendarObjectContainer.php
@@ -34,7 +34,6 @@ interface ICalendarObjectContainer extends \Sabre\DAV\ICollection {
* @param array $filters
* @return array
*/
- public function calendarQuery(array $filters);
-
+ function calendarQuery(array $filters);
}
diff --git a/lib/CalDAV/Notifications/Collection.php b/lib/CalDAV/Notifications/Collection.php
index 028b00d..35498c4 100644
--- a/lib/CalDAV/Notifications/Collection.php
+++ b/lib/CalDAV/Notifications/Collection.php
@@ -42,7 +42,7 @@ class Collection extends DAV\Collection implements ICollection, DAVACL\IACL {
* @param CalDAV\Backend\NotificationSupport $caldavBackend
* @param string $principalUri
*/
- public function __construct(CalDAV\Backend\NotificationSupport $caldavBackend, $principalUri) {
+ function __construct(CalDAV\Backend\NotificationSupport $caldavBackend, $principalUri) {
$this->caldavBackend = $caldavBackend;
$this->principalUri = $principalUri;
@@ -54,9 +54,9 @@ class Collection extends DAV\Collection implements ICollection, DAVACL\IACL {
*
* @return array
*/
- public function getChildren() {
+ function getChildren() {
- $children = array();
+ $children = [];
$notifications = $this->caldavBackend->getNotificationsForPrincipal($this->principalUri);
foreach($notifications as $notification) {
@@ -77,7 +77,7 @@ class Collection extends DAV\Collection implements ICollection, DAVACL\IACL {
*
* @return string
*/
- public function getName() {
+ function getName() {
return 'notifications';
@@ -90,7 +90,7 @@ class Collection extends DAV\Collection implements ICollection, DAVACL\IACL {
*
* @return string|null
*/
- public function getOwner() {
+ function getOwner() {
return $this->principalUri;
@@ -103,7 +103,7 @@ class Collection extends DAV\Collection implements ICollection, DAVACL\IACL {
*
* @return string|null
*/
- public function getGroup() {
+ function getGroup() {
return null;
@@ -121,20 +121,20 @@ class Collection extends DAV\Collection implements ICollection, DAVACL\IACL {
*
* @return array
*/
- public function getACL() {
+ function getACL() {
- return array(
- array(
+ return [
+ [
'principal' => $this->getOwner(),
'privilege' => '{DAV:}read',
'protected' => true,
- ),
- array(
+ ],
+ [
'principal' => $this->getOwner(),
'privilege' => '{DAV:}write',
'protected' => true,
- )
- );
+ ]
+ ];
}
@@ -146,7 +146,7 @@ class Collection extends DAV\Collection implements ICollection, DAVACL\IACL {
* @param array $acl
* @return void
*/
- public function setACL(array $acl) {
+ function setACL(array $acl) {
throw new DAV\Exception\NotImplemented('Updating ACLs is not implemented here');
@@ -164,7 +164,7 @@ class Collection extends DAV\Collection implements ICollection, DAVACL\IACL {
*
* @return array|null
*/
- public function getSupportedPrivilegeSet() {
+ function getSupportedPrivilegeSet() {
return null;
diff --git a/lib/CalDAV/Notifications/ICollection.php b/lib/CalDAV/Notifications/ICollection.php
index 26e13b2..cfe0240 100644
--- a/lib/CalDAV/Notifications/ICollection.php
+++ b/lib/CalDAV/Notifications/ICollection.php
@@ -20,5 +20,4 @@ use Sabre\DAV;
*/
interface ICollection extends DAV\ICollection {
-
}
diff --git a/lib/CalDAV/Notifications/Node.php b/lib/CalDAV/Notifications/Node.php
index 6367e93..6999b62 100644
--- a/lib/CalDAV/Notifications/Node.php
+++ b/lib/CalDAV/Notifications/Node.php
@@ -47,7 +47,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
* @param string $principalUri
* @param CalDAV\Notifications\INotificationType $notification
*/
- public function __construct(CalDAV\Backend\NotificationSupport $caldavBackend, $principalUri, INotificationType $notification) {
+ function __construct(CalDAV\Backend\NotificationSupport $caldavBackend, $principalUri, INotificationType $notification) {
$this->caldavBackend = $caldavBackend;
$this->principalUri = $principalUri;
@@ -60,7 +60,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
*
* @return id
*/
- public function getName() {
+ function getName() {
return $this->notification->getId() . '.xml';
@@ -73,7 +73,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
*
* @return string
*/
- public function getETag() {
+ function getETag() {
return $this->notification->getETag();
@@ -85,7 +85,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
*
* @return INotificationType
*/
- public function getNotificationType() {
+ function getNotificationType() {
return $this->notification;
@@ -96,7 +96,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
*
* @return void
*/
- public function delete() {
+ function delete() {
$this->caldavBackend->deleteNotification($this->getOwner(), $this->notification);
@@ -109,7 +109,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
*
* @return string|null
*/
- public function getOwner() {
+ function getOwner() {
return $this->principalUri;
@@ -122,7 +122,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
*
* @return string|null
*/
- public function getGroup() {
+ function getGroup() {
return null;
@@ -140,20 +140,20 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
*
* @return array
*/
- public function getACL() {
+ function getACL() {
- return array(
- array(
+ return [
+ [
'principal' => $this->getOwner(),
'privilege' => '{DAV:}read',
'protected' => true,
- ),
- array(
+ ],
+ [
'principal' => $this->getOwner(),
'privilege' => '{DAV:}write',
'protected' => true,
- )
- );
+ ]
+ ];
}
@@ -165,7 +165,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
* @param array $acl
* @return void
*/
- public function setACL(array $acl) {
+ function setACL(array $acl) {
throw new DAV\Exception\NotImplemented('Updating ACLs is not implemented here');
@@ -183,7 +183,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL {
*
* @return array|null
*/
- public function getSupportedPrivilegeSet() {
+ function getSupportedPrivilegeSet() {
return null;
diff --git a/lib/CalDAV/Notifications/Notification/Invite.php b/lib/CalDAV/Notifications/Notification/Invite.php
index 8d6974d..a34ab0f 100644
--- a/lib/CalDAV/Notifications/Notification/Invite.php
+++ b/lib/CalDAV/Notifications/Notification/Invite.php
@@ -134,9 +134,9 @@ class Invite extends DAV\Property implements CalDAV\Notifications\INotificationT
*
* @param array $values All the options
*/
- public function __construct(array $values) {
+ function __construct(array $values) {
- $required = array(
+ $required = [
'id',
'etag',
'href',
@@ -145,7 +145,7 @@ class Invite extends DAV\Property implements CalDAV\Notifications\INotificationT
'readOnly',
'hostUrl',
'organizer',
- );
+ ];
foreach($required as $item) {
if (!isset($values[$item])) {
throw new \InvalidArgumentException($item . ' is a required constructor option');
@@ -171,7 +171,7 @@ class Invite extends DAV\Property implements CalDAV\Notifications\INotificationT
* @param \DOMElement $node
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $node) {
+ function serialize(DAV\Server $server, \DOMElement $node) {
$prop = $node->ownerDocument->createElement('cs:invite-notification');
$node->appendChild($prop);
@@ -186,7 +186,7 @@ class Invite extends DAV\Property implements CalDAV\Notifications\INotificationT
* @param \DOMElement $node
* @return void
*/
- public function serializeBody(DAV\Server $server, \DOMElement $node) {
+ function serializeBody(DAV\Server $server, \DOMElement $node) {
$doc = $node->ownerDocument;
@@ -302,7 +302,7 @@ class Invite extends DAV\Property implements CalDAV\Notifications\INotificationT
*
* @return string
*/
- public function getId() {
+ function getId() {
return $this->id;
@@ -315,7 +315,7 @@ class Invite extends DAV\Property implements CalDAV\Notifications\INotificationT
*
* @return string
*/
- public function getETag() {
+ function getETag() {
return $this->etag;
diff --git a/lib/CalDAV/Notifications/Notification/InviteReply.php b/lib/CalDAV/Notifications/Notification/InviteReply.php
index e407513..52aee02 100644
--- a/lib/CalDAV/Notifications/Notification/InviteReply.php
+++ b/lib/CalDAV/Notifications/Notification/InviteReply.php
@@ -87,9 +87,9 @@ class InviteReply extends DAV\Property implements CalDAV\Notifications\INotifica
* * summary - Description of the share, can be the same as the
* calendar, but may also be modified (optional).
*/
- public function __construct(array $values) {
+ function __construct(array $values) {
- $required = array(
+ $required = [
'id',
'etag',
'href',
@@ -97,7 +97,7 @@ class InviteReply extends DAV\Property implements CalDAV\Notifications\INotifica
'inReplyTo',
'type',
'hostUrl',
- );
+ ];
foreach($required as $item) {
if (!isset($values[$item])) {
throw new \InvalidArgumentException($item . ' is a required constructor option');
@@ -123,7 +123,7 @@ class InviteReply extends DAV\Property implements CalDAV\Notifications\INotifica
* @param \DOMElement $node
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $node) {
+ function serialize(DAV\Server $server, \DOMElement $node) {
$prop = $node->ownerDocument->createElement('cs:invite-reply');
$node->appendChild($prop);
@@ -138,7 +138,7 @@ class InviteReply extends DAV\Property implements CalDAV\Notifications\INotifica
* @param \DOMElement $node
* @return void
*/
- public function serializeBody(DAV\Server $server, \DOMElement $node) {
+ function serializeBody(DAV\Server $server, \DOMElement $node) {
$doc = $node->ownerDocument;
@@ -197,7 +197,7 @@ class InviteReply extends DAV\Property implements CalDAV\Notifications\INotifica
*
* @return string
*/
- public function getId() {
+ function getId() {
return $this->id;
@@ -210,7 +210,7 @@ class InviteReply extends DAV\Property implements CalDAV\Notifications\INotifica
*
* @return string
*/
- public function getETag() {
+ function getETag() {
return $this->etag;
diff --git a/lib/CalDAV/Notifications/Notification/SystemStatus.php b/lib/CalDAV/Notifications/Notification/SystemStatus.php
index 608892d..6f39819 100644
--- a/lib/CalDAV/Notifications/Notification/SystemStatus.php
+++ b/lib/CalDAV/Notifications/Notification/SystemStatus.php
@@ -68,7 +68,7 @@ class SystemStatus extends DAV\Property implements CalDAV\Notifications\INotific
* @param string $description
* @param string $href
*/
- public function __construct($id, $etag, $type = self::TYPE_HIGH, $description = null, $href = null) {
+ function __construct($id, $etag, $type = self::TYPE_HIGH, $description = null, $href = null) {
$this->id = $id;
$this->type = $type;
@@ -88,7 +88,7 @@ class SystemStatus extends DAV\Property implements CalDAV\Notifications\INotific
* @param \DOMElement $node
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $node) {
+ function serialize(DAV\Server $server, \DOMElement $node) {
switch($this->type) {
case self::TYPE_LOW :
@@ -118,7 +118,7 @@ class SystemStatus extends DAV\Property implements CalDAV\Notifications\INotific
* @param \DOMElement $node
* @return void
*/
- public function serializeBody(DAV\Server $server, \DOMElement $node) {
+ function serializeBody(DAV\Server $server, \DOMElement $node) {
switch($this->type) {
case self::TYPE_LOW :
@@ -161,7 +161,7 @@ class SystemStatus extends DAV\Property implements CalDAV\Notifications\INotific
*
* @return string
*/
- public function getId() {
+ function getId() {
return $this->id;
@@ -174,7 +174,7 @@ class SystemStatus extends DAV\Property implements CalDAV\Notifications\INotific
*
* @return string
*/
- public function getETag() {
+ function getETag() {
return $this->etag;
diff --git a/lib/CalDAV/Principal/Collection.php b/lib/CalDAV/Principal/Collection.php
index 8a747a6..1ead53f 100644
--- a/lib/CalDAV/Principal/Collection.php
+++ b/lib/CalDAV/Principal/Collection.php
@@ -23,7 +23,7 @@ class Collection extends DAVACL\AbstractPrincipalCollection {
* @param array $principalInfo
* @return User
*/
- public function getChildForPrincipal(array $principalInfo) {
+ function getChildForPrincipal(array $principalInfo) {
return new User($this->principalBackend, $principalInfo);
diff --git a/lib/CalDAV/Principal/ProxyRead.php b/lib/CalDAV/Principal/ProxyRead.php
index 62f66b9..22b39ad 100644
--- a/lib/CalDAV/Principal/ProxyRead.php
+++ b/lib/CalDAV/Principal/ProxyRead.php
@@ -39,7 +39,7 @@ class ProxyRead implements IProxyRead {
* @param DAVACL\PrincipalBackend\BackendInterface $principalBackend
* @param array $principalInfo
*/
- public function __construct(DAVACL\PrincipalBackend\BackendInterface $principalBackend, array $principalInfo) {
+ function __construct(DAVACL\PrincipalBackend\BackendInterface $principalBackend, array $principalInfo) {
$this->principalInfo = $principalInfo;
$this->principalBackend = $principalBackend;
@@ -51,7 +51,7 @@ class ProxyRead implements IProxyRead {
*
* @return string
*/
- public function getName() {
+ function getName() {
return 'calendar-proxy-read';
@@ -62,7 +62,7 @@ class ProxyRead implements IProxyRead {
*
* @return null
*/
- public function getLastModified() {
+ function getLastModified() {
return null;
@@ -74,7 +74,7 @@ class ProxyRead implements IProxyRead {
* @throws DAV\Exception\Forbidden
* @return void
*/
- public function delete() {
+ function delete() {
throw new DAV\Exception\Forbidden('Permission denied to delete node');
@@ -87,7 +87,7 @@ class ProxyRead implements IProxyRead {
* @param string $name The new name
* @return void
*/
- public function setName($name) {
+ function setName($name) {
throw new DAV\Exception\Forbidden('Permission denied to rename file');
@@ -101,9 +101,9 @@ class ProxyRead implements IProxyRead {
*
* @return array
*/
- public function getAlternateUriSet() {
+ function getAlternateUriSet() {
- return array();
+ return [];
}
@@ -112,7 +112,7 @@ class ProxyRead implements IProxyRead {
*
* @return string
*/
- public function getPrincipalUrl() {
+ function getPrincipalUrl() {
return $this->principalInfo['uri'] . '/' . $this->getName();
@@ -126,7 +126,7 @@ class ProxyRead implements IProxyRead {
*
* @return array
*/
- public function getGroupMemberSet() {
+ function getGroupMemberSet() {
return $this->principalBackend->getGroupMemberSet($this->getPrincipalUrl());
@@ -140,7 +140,7 @@ class ProxyRead implements IProxyRead {
*
* @return array
*/
- public function getGroupMembership() {
+ function getGroupMembership() {
return $this->principalBackend->getGroupMembership($this->getPrincipalUrl());
@@ -157,7 +157,7 @@ class ProxyRead implements IProxyRead {
* @param array $principals
* @return void
*/
- public function setGroupMemberSet(array $principals) {
+ function setGroupMemberSet(array $principals) {
$this->principalBackend->setGroupMemberSet($this->getPrincipalUrl(), $principals);
@@ -171,7 +171,7 @@ class ProxyRead implements IProxyRead {
*
* @return string
*/
- public function getDisplayName() {
+ function getDisplayName() {
return $this->getName();
diff --git a/lib/CalDAV/Principal/ProxyWrite.php b/lib/CalDAV/Principal/ProxyWrite.php
index 02cd81f..72da356 100644
--- a/lib/CalDAV/Principal/ProxyWrite.php
+++ b/lib/CalDAV/Principal/ProxyWrite.php
@@ -39,7 +39,7 @@ class ProxyWrite implements IProxyWrite {
* @param DAVACL\PrincipalBackend\BackendInterface $principalBackend
* @param array $principalInfo
*/
- public function __construct(DAVACL\PrincipalBackend\BackendInterface $principalBackend, array $principalInfo) {
+ function __construct(DAVACL\PrincipalBackend\BackendInterface $principalBackend, array $principalInfo) {
$this->principalInfo = $principalInfo;
$this->principalBackend = $principalBackend;
@@ -51,7 +51,7 @@ class ProxyWrite implements IProxyWrite {
*
* @return string
*/
- public function getName() {
+ function getName() {
return 'calendar-proxy-write';
@@ -62,7 +62,7 @@ class ProxyWrite implements IProxyWrite {
*
* @return null
*/
- public function getLastModified() {
+ function getLastModified() {
return null;
@@ -74,7 +74,7 @@ class ProxyWrite implements IProxyWrite {
* @throws DAV\Exception\Forbidden
* @return void
*/
- public function delete() {
+ function delete() {
throw new DAV\Exception\Forbidden('Permission denied to delete node');
@@ -87,7 +87,7 @@ class ProxyWrite implements IProxyWrite {
* @param string $name The new name
* @return void
*/
- public function setName($name) {
+ function setName($name) {
throw new DAV\Exception\Forbidden('Permission denied to rename file');
@@ -101,7 +101,7 @@ class ProxyWrite implements IProxyWrite {
*
* @return array
*/
- public function getAlternateUriSet() {
+ function getAlternateUriSet() {
return array();
@@ -112,7 +112,7 @@ class ProxyWrite implements IProxyWrite {
*
* @return string
*/
- public function getPrincipalUrl() {
+ function getPrincipalUrl() {
return $this->principalInfo['uri'] . '/' . $this->getName();
@@ -126,7 +126,7 @@ class ProxyWrite implements IProxyWrite {
*
* @return array
*/
- public function getGroupMemberSet() {
+ function getGroupMemberSet() {
return $this->principalBackend->getGroupMemberSet($this->getPrincipalUrl());
@@ -140,7 +140,7 @@ class ProxyWrite implements IProxyWrite {
*
* @return array
*/
- public function getGroupMembership() {
+ function getGroupMembership() {
return $this->principalBackend->getGroupMembership($this->getPrincipalUrl());
@@ -157,7 +157,7 @@ class ProxyWrite implements IProxyWrite {
* @param array $principals
* @return void
*/
- public function setGroupMemberSet(array $principals) {
+ function setGroupMemberSet(array $principals) {
$this->principalBackend->setGroupMemberSet($this->getPrincipalUrl(), $principals);
@@ -171,7 +171,7 @@ class ProxyWrite implements IProxyWrite {
*
* @return string
*/
- public function getDisplayName() {
+ function getDisplayName() {
return $this->getName();
diff --git a/lib/CalDAV/Principal/User.php b/lib/CalDAV/Principal/User.php
index 6f3ccb8..9fe8cd2 100644
--- a/lib/CalDAV/Principal/User.php
+++ b/lib/CalDAV/Principal/User.php
@@ -25,7 +25,7 @@ class User extends DAVACL\Principal implements DAV\ICollection {
* @throws DAV\Exception\Forbidden
* @return void
*/
- public function createFile($name, $data = null) {
+ function createFile($name, $data = null) {
throw new DAV\Exception\Forbidden('Permission denied to create file (filename ' . $name . ')');
@@ -38,7 +38,7 @@ class User extends DAVACL\Principal implements DAV\ICollection {
* @throws DAV\Exception\Forbidden
* @return void
*/
- public function createDirectory($name) {
+ function createDirectory($name) {
throw new DAV\Exception\Forbidden('Permission denied to create directory');
@@ -50,7 +50,7 @@ class User extends DAVACL\Principal implements DAV\ICollection {
* @param string $name
* @return DAV\INode
*/
- public function getChild($name) {
+ function getChild($name) {
$principal = $this->principalBackend->getPrincipalByPath($this->getPrincipalURL() . '/' . $name);
if (!$principal) {
@@ -71,9 +71,9 @@ class User extends DAVACL\Principal implements DAV\ICollection {
*
* @return DAV\INode[]
*/
- public function getChildren() {
+ function getChildren() {
- $r = array();
+ $r = [];
if ($this->principalBackend->getPrincipalByPath($this->getPrincipalURL() . '/calendar-proxy-read')) {
$r[] = new ProxyRead($this->principalBackend, $this->principalProperties);
}
@@ -91,7 +91,7 @@ class User extends DAVACL\Principal implements DAV\ICollection {
* @param string $name
* @return bool
*/
- public function childExists($name) {
+ function childExists($name) {
try {
$this->getChild($name);
@@ -114,19 +114,19 @@ class User extends DAVACL\Principal implements DAV\ICollection {
*
* @return array
*/
- public function getACL() {
+ function getACL() {
$acl = parent::getACL();
- $acl[] = array(
+ $acl[] = [
'privilege' => '{DAV:}read',
'principal' => $this->principalProperties['uri'] . '/calendar-proxy-read',
'protected' => true,
- );
- $acl[] = array(
+ ];
+ $acl[] = [
'privilege' => '{DAV:}read',
'principal' => $this->principalProperties['uri'] . '/calendar-proxy-write',
'protected' => true,
- );
+ ];
return $acl;
}
diff --git a/lib/CalDAV/Property/AllowedSharingModes.php b/lib/CalDAV/Property/AllowedSharingModes.php
index 3596a64..4eceba5 100644
--- a/lib/CalDAV/Property/AllowedSharingModes.php
+++ b/lib/CalDAV/Property/AllowedSharingModes.php
@@ -43,7 +43,7 @@ class AllowedSharingModes extends DAV\Property {
* @param bool $canBePublished
* @return void
*/
- public function __construct($canBeShared, $canBePublished) {
+ function __construct($canBeShared, $canBePublished) {
$this->canBeShared = $canBeShared;
$this->canBePublished = $canBePublished;
@@ -57,7 +57,7 @@ class AllowedSharingModes extends DAV\Property {
* @param \DOMElement $node
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $node) {
+ function serialize(DAV\Server $server, \DOMElement $node) {
$doc = $node->ownerDocument;
if ($this->canBeShared) {
diff --git a/lib/CalDAV/Property/EmailAddressSet.php b/lib/CalDAV/Property/EmailAddressSet.php
index 2bb73d8..09083ba 100644
--- a/lib/CalDAV/Property/EmailAddressSet.php
+++ b/lib/CalDAV/Property/EmailAddressSet.php
@@ -30,7 +30,7 @@ class EmailAddressSet extends DAV\Property {
*
* @param array $emails
*/
- public function __construct(array $emails) {
+ function __construct(array $emails) {
$this->emails = $emails;
@@ -41,7 +41,7 @@ class EmailAddressSet extends DAV\Property {
*
* @return array
*/
- public function getValue() {
+ function getValue() {
return $this->emails;
@@ -56,7 +56,7 @@ class EmailAddressSet extends DAV\Property {
* @param \DOMElement $dom
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $dom) {
+ function serialize(DAV\Server $server,\DOMElement $dom) {
$prefix = $server->xmlNamespaces['http://calendarserver.org/ns/'];
diff --git a/lib/CalDAV/Property/Invite.php b/lib/CalDAV/Property/Invite.php
index b430adb..3b928f8 100644
--- a/lib/CalDAV/Property/Invite.php
+++ b/lib/CalDAV/Property/Invite.php
@@ -61,7 +61,7 @@ class Invite extends DAV\Property {
*
* @param array $users
*/
- public function __construct(array $users, array $organizer = null) {
+ function __construct(array $users, array $organizer = null) {
$this->users = $users;
$this->organizer = $organizer;
@@ -73,7 +73,7 @@ class Invite extends DAV\Property {
*
* @return array
*/
- public function getValue() {
+ function getValue() {
return $this->users;
@@ -86,7 +86,7 @@ class Invite extends DAV\Property {
* @param \DOMElement $node
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $node) {
+ function serialize(DAV\Server $server,\DOMElement $node) {
$doc = $node->ownerDocument;
diff --git a/lib/CalDAV/Property/ScheduleCalendarTransp.php b/lib/CalDAV/Property/ScheduleCalendarTransp.php
index b21284a..2339295 100644
--- a/lib/CalDAV/Property/ScheduleCalendarTransp.php
+++ b/lib/CalDAV/Property/ScheduleCalendarTransp.php
@@ -31,7 +31,7 @@ class ScheduleCalendarTransp extends DAV\Property {
*
* @param string $value
*/
- public function __construct($value) {
+ function __construct($value) {
if ($value !== self::TRANSPARENT && $value !== self::OPAQUE) {
throw new \InvalidArgumentException('The value must either be specified as "transparent" or "opaque"');
@@ -45,7 +45,7 @@ class ScheduleCalendarTransp extends DAV\Property {
*
* @return string
*/
- public function getValue() {
+ function getValue() {
return $this->value;
@@ -58,7 +58,7 @@ class ScheduleCalendarTransp extends DAV\Property {
* @param \DOMElement $node
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $node) {
+ function serialize(DAV\Server $server,\DOMElement $node) {
$doc = $node->ownerDocument;
switch($this->value) {
diff --git a/lib/CalDAV/Property/SupportedCalendarComponentSet.php b/lib/CalDAV/Property/SupportedCalendarComponentSet.php
index d54ff0f..156a1e0 100644
--- a/lib/CalDAV/Property/SupportedCalendarComponentSet.php
+++ b/lib/CalDAV/Property/SupportedCalendarComponentSet.php
@@ -30,7 +30,7 @@ class SupportedCalendarComponentSet extends DAV\Property {
*
* @param array $components
*/
- public function __construct(array $components) {
+ function __construct(array $components) {
$this->components = $components;
@@ -41,7 +41,7 @@ class SupportedCalendarComponentSet extends DAV\Property {
*
* @return array
*/
- public function getValue() {
+ function getValue() {
return $this->components;
@@ -54,7 +54,7 @@ class SupportedCalendarComponentSet extends DAV\Property {
* @param \DOMElement $node
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $node) {
+ function serialize(DAV\Server $server,\DOMElement $node) {
$doc = $node->ownerDocument;
foreach($this->components as $component) {
diff --git a/lib/CalDAV/Property/SupportedCalendarData.php b/lib/CalDAV/Property/SupportedCalendarData.php
index 632c8c3..40f17a7 100644
--- a/lib/CalDAV/Property/SupportedCalendarData.php
+++ b/lib/CalDAV/Property/SupportedCalendarData.php
@@ -24,7 +24,7 @@ class SupportedCalendarData extends DAV\Property {
* @param \DOMElement $node
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $node) {
+ function serialize(DAV\Server $server,\DOMElement $node) {
$doc = $node->ownerDocument;
diff --git a/lib/CalDAV/Property/SupportedCollationSet.php b/lib/CalDAV/Property/SupportedCollationSet.php
index 63c37fe..4c2841a 100644
--- a/lib/CalDAV/Property/SupportedCollationSet.php
+++ b/lib/CalDAV/Property/SupportedCollationSet.php
@@ -22,7 +22,7 @@ class SupportedCollationSet extends DAV\Property {
* @param \DOMElement $node
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $node) {
+ function serialize(DAV\Server $server,\DOMElement $node) {
$doc = $node->ownerDocument;
diff --git a/lib/CalDAV/Schedule/IMipPlugin.php b/lib/CalDAV/Schedule/IMipPlugin.php
index b885451..95761a3 100644
--- a/lib/CalDAV/Schedule/IMipPlugin.php
+++ b/lib/CalDAV/Schedule/IMipPlugin.php
@@ -51,7 +51,7 @@ class IMipPlugin extends DAV\ServerPlugin {
* generally be some kind of no-reply email
* address you own.
*/
- public function __construct($senderEmail) {
+ function __construct($senderEmail) {
$this->senderEmail = $senderEmail;
@@ -68,7 +68,7 @@ class IMipPlugin extends DAV\ServerPlugin {
* @param Server $server
* @return void
*/
- public function initialize(DAV\Server $server) {
+ function initialize(DAV\Server $server) {
$server->on('schedule', [$this, 'schedule']);
@@ -82,7 +82,7 @@ class IMipPlugin extends DAV\ServerPlugin {
*
* @return string
*/
- public function getPluginName() {
+ function getPluginName() {
return 'imip';
@@ -94,7 +94,7 @@ class IMipPlugin extends DAV\ServerPlugin {
* @param ITip\Message $iTipMessage
* @return void
*/
- public function schedule(ITip\Message $iTipMessage) {
+ function schedule(ITip\Message $iTipMessage) {
$summary = $iTipMessage->message->VEVENT->SUMMARY;
diff --git a/lib/CalDAV/Schedule/IOutbox.php b/lib/CalDAV/Schedule/IOutbox.php
index 7341eaa..6b7bdea 100644
--- a/lib/CalDAV/Schedule/IOutbox.php
+++ b/lib/CalDAV/Schedule/IOutbox.php
@@ -12,5 +12,4 @@ namespace Sabre\CalDAV\Schedule;
*/
interface IOutbox extends \Sabre\DAV\ICollection, \Sabre\DAVACL\IACL {
-
}
diff --git a/lib/CalDAV/Schedule/ISchedulingObject.php b/lib/CalDAV/Schedule/ISchedulingObject.php
index 80aa9c8..f8b8f21 100644
--- a/lib/CalDAV/Schedule/ISchedulingObject.php
+++ b/lib/CalDAV/Schedule/ISchedulingObject.php
@@ -11,4 +11,3 @@ namespace Sabre\CalDAV\Schedule;
interface ISchedulingObject extends \Sabre\CalDAV\ICalendarObject {
}
-
diff --git a/lib/CalDAV/Schedule/Inbox.php b/lib/CalDAV/Schedule/Inbox.php
index d604f64..1485332 100644
--- a/lib/CalDAV/Schedule/Inbox.php
+++ b/lib/CalDAV/Schedule/Inbox.php
@@ -37,7 +37,7 @@ class Inbox extends DAV\Collection implements IInbox {
*
* @param string $principalUri
*/
- public function __construct(Backend\SchedulingSupport $caldavBackend, $principalUri) {
+ function __construct(Backend\SchedulingSupport $caldavBackend, $principalUri) {
$this->caldavBackend = $caldavBackend;
$this->principalUri = $principalUri;
@@ -51,7 +51,7 @@ class Inbox extends DAV\Collection implements IInbox {
*
* @return string
*/
- public function getName() {
+ function getName() {
return 'inbox';
@@ -62,7 +62,7 @@ class Inbox extends DAV\Collection implements IInbox {
*
* @return \Sabre\DAV\INode[]
*/
- public function getChildren() {
+ function getChildren() {
$objs = $this->caldavBackend->getSchedulingObjects($this->principalUri);
$children = [];
@@ -99,7 +99,7 @@ class Inbox extends DAV\Collection implements IInbox {
* @param resource|string $data Initial payload
* @return null|string
*/
- public function createFile($name, $data = null) {
+ function createFile($name, $data = null) {
$this->caldavBackend->createSchedulingObject($this->principalUri, $name, $data);
@@ -112,7 +112,7 @@ class Inbox extends DAV\Collection implements IInbox {
*
* @return string|null
*/
- public function getOwner() {
+ function getOwner() {
return $this->principalUri;
@@ -125,7 +125,7 @@ class Inbox extends DAV\Collection implements IInbox {
*
* @return string|null
*/
- public function getGroup() {
+ function getGroup() {
return null;
@@ -143,7 +143,7 @@ class Inbox extends DAV\Collection implements IInbox {
*
* @return array
*/
- public function getACL() {
+ function getACL() {
return [
[
@@ -198,7 +198,7 @@ class Inbox extends DAV\Collection implements IInbox {
* @param array $acl
* @return void
*/
- public function setACL(array $acl) {
+ function setACL(array $acl) {
throw new DAV\Exception\MethodNotAllowed('You\'re not allowed to update the ACL');
@@ -216,7 +216,7 @@ class Inbox extends DAV\Collection implements IInbox {
*
* @return array|null
*/
- public function getSupportedPrivilegeSet() {
+ function getSupportedPrivilegeSet() {
$ns = '{' . CalDAV\Plugin::NS_CALDAV . '}';
@@ -249,7 +249,7 @@ class Inbox extends DAV\Collection implements IInbox {
* @param array $filters
* @return array
*/
- public function calendarQuery(array $filters) {
+ function calendarQuery(array $filters) {
$result = [];
$validator = new CalDAV\CalendarQueryValidator();
diff --git a/lib/CalDAV/Schedule/Outbox.php b/lib/CalDAV/Schedule/Outbox.php
index d0d882e..705ecd9 100644
--- a/lib/CalDAV/Schedule/Outbox.php
+++ b/lib/CalDAV/Schedule/Outbox.php
@@ -30,7 +30,7 @@ class Outbox extends DAV\Collection implements IOutbox {
*
* @param string $principalUri
*/
- public function __construct($principalUri) {
+ function __construct($principalUri) {
$this->principalUri = $principalUri;
@@ -43,7 +43,7 @@ class Outbox extends DAV\Collection implements IOutbox {
*
* @return string
*/
- public function getName() {
+ function getName() {
return 'outbox';
@@ -54,9 +54,9 @@ class Outbox extends DAV\Collection implements IOutbox {
*
* @return \Sabre\DAV\INode[]
*/
- public function getChildren() {
+ function getChildren() {
- return array();
+ return [];
}
@@ -67,7 +67,7 @@ class Outbox extends DAV\Collection implements IOutbox {
*
* @return string|null
*/
- public function getOwner() {
+ function getOwner() {
return $this->principalUri;
@@ -80,7 +80,7 @@ class Outbox extends DAV\Collection implements IOutbox {
*
* @return string|null
*/
- public function getGroup() {
+ function getGroup() {
return null;
@@ -98,7 +98,7 @@ class Outbox extends DAV\Collection implements IOutbox {
*
* @return array
*/
- public function getACL() {
+ function getACL() {
return [
[
@@ -148,7 +148,7 @@ class Outbox extends DAV\Collection implements IOutbox {
* @param array $acl
* @return void
*/
- public function setACL(array $acl) {
+ function setACL(array $acl) {
throw new DAV\Exception\MethodNotAllowed('You\'re not allowed to update the ACL');
@@ -166,15 +166,15 @@ class Outbox extends DAV\Collection implements IOutbox {
*
* @return array|null
*/
- public function getSupportedPrivilegeSet() {
+ function getSupportedPrivilegeSet() {
$default = DAVACL\Plugin::getDefaultSupportedPrivilegeSet();
- $default['aggregates'][] = array(
+ $default['aggregates'][] = [
'privilege' => '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-query-freebusy',
- );
- $default['aggregates'][] = array(
+ ];
+ $default['aggregates'][] = [
'privilege' => '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-post-vevent',
- );
+ ];
return $default;
diff --git a/lib/CalDAV/Schedule/Plugin.php b/lib/CalDAV/Schedule/Plugin.php
index bef5e9a..62f3ccc 100644
--- a/lib/CalDAV/Schedule/Plugin.php
+++ b/lib/CalDAV/Schedule/Plugin.php
@@ -72,7 +72,7 @@ class Plugin extends ServerPlugin {
*
* @return array
*/
- public function getFeatures() {
+ function getFeatures() {
return ['calendar-auto-schedule'];
@@ -86,7 +86,7 @@ class Plugin extends ServerPlugin {
*
* @return string
*/
- public function getPluginName() {
+ function getPluginName() {
return 'caldav-schedule';
@@ -98,7 +98,7 @@ class Plugin extends ServerPlugin {
* @param Server $server
* @return void
*/
- public function initialize(Server $server) {
+ function initialize(Server $server) {
$this->server = $server;
$server->on('method:POST', [$this, 'httpPost']);
@@ -139,7 +139,7 @@ class Plugin extends ServerPlugin {
* @param string $uri
* @return array
*/
- public function getHTTPMethods($uri) {
+ function getHTTPMethods($uri) {
try {
$node = $this->server->tree->getNodeForPath($uri);
@@ -162,7 +162,7 @@ class Plugin extends ServerPlugin {
* @param ResponseInterface $response
* @return bool
*/
- public function httpPost(RequestInterface $request, ResponseInterface $response) {
+ function httpPost(RequestInterface $request, ResponseInterface $response) {
// Checking if this is a text/calendar content type
$contentType = $request->getHeader('Content-Type');
@@ -199,7 +199,7 @@ class Plugin extends ServerPlugin {
* @param INode $node
* @return void
*/
- public function propFind(PropFind $propFind, INode $node) {
+ function propFind(PropFind $propFind, INode $node) {
if (!$node instanceof DAVACL\IPrincipal) return;
@@ -264,7 +264,7 @@ class Plugin extends ServerPlugin {
* @param bool $modified Wether or not the item's data was modified/
* @return bool|null
*/
- public function beforeCreateFile($path, &$data, $parentNode, &$modified) {
+ function beforeCreateFile($path, &$data, $parentNode, &$modified) {
if (!$parentNode instanceof ICalendar) {
return;
@@ -315,7 +315,7 @@ class Plugin extends ServerPlugin {
* @param bool $modified
* @return void
*/
- public function beforeWriteContent($path, IFile $node, &$data, &$modified) {
+ function beforeWriteContent($path, IFile $node, &$data, &$modified) {
if (!$node instanceof ICalendarObject || $node instanceof ISchedulingObject) {
return;
@@ -362,7 +362,7 @@ class Plugin extends ServerPlugin {
* @param ITip\Message $itipMessage
* @return void
*/
- public function deliver(ITip\Message $iTipMessage) {
+ function deliver(ITip\Message $iTipMessage) {
$this->server->emit('schedule', [$iTipMessage]);
if (!$iTipMessage->scheduleStatus) {
@@ -380,7 +380,7 @@ class Plugin extends ServerPlugin {
* @param string $path
* @return void
*/
- public function beforeUnbind($path) {
+ function beforeUnbind($path) {
$node = $this->server->tree->getNodeForPath($path);
@@ -414,7 +414,7 @@ class Plugin extends ServerPlugin {
* @param ITip\Message $iTipMessage
* @return void
*/
- public function scheduleLocalDelivery(ITip\Message $iTipMessage) {
+ function scheduleLocalDelivery(ITip\Message $iTipMessage) {
$aclPlugin = $this->server->getPlugin('acl');
@@ -623,7 +623,7 @@ class Plugin extends ServerPlugin {
* @param ResponseInterface $response
* @return void
*/
- public function outboxRequest(IOutbox $outboxNode, RequestInterface $request, ResponseInterface $response) {
+ function outboxRequest(IOutbox $outboxNode, RequestInterface $request, ResponseInterface $response) {
$outboxPath = $request->getPath();
diff --git a/lib/CalDAV/Schedule/SchedulingObject.php b/lib/CalDAV/Schedule/SchedulingObject.php
index be1d2b1..77cb4b2 100644
--- a/lib/CalDAV/Schedule/SchedulingObject.php
+++ b/lib/CalDAV/Schedule/SchedulingObject.php
@@ -45,7 +45,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
* @param Backend\BackendInterface $caldavBackend
* @param array $objectData
*/
- public function __construct(Backend\SchedulingSupport $caldavBackend,array $objectData) {
+ function __construct(Backend\SchedulingSupport $caldavBackend,array $objectData) {
$this->caldavBackend = $caldavBackend;
@@ -62,7 +62,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
*
* @return string
*/
- public function getName() {
+ function getName() {
return $this->objectData['uri'];
@@ -73,7 +73,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
*
* @return string
*/
- public function get() {
+ function get() {
// Pre-populating the 'calendardata' is optional, if we don't have it
// already we fetch it from the backend.
@@ -90,7 +90,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
* @param string|resource $calendarData
* @return string
*/
- public function put($calendarData) {
+ function put($calendarData) {
throw new MethodNotAllowed('Updating scheduling objects is not supported');
@@ -101,7 +101,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
*
* @return void
*/
- public function delete() {
+ function delete() {
$this->caldavBackend->deleteSchedulingObject($this->objectData['principaluri'],$this->objectData['uri']);
@@ -112,7 +112,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
*
* @return string
*/
- public function getContentType() {
+ function getContentType() {
$mime = 'text/calendar; charset=utf-8';
if (isset($this->objectData['component']) && $this->objectData['component']) {
@@ -129,7 +129,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
*
* @return string
*/
- public function getETag() {
+ function getETag() {
if (isset($this->objectData['etag'])) {
return $this->objectData['etag'];
@@ -144,7 +144,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
*
* @return int
*/
- public function getLastModified() {
+ function getLastModified() {
return $this->objectData['lastmodified'];
@@ -155,7 +155,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
*
* @return int
*/
- public function getSize() {
+ function getSize() {
if (array_key_exists('size',$this->objectData)) {
return $this->objectData['size'];
@@ -172,7 +172,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
*
* @return string|null
*/
- public function getOwner() {
+ function getOwner() {
return $this->objectData['principaluri'];
@@ -185,7 +185,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
*
* @return string|null
*/
- public function getGroup() {
+ function getGroup() {
return null;
@@ -203,7 +203,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
*
* @return array
*/
- public function getACL() {
+ function getACL() {
// An alternative acl may be specified in the object data.
//
@@ -213,34 +213,33 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
}
// The default ACL
- return array(
- array(
+ return [
+ [
'privilege' => '{DAV:}read',
'principal' => $this->objectData['principaluri'],
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}write',
'principal' => $this->objectData['principaluri'],
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}read',
'principal' => $this->objectData['principaluri'] . '/calendar-proxy-write',
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}write',
'principal' => $this->objectData['principaluri'] . '/calendar-proxy-write',
'protected' => true,
- ),
- array(
+ ],
+ [
'privilege' => '{DAV:}read',
'principal' => $this->objectData['principaluri'] . '/calendar-proxy-read',
'protected' => true,
- ),
-
- );
+ ],
+ ];
}
@@ -252,7 +251,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
* @param array $acl
* @return void
*/
- public function setACL(array $acl) {
+ function setACL(array $acl) {
throw new \Sabre\DAV\Exception\MethodNotAllowed('Changing ACL is not yet supported');
@@ -270,7 +269,7 @@ class SchedulingObject extends \Sabre\DAV\File implements ISchedulingObject, \Sa
*
* @return array|null
*/
- public function getSupportedPrivilegeSet() {
+ function getSupportedPrivilegeSet() {
return null;
diff --git a/lib/CalDAV/ShareableCalendar.php b/lib/CalDAV/ShareableCalendar.php
index cabf7eb..78d72e9 100644
--- a/lib/CalDAV/ShareableCalendar.php
+++ b/lib/CalDAV/ShareableCalendar.php
@@ -30,7 +30,7 @@ class ShareableCalendar extends Calendar implements IShareableCalendar {
* @param array $remove
* @return void
*/
- public function updateShares(array $add, array $remove) {
+ function updateShares(array $add, array $remove) {
$this->caldavBackend->updateShares($this->calendarInfo['id'], $add, $remove);
@@ -48,7 +48,7 @@ class ShareableCalendar extends Calendar implements IShareableCalendar {
*
* @return array
*/
- public function getShares() {
+ function getShares() {
return $this->caldavBackend->getShares($this->calendarInfo['id']);
@@ -63,7 +63,7 @@ class ShareableCalendar extends Calendar implements IShareableCalendar {
* @param bool $value
* @return void
*/
- public function setPublishStatus($value) {
+ function setPublishStatus($value) {
$this->caldavBackend->setPublishStatus($this->calendarInfo['id'], $value);
diff --git a/lib/CalDAV/SharedCalendar.php b/lib/CalDAV/SharedCalendar.php
index 3cbc850..44c105a 100644
--- a/lib/CalDAV/SharedCalendar.php
+++ b/lib/CalDAV/SharedCalendar.php
@@ -19,7 +19,7 @@ class SharedCalendar extends Calendar implements ISharedCalendar {
* @param Backend\BackendInterface $caldavBackend
* @param array $calendarInfo
*/
- public function __construct(Backend\BackendInterface $caldavBackend, $calendarInfo) {
+ function __construct(Backend\BackendInterface $caldavBackend, $calendarInfo) {
$required = [
'{http://calendarserver.org/ns/}shared-url',
@@ -42,7 +42,7 @@ class SharedCalendar extends Calendar implements ISharedCalendar {
*
* @return string
*/
- public function getSharedUrl() {
+ function getSharedUrl() {
return $this->calendarInfo['{http://calendarserver.org/ns/}shared-url'];
@@ -55,7 +55,7 @@ class SharedCalendar extends Calendar implements ISharedCalendar {
*
* @return string|null
*/
- public function getOwner() {
+ function getOwner() {
return $this->calendarInfo['{http://sabredav.org/ns}owner-principal'];
@@ -73,7 +73,7 @@ class SharedCalendar extends Calendar implements ISharedCalendar {
*
* @return array
*/
- public function getACL() {
+ function getACL() {
// The top-level ACL only contains access information for the true
// owner of the calendar, so we need to add the information for the
@@ -108,7 +108,7 @@ class SharedCalendar extends Calendar implements ISharedCalendar {
*
* @return array
*/
- public function getChildACL() {
+ function getChildACL() {
$acl = parent::getChildACL();
$acl[] = [
@@ -141,7 +141,7 @@ class SharedCalendar extends Calendar implements ISharedCalendar {
*
* @return array
*/
- public function getShares() {
+ function getShares() {
return $this->caldavBackend->getShares($this->calendarInfo['id']);
diff --git a/lib/CalDAV/SharingPlugin.php b/lib/CalDAV/SharingPlugin.php
index ac1ea52..c668fe5 100644
--- a/lib/CalDAV/SharingPlugin.php
+++ b/lib/CalDAV/SharingPlugin.php
@@ -49,9 +49,9 @@ class SharingPlugin extends DAV\ServerPlugin {
*
* @return array
*/
- public function getFeatures() {
+ function getFeatures() {
- return array('calendarserver-sharing');
+ return ['calendarserver-sharing'];
}
@@ -63,7 +63,7 @@ class SharingPlugin extends DAV\ServerPlugin {
*
* @return string
*/
- public function getPluginName() {
+ function getPluginName() {
return 'caldav-sharing';
@@ -80,7 +80,7 @@ class SharingPlugin extends DAV\ServerPlugin {
* @param DAV\Server $server
* @return void
*/
- public function initialize(DAV\Server $server) {
+ function initialize(DAV\Server $server) {
$this->server = $server;
$server->resourceTypeMapping['Sabre\\CalDAV\\ISharedCalendar'] = '{' . Plugin::NS_CALENDARSERVER . '}shared';
@@ -109,7 +109,7 @@ class SharingPlugin extends DAV\ServerPlugin {
* @param DAV\INode $node
* @return void
*/
- public function propFindEarly(DAV\PropFind $propFind, DAV\INode $node) {
+ function propFindEarly(DAV\PropFind $propFind, DAV\INode $node) {
if ($node instanceof IShareableCalendar) {
@@ -132,14 +132,14 @@ class SharingPlugin extends DAV\ServerPlugin {
$propFind->handle('{' . Plugin::NS_CALENDARSERVER . '}invite', function() use ($node) {
// Fetching owner information
- $props = $this->server->getPropertiesForPath($node->getOwner(), array(
+ $props = $this->server->getPropertiesForPath($node->getOwner(), [
'{http://sabredav.org/ns}email-address',
'{DAV:}displayname',
- ), 0);
+ ], 0);
- $ownerInfo = array(
+ $ownerInfo = [
'href' => $node->getOwner(),
- );
+ ];
if (isset($props[0][200])) {
@@ -174,7 +174,7 @@ class SharingPlugin extends DAV\ServerPlugin {
* @param DAV\INode $node
* @return void
*/
- public function propFindLate(DAV\PropFind $propFind, DAV\INode $node) {
+ function propFindLate(DAV\PropFind $propFind, DAV\INode $node) {
if ($node instanceof IShareableCalendar) {
if ($rt = $propFind->get('{DAV:}resourcetype')) {
@@ -205,7 +205,7 @@ class SharingPlugin extends DAV\ServerPlugin {
* @param DAV\PropPatch $propPatch
* @return void
*/
- public function propPatch($path, DAV\PropPatch $propPatch) {
+ function propPatch($path, DAV\PropPatch $propPatch) {
$node = $this->server->tree->getNodeForPath($path);
if (!$node instanceof IShareableCalendar)
@@ -214,11 +214,11 @@ class SharingPlugin extends DAV\ServerPlugin {
$propPatch->handle('{DAV:}resourcetype', function($value) use ($node) {
if($value->is('{' . Plugin::NS_CALENDARSERVER . '}shared-owner')) return false;
$shares = $node->getShares();
- $remove = array();
+ $remove = [];
foreach($shares as $share) {
$remove[] = $share['href'];
}
- $node->updateShares(array(), $remove);
+ $node->updateShares([], $remove);
return true;
@@ -233,7 +233,7 @@ class SharingPlugin extends DAV\ServerPlugin {
* @param ResponseInterface $response
* @return null|bool
*/
- public function httpPost(RequestInterface $request, ResponseInterface $response) {
+ function httpPost(RequestInterface $request, ResponseInterface $response) {
$path = $request->getPath();
@@ -430,28 +430,28 @@ class SharingPlugin extends DAV\ServerPlugin {
* @param \DOMDocument $dom
* @return array
*/
- public function parseShareRequest(\DOMDocument $dom) {
+ function parseShareRequest(\DOMDocument $dom) {
$xpath = new \DOMXPath($dom);
$xpath->registerNamespace('cs', Plugin::NS_CALENDARSERVER);
$xpath->registerNamespace('d', 'urn:DAV');
- $set = array();
+ $set = [];
$elems = $xpath->query('cs:set');
for($i=0; $i < $elems->length; $i++) {
$xset = $elems->item($i);
- $set[] = array(
+ $set[] = [
'href' => $xpath->evaluate('string(d:href)', $xset),
'commonName' => $xpath->evaluate('string(cs:common-name)', $xset),
'summary' => $xpath->evaluate('string(cs:summary)', $xset),
'readOnly' => $xpath->evaluate('boolean(cs:read)', $xset)!==false
- );
+ ];
}
- $remove = array();
+ $remove = [];
$elems = $xpath->query('cs:remove');
for($i=0; $i < $elems->length; $i++) {
@@ -461,7 +461,7 @@ class SharingPlugin extends DAV\ServerPlugin {
}
- return array($set, $remove);
+ return [$set, $remove];
}
@@ -478,7 +478,7 @@ class SharingPlugin extends DAV\ServerPlugin {
* @param \DOMDocument $dom
* @return array
*/
- public function parseInviteReplyRequest(\DOMDocument $dom) {
+ function parseInviteReplyRequest(\DOMDocument $dom) {
$xpath = new \DOMXPath($dom);
$xpath->registerNamespace('cs', Plugin::NS_CALENDARSERVER);
@@ -489,13 +489,13 @@ class SharingPlugin extends DAV\ServerPlugin {
throw new DAV\Exception\BadRequest('The {' . Plugin::NS_CALENDARSERVER . '}hosturl/{DAV:}href element is required');
}
- return array(
+ return [
'href' => $xpath->evaluate('string(d:href)'),
'calendarUri' => $this->server->calculateUri($hostHref),
'inReplyTo' => $xpath->evaluate('string(cs:in-reply-to)'),
'summary' => $xpath->evaluate('string(cs:summary)'),
'status' => $xpath->evaluate('boolean(cs:invite-accepted)')?self::STATUS_ACCEPTED:self::STATUS_DECLINED
- );
+ ];
}
diff --git a/lib/CalDAV/Subscriptions/Plugin.php b/lib/CalDAV/Subscriptions/Plugin.php
index 3dec14a..968a795 100644
--- a/lib/CalDAV/Subscriptions/Plugin.php
+++ b/lib/CalDAV/Subscriptions/Plugin.php
@@ -31,7 +31,7 @@ class Plugin extends ServerPlugin {
* @param Server $server
* @return void
*/
- public function initialize(Server $server) {
+ function initialize(Server $server) {
$server->resourceTypeMapping['Sabre\\CalDAV\\Subscriptions\\ISubscription'] =
'{http://calendarserver.org/ns/}subscribed';
@@ -51,7 +51,7 @@ class Plugin extends ServerPlugin {
*
* @return array
*/
- public function getFeatures() {
+ function getFeatures() {
return ['calendarserver-subscribed'];
@@ -62,7 +62,7 @@ class Plugin extends ServerPlugin {
*
* @return void
*/
- public function propFind(PropFind $propFind, INode $node) {
+ function propFind(PropFind $propFind, INode $node) {
// There's a bunch of properties that must appear as a self-closing
// xml-element. This event handler ensures that this will be the case.
diff --git a/lib/CalDAV/Subscriptions/Subscription.php b/lib/CalDAV/Subscriptions/Subscription.php
index 56963c5..0c31c01 100644
--- a/lib/CalDAV/Subscriptions/Subscription.php
+++ b/lib/CalDAV/Subscriptions/Subscription.php
@@ -43,7 +43,7 @@ class Subscription extends Collection implements ISubscription, IACL {
* @param SubscriptionSupport $caldavBackend
* @param array $calendarInfo
*/
- public function __construct(SubscriptionSupport $caldavBackend, array $subscriptionInfo) {
+ function __construct(SubscriptionSupport $caldavBackend, array $subscriptionInfo) {
$this->caldavBackend = $caldavBackend;
$this->subscriptionInfo = $subscriptionInfo;
@@ -70,7 +70,7 @@ class Subscription extends Collection implements ISubscription, IACL {
*
* @return string
*/
- public function getName() {
+ function getName() {
return $this->subscriptionInfo['uri'];
@@ -81,7 +81,7 @@ class Subscription extends Collection implements ISubscription, IACL {
*
* @return int
*/
- public function getLastModified() {
+ function getLastModified() {
if (isset($this->subscriptionInfo['lastmodified'])) {
return $this->subscriptionInfo['lastmodified'];
@@ -94,7 +94,7 @@ class Subscription extends Collection implements ISubscription, IACL {
*
* @return void
*/
- public function delete() {
+ function delete() {
$this->caldavBackend->deleteSubscription(
$this->subscriptionInfo['id']
@@ -107,7 +107,7 @@ class Subscription extends Collection implements ISubscription, IACL {
*
* @return DAV\INode[]
*/
- public function getChildren() {
+ function getChildren() {
return [];
@@ -125,7 +125,7 @@ class Subscription extends Collection implements ISubscription, IACL {
* @param PropPatch $propPatch
* @return void
*/
- public function propPatch(PropPatch $propPatch) {
+ function propPatch(PropPatch $propPatch) {
return $this->caldavBackend->updateSubscription(
$this->subscriptionInfo['id'],
@@ -149,7 +149,7 @@ class Subscription extends Collection implements ISubscription, IACL {
* @param array $properties
* @return void
*/
- public function getProperties($properties) {
+ function getProperties($properties) {
$r = [];
@@ -179,7 +179,7 @@ class Subscription extends Collection implements ISubscription, IACL {
*
* @return string|null
*/
- public function getOwner() {
+ function getOwner() {
return $this->subscriptionInfo['principaluri'];
@@ -192,7 +192,7 @@ class Subscription extends Collection implements ISubscription, IACL {
*
* @return string|null
*/
- public function getGroup() {
+ function getGroup() {
return null;
@@ -210,7 +210,7 @@ class Subscription extends Collection implements ISubscription, IACL {
*
* @return array
*/
- public function getACL() {
+ function getACL() {
return [
[
@@ -250,7 +250,7 @@ class Subscription extends Collection implements ISubscription, IACL {
* @param array $acl
* @return void
*/
- public function setACL(array $acl) {
+ function setACL(array $acl) {
throw new MethodNotAllowed('Changing ACL is not yet supported');
@@ -268,7 +268,7 @@ class Subscription extends Collection implements ISubscription, IACL {
*
* @return array|null
*/
- public function getSupportedPrivilegeSet() {
+ function getSupportedPrivilegeSet() {
return null;
diff --git a/lib/DAV/Auth/Backend/AbstractBasic.php b/lib/DAV/Auth/Backend/AbstractBasic.php
index 87b321e..c46047f 100644
--- a/lib/DAV/Auth/Backend/AbstractBasic.php
+++ b/lib/DAV/Auth/Backend/AbstractBasic.php
@@ -45,7 +45,7 @@ abstract class AbstractBasic implements BackendInterface {
*
* @return string|null
*/
- public function getCurrentUser() {
+ function getCurrentUser() {
return $this->currentUser;
}
@@ -61,7 +61,7 @@ abstract class AbstractBasic implements BackendInterface {
* @throws DAV\Exception\NotAuthenticated
* @return bool
*/
- public function authenticate(DAV\Server $server, $realm) {
+ function authenticate(DAV\Server $server, $realm) {
$auth = new HTTP\Auth\Basic($realm, $server->httpRequest, $server->httpResponse);
$userpass = $auth->getCredentials($server->httpRequest);
diff --git a/lib/DAV/Auth/Backend/AbstractDigest.php b/lib/DAV/Auth/Backend/AbstractDigest.php
index 109a2c6..a1a74b0 100644
--- a/lib/DAV/Auth/Backend/AbstractDigest.php
+++ b/lib/DAV/Auth/Backend/AbstractDigest.php
@@ -35,7 +35,7 @@ abstract class AbstractDigest implements BackendInterface {
* @param string $username
* @return string|null
*/
- abstract public function getDigestHash($realm, $username);
+ abstract function getDigestHash($realm, $username);
/**
* Authenticates the user based on the current request.
@@ -48,7 +48,7 @@ abstract class AbstractDigest implements BackendInterface {
* @throws DAV\Exception\NotAuthenticated
* @return bool
*/
- public function authenticate(DAV\Server $server, $realm) {
+ function authenticate(DAV\Server $server, $realm) {
$digest = new HTTP\Auth\Digest($realm, $server->httpRequest, $server->httpResponse);
$digest->init();
@@ -87,7 +87,7 @@ abstract class AbstractDigest implements BackendInterface {
*
* @return string|null
*/
- public function getCurrentUser() {
+ function getCurrentUser() {
return $this->currentUser;
diff --git a/lib/DAV/Auth/Backend/Apache.php b/lib/DAV/Auth/Backend/Apache.php
index 66fdd91..30d4ac0 100644
--- a/lib/DAV/Auth/Backend/Apache.php
+++ b/lib/DAV/Auth/Backend/Apache.php
@@ -34,7 +34,7 @@ class Apache implements BackendInterface {
* @param string $realm
* @return bool
*/
- public function authenticate(DAV\Server $server, $realm) {
+ function authenticate(DAV\Server $server, $realm) {
$remoteUser = $server->httpRequest->getRawServerValue('REMOTE_USER');
if (is_null($remoteUser)) {
@@ -53,7 +53,7 @@ class Apache implements BackendInterface {
*
* @return array|null
*/
- public function getCurrentUser() {
+ function getCurrentUser() {
return $this->remoteUser;
diff --git a/lib/DAV/Auth/Backend/BasicCallBack.php b/lib/DAV/Auth/Backend/BasicCallBack.php
index 110a80c..50763e1 100644
--- a/lib/DAV/Auth/Backend/BasicCallBack.php
+++ b/lib/DAV/Auth/Backend/BasicCallBack.php
@@ -36,7 +36,7 @@ class BasicCallBack extends AbstractBasic {
* @param callable $callBack
* @return void
*/
- public function __construct(callable $callBack) {
+ function __construct(callable $callBack) {
$this->callBack = $callBack;
diff --git a/lib/DAV/Auth/Backend/File.php b/lib/DAV/Auth/Backend/File.php
index a8e9136..5a7a504 100644
--- a/lib/DAV/Auth/Backend/File.php
+++ b/lib/DAV/Auth/Backend/File.php
@@ -20,7 +20,7 @@ class File extends AbstractDigest {
*
* @var array
*/
- protected $users = array();
+ protected $users = [];
/**
* Creates the backend object.
@@ -29,7 +29,7 @@ class File extends AbstractDigest {
*
* @param string|null $filename
*/
- public function __construct($filename=null) {
+ function __construct($filename=null) {
if (!is_null($filename))
$this->loadFile($filename);
@@ -43,7 +43,7 @@ class File extends AbstractDigest {
* @param string $filename
* @return void
*/
- public function loadFile($filename) {
+ function loadFile($filename) {
foreach(file($filename,FILE_IGNORE_NEW_LINES) as $line) {
@@ -68,7 +68,7 @@ class File extends AbstractDigest {
* @param string $username
* @return string
*/
- public function getDigestHash($realm, $username) {
+ function getDigestHash($realm, $username) {
return isset($this->users[$realm . ':' . $username])?$this->users[$realm . ':' . $username]:false;
diff --git a/lib/DAV/Auth/Backend/PDO.php b/lib/DAV/Auth/Backend/PDO.php
index a4e4883..d5b32b6 100644
--- a/lib/DAV/Auth/Backend/PDO.php
+++ b/lib/DAV/Auth/Backend/PDO.php
@@ -34,7 +34,7 @@ class PDO extends AbstractDigest {
* @param PDO $pdo
* @param string $tableName The PDO table name to use
*/
- public function __construct(\PDO $pdo, $tableName = 'users') {
+ function __construct(\PDO $pdo, $tableName = 'users') {
$this->pdo = $pdo;
$this->tableName = $tableName;
@@ -48,10 +48,10 @@ class PDO extends AbstractDigest {
* @param string $username
* @return string|null
*/
- public function getDigestHash($realm,$username) {
+ function getDigestHash($realm,$username) {
$stmt = $this->pdo->prepare('SELECT digesta1 FROM '.$this->tableName.' WHERE username = ?');
- $stmt->execute(array($username));
+ $stmt->execute([$username]);
return $stmt->fetchColumn() ?: null;
}
diff --git a/lib/DAV/Auth/Plugin.php b/lib/DAV/Auth/Plugin.php
index 6984bfa..858449d 100644
--- a/lib/DAV/Auth/Plugin.php
+++ b/lib/DAV/Auth/Plugin.php
@@ -46,7 +46,7 @@ class Plugin extends DAV\ServerPlugin {
/**
* @return string
*/
- public function getRealm() {
+ function getRealm() {
return $this->realm;
}
@@ -56,7 +56,7 @@ class Plugin extends DAV\ServerPlugin {
* @param Backend\BackendInterface $authBackend
* @param string $realm
*/
- public function __construct(Backend\BackendInterface $authBackend, $realm) {
+ function __construct(Backend\BackendInterface $authBackend, $realm) {
$this->authBackend = $authBackend;
$this->realm = $realm;
@@ -69,10 +69,10 @@ class Plugin extends DAV\ServerPlugin {
* @param DAV\Server $server
* @return void
*/
- public function initialize(DAV\Server $server) {
+ function initialize(DAV\Server $server) {
$this->server = $server;
- $this->server->on('beforeMethod',array($this,'beforeMethod'),10);
+ $this->server->on('beforeMethod', [$this,'beforeMethod'], 10);
}
@@ -84,7 +84,7 @@ class Plugin extends DAV\ServerPlugin {
*
* @return string
*/
- public function getPluginName() {
+ function getPluginName() {
return 'auth';
@@ -97,7 +97,7 @@ class Plugin extends DAV\ServerPlugin {
*
* @return string|null
*/
- public function getCurrentUser() {
+ function getCurrentUser() {
$userInfo = $this->authBackend->getCurrentUser();
if (!$userInfo) return null;
@@ -113,7 +113,7 @@ class Plugin extends DAV\ServerPlugin {
* @param ResponseInterface $response
* @return bool
*/
- public function beforeMethod(RequestInterface $request, ResponseInterface $response) {
+ function beforeMethod(RequestInterface $request, ResponseInterface $response) {
$this->authBackend->authenticate($this->server,$this->getRealm());
diff --git a/lib/DAV/Browser/GuessContentType.php b/lib/DAV/Browser/GuessContentType.php
index 2cd04b9..6c7ae61 100644
--- a/lib/DAV/Browser/GuessContentType.php
+++ b/lib/DAV/Browser/GuessContentType.php
@@ -32,7 +32,7 @@ class GuessContentType extends DAV\ServerPlugin {
*
* @var array
*/
- public $extensionMap = array(
+ public $extensionMap = [
// images
'jpg' => 'image/jpeg',
@@ -46,7 +46,7 @@ class GuessContentType extends DAV\ServerPlugin {
// text
'txt' => 'text/plain',
- );
+ ];
/**
* Initializes the plugin
@@ -54,7 +54,7 @@ class GuessContentType extends DAV\ServerPlugin {
* @param DAV\Server $server
* @return void
*/
- public function initialize(DAV\Server $server) {
+ function initialize(DAV\Server $server) {
// Using a relatively low priority (200) to allow other extensions
// to set the content-type first.
@@ -71,7 +71,7 @@ class GuessContentType extends DAV\ServerPlugin {
* @param INode $node
* @return void
*/
- public function propFind(PropFind $propFind, INode $node) {
+ function propFind(PropFind $propFind, INode $node) {
$propFind->handle('{DAV:}getcontenttype', function() use ($propFind) {
diff --git a/lib/DAV/Browser/MapGetToPropFind.php b/lib/DAV/Browser/MapGetToPropFind.php
index 1dece52..1233cc9 100644
--- a/lib/DAV/Browser/MapGetToPropFind.php
+++ b/lib/DAV/Browser/MapGetToPropFind.php
@@ -32,7 +32,7 @@ class MapGetToPropFind extends DAV\ServerPlugin {
* @param DAV\Server $server
* @return void
*/
- public function initialize(DAV\Server $server) {
+ function initialize(DAV\Server $server) {
$this->server = $server;
$this->server->on('method:GET', [$this,'httpGet'], 90);
@@ -45,7 +45,7 @@ class MapGetToPropFind extends DAV\ServerPlugin {
* @param ResponseInterface $response
* @return bool
*/
- public function httpGet(RequestInterface $request, ResponseInterface $response) {
+ function httpGet(RequestInterface $request, ResponseInterface $response) {
$node = $this->server->tree->getNodeForPath($request->getPath());
if ($node instanceof DAV\IFile) return;
diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php
index a5d27bf..c579dca 100644
--- a/lib/DAV/Browser/Plugin.php
+++ b/lib/DAV/Browser/Plugin.php
@@ -46,7 +46,7 @@ class Plugin extends DAV\ServerPlugin {
*
* @param bool $enablePost
*/
- public function __construct($enablePost=true) {
+ function __construct($enablePost=true) {
$this->enablePost = $enablePost;
@@ -58,7 +58,7 @@ class Plugin extends DAV\ServerPlugin {
* @param DAV\Server $server
* @return void
*/
- public function initialize(DAV\Server $server) {
+ function initialize(DAV\Server $server) {
$this->server = $server;
$this->server->on('method:GET', [$this,'httpGet'], 200);
@@ -73,7 +73,7 @@ class Plugin extends DAV\ServerPlugin {
* @param ResponseInterface $response
* @return bool
*/
- public function httpGet(RequestInterface $request, ResponseInterface $response) {
+ function httpGet(RequestInterface $request, ResponseInterface $response) {
// We're not using straight-up $_GET, because we want everything to be
// unit testable.
@@ -113,7 +113,7 @@ class Plugin extends DAV\ServerPlugin {
* @param ResponseInterface $response
* @return bool
*/
- public function httpPOST(RequestInterface $request, ResponseInterface $response) {
+ function httpPOST(RequestInterface $request, ResponseInterface $response) {
$contentType = $request->getHeader('Content-Type');
list($contentType) = explode(';', $contentType);
@@ -174,7 +174,7 @@ class Plugin extends DAV\ServerPlugin {
* @param string $value
* @return string
*/
- public function escapeHTML($value) {
+ function escapeHTML($value) {
return htmlspecialchars($value,ENT_QUOTES,'UTF-8');
@@ -186,7 +186,7 @@ class Plugin extends DAV\ServerPlugin {
* @param string $path
* @return string
*/
- public function generateDirectoryIndex($path) {
+ function generateDirectoryIndex($path) {
$version = '';
if (DAV\Server::$exposeVersion) {
@@ -344,7 +344,7 @@ HTML;
* @param mixed $output
* @return void
*/
- public function htmlActionsPanel(DAV\INode $node, &$output) {
+ function htmlActionsPanel(DAV\INode $node, &$output) {
if (!$node instanceof DAV\ICollection)
return;
diff --git a/lib/DAV/Browser/PropFindAll.php b/lib/DAV/Browser/PropFindAll.php
index afcc5c1..d329c65 100644
--- a/lib/DAV/Browser/PropFindAll.php
+++ b/lib/DAV/Browser/PropFindAll.php
@@ -19,7 +19,7 @@ class PropFindAll extends PropFind {
*
* @param string $path
*/
- public function __construct($path) {
+ function __construct($path) {
parent::__construct($path, []);
@@ -47,7 +47,7 @@ class PropFindAll extends PropFind {
* @param mixed $valueOrCallBack
* @return void
*/
- public function handle($propertyName, $valueOrCallBack) {
+ function handle($propertyName, $valueOrCallBack) {
if (is_callable($valueOrCallBack)) {
$value = $valueOrCallBack();
@@ -71,7 +71,7 @@ class PropFindAll extends PropFind {
* @param int $status
* @return void
*/
- public function set($propertyName, $value, $status = null) {
+ function set($propertyName, $value, $status = null) {
if (is_null($status)) {
$status = is_null($value) ? 404 : 200;
@@ -86,7 +86,7 @@ class PropFindAll extends PropFind {
* @param string $propertyName
* @return mixed
*/
- public function get($propertyName) {
+ function get($propertyName) {
return isset($this->result[$propertyName])?$this->result[$propertyName][1]:null;
@@ -101,7 +101,7 @@ class PropFindAll extends PropFind {
* @param string $propertyName
* @return int|null
*/
- public function getStatus($propertyName) {
+ function getStatus($propertyName) {
return isset($this->result[$propertyName])?$this->result[$propertyName][0]:404;
@@ -113,7 +113,7 @@ class PropFindAll extends PropFind {
*
* @return array
*/
- public function get404Properties() {
+ function get404Properties() {
$result = [];
foreach($this->result as $propertyName=>$stuff) {
diff --git a/lib/DAV/Client.php b/lib/DAV/Client.php
index fe8e25a..850c54a 100644
--- a/lib/DAV/Client.php
+++ b/lib/DAV/Client.php
@@ -30,7 +30,7 @@ class Client extends HTTP\Client {
*
* @var array
*/
- public $propertyMap = array();
+ public $propertyMap = [];
protected $baseUri;
@@ -93,18 +93,18 @@ class Client extends HTTP\Client {
*
* @param array $settings
*/
- public function __construct(array $settings) {
+ function __construct(array $settings) {
if (!isset($settings['baseUri'])) {
throw new \InvalidArgumentException('A baseUri must be provided');
}
- $validSettings = array(
+ $validSettings = [
'baseUri',
'userName',
'password',
'proxy',
- );
+ ];
parent::__construct();
@@ -167,7 +167,7 @@ class Client extends HTTP\Client {
* @param string $certificates
* @return void
*/
- public function addTrustedCertificates($certificates) {
+ function addTrustedCertificates($certificates) {
$this->addCurlSetting(CURLOPT_CAINFO, $certificates);
}
@@ -179,7 +179,7 @@ class Client extends HTTP\Client {
* @param bool $value
* @return void
*/
- public function setVerifyPeer($value) {
+ function setVerifyPeer($value) {
$this->addCurlSetting(CURLOPT_SSL_VERIFYPEER, $value);
}
@@ -204,7 +204,7 @@ class Client extends HTTP\Client {
* @param int $depth
* @return array
*/
- public function propFind($url, array $properties, $depth = 0) {
+ function propFind($url, array $properties, $depth = 0) {
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->formatOutput = true;
@@ -274,7 +274,7 @@ class Client extends HTTP\Client {
* @param array $properties
* @return void
*/
- public function propPatch($url, array $properties) {
+ function propPatch($url, array $properties) {
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->formatOutput = true;
@@ -342,14 +342,14 @@ class Client extends HTTP\Client {
*
* @return array
*/
- public function options() {
+ function options() {
$request = new HTTP\Request('OPTIONS', $this->getAbsoluteUrl(''));
$response = $this->send($request);
$dav = $response->getHeader('Dav');
if (!$dav) {
- return array();
+ return [];
}
$features = explode(',', $dav);
@@ -389,7 +389,7 @@ class Client extends HTTP\Client {
* @throws ClientException, in case a curl error occurred.
* @return array
*/
- public function request($method, $url = '', $body = null, array $headers = []) {
+ function request($method, $url = '', $body = null, array $headers = []) {
$url = $this->getAbsoluteUrl($url);
@@ -409,7 +409,7 @@ class Client extends HTTP\Client {
* @param string $url
* @return string
*/
- public function getAbsoluteUrl($url) {
+ function getAbsoluteUrl($url) {
// If the url starts with http:// or https://, the url is already absolute.
if (preg_match('/^http(s?):\/\//', $url)) {
@@ -433,27 +433,27 @@ class Client extends HTTP\Client {
*
* This method returns an array with the following structure
*
- * array(
- * 'url/to/resource' => array(
- * '200' => array(
+ * [
+ * 'url/to/resource' => [
+ * '200' => [
* '{DAV:}property1' => 'value1',
* '{DAV:}property2' => 'value2',
- * ),
- * '404' => array(
+ * ],
+ * '404' => [
* '{DAV:}property1' => null,
* '{DAV:}property2' => null,
- * ),
- * )
- * 'url/to/resource2' => array(
+ * ],
+ * ],
+ * 'url/to/resource2' => [
* .. etc ..
- * )
- * )
+ * ]
+ * ]
*
*
* @param string $body xml body
* @return array
*/
- public function parseMultiStatus($body) {
+ function parseMultiStatus($body) {
try {
$dom = XMLUtil::loadDOMDocument($body);
@@ -466,7 +466,7 @@ class Client extends HTTP\Client {
$this->propertyMap
);
- $result = array();
+ $result = [];
foreach($responses->getResponses() as $response) {
diff --git a/lib/DAV/Collection.php b/lib/DAV/Collection.php
index 0090a4d..94055e2 100644
--- a/lib/DAV/Collection.php
+++ b/lib/DAV/Collection.php
@@ -28,7 +28,7 @@ abstract class Collection extends Node implements ICollection {
* @throws Exception\NotFound
* @return INode
*/
- public function getChild($name) {
+ function getChild($name) {
foreach($this->getChildren() as $child) {
@@ -47,7 +47,7 @@ abstract class Collection extends Node implements ICollection {
* @param string $name
* @return bool
*/
- public function childExists($name) {
+ function childExists($name) {
try {
@@ -86,7 +86,7 @@ abstract class Collection extends Node implements ICollection {
* @param resource|string $data Initial payload
* @return null|string
*/
- public function createFile($name, $data = null) {
+ function createFile($name, $data = null) {
throw new Exception\Forbidden('Permission denied to create file (filename ' . $name . ')');
@@ -99,7 +99,7 @@ abstract class Collection extends Node implements ICollection {
* @throws Exception\Forbidden
* @return void
*/
- public function createDirectory($name) {
+ function createDirectory($name) {
throw new Exception\Forbidden('Permission denied to create directory');
diff --git a/lib/DAV/Exception.php b/lib/DAV/Exception.php
index 22a319e..27d8c21 100644
--- a/lib/DAV/Exception.php
+++ b/lib/DAV/Exception.php
@@ -28,7 +28,7 @@ class Exception extends \Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 500;
@@ -41,7 +41,7 @@ class Exception extends \Exception {
* @param \DOMElement $errorNode
* @return void
*/
- public function serialize(Server $server,\DOMElement $errorNode) {
+ function serialize(Server $server,\DOMElement $errorNode) {
}
@@ -54,9 +54,9 @@ class Exception extends \Exception {
* @param Server $server
* @return array
*/
- public function getHTTPHeaders(Server $server) {
+ function getHTTPHeaders(Server $server) {
- return array();
+ return [];
}
diff --git a/lib/DAV/Exception/BadRequest.php b/lib/DAV/Exception/BadRequest.php
index d59727e..d4b7c1f 100644
--- a/lib/DAV/Exception/BadRequest.php
+++ b/lib/DAV/Exception/BadRequest.php
@@ -19,7 +19,7 @@ class BadRequest extends \Sabre\DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 400;
diff --git a/lib/DAV/Exception/Conflict.php b/lib/DAV/Exception/Conflict.php
index cbb8fcf..d84ee6f 100644
--- a/lib/DAV/Exception/Conflict.php
+++ b/lib/DAV/Exception/Conflict.php
@@ -19,7 +19,7 @@ class Conflict extends \Sabre\DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 409;
diff --git a/lib/DAV/Exception/ConflictingLock.php b/lib/DAV/Exception/ConflictingLock.php
index 3e6ea15..393b2b2 100644
--- a/lib/DAV/Exception/ConflictingLock.php
+++ b/lib/DAV/Exception/ConflictingLock.php
@@ -23,7 +23,7 @@ class ConflictingLock extends Locked {
* @param \DOMElement $errorNode
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $errorNode) {
+ function serialize(DAV\Server $server, \DOMElement $errorNode) {
if ($this->lock) {
$error = $errorNode->ownerDocument->createElementNS('DAV:','d:no-conflicting-lock');
diff --git a/lib/DAV/Exception/Forbidden.php b/lib/DAV/Exception/Forbidden.php
index 2dc6206..8bd01cc 100644
--- a/lib/DAV/Exception/Forbidden.php
+++ b/lib/DAV/Exception/Forbidden.php
@@ -18,7 +18,7 @@ class Forbidden extends \Sabre\DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 403;
diff --git a/lib/DAV/Exception/InsufficientStorage.php b/lib/DAV/Exception/InsufficientStorage.php
index f7e382c..7c08e82 100644
--- a/lib/DAV/Exception/InsufficientStorage.php
+++ b/lib/DAV/Exception/InsufficientStorage.php
@@ -18,7 +18,7 @@ class InsufficientStorage extends \Sabre\DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 507;
diff --git a/lib/DAV/Exception/InvalidResourceType.php b/lib/DAV/Exception/InvalidResourceType.php
index 847ed47..a3a2016 100644
--- a/lib/DAV/Exception/InvalidResourceType.php
+++ b/lib/DAV/Exception/InvalidResourceType.php
@@ -23,7 +23,7 @@ class InvalidResourceType extends Forbidden {
* @param \DOMElement $errorNode
* @return void
*/
- public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
+ function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
$error = $errorNode->ownerDocument->createElementNS('DAV:','d:valid-resourcetype');
$errorNode->appendChild($error);
diff --git a/lib/DAV/Exception/InvalidSyncToken.php b/lib/DAV/Exception/InvalidSyncToken.php
index f30d727..b616c87 100644
--- a/lib/DAV/Exception/InvalidSyncToken.php
+++ b/lib/DAV/Exception/InvalidSyncToken.php
@@ -28,7 +28,7 @@ class InvalidSyncToken extends Forbidden {
* @param \DOMElement $errorNode
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $errorNode) {
+ function serialize(DAV\Server $server,\DOMElement $errorNode) {
$error = $errorNode->ownerDocument->createElementNS('DAV:','d:valid-sync-token');
$errorNode->appendChild($error);
diff --git a/lib/DAV/Exception/LengthRequired.php b/lib/DAV/Exception/LengthRequired.php
index 9487686..780a03d 100644
--- a/lib/DAV/Exception/LengthRequired.php
+++ b/lib/DAV/Exception/LengthRequired.php
@@ -21,7 +21,7 @@ class LengthRequired extends DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 411;
diff --git a/lib/DAV/Exception/LockTokenMatchesRequestUri.php b/lib/DAV/Exception/LockTokenMatchesRequestUri.php
index 37fc7f8..b009407 100644
--- a/lib/DAV/Exception/LockTokenMatchesRequestUri.php
+++ b/lib/DAV/Exception/LockTokenMatchesRequestUri.php
@@ -18,7 +18,7 @@ class LockTokenMatchesRequestUri extends Conflict {
/**
* Creates the exception
*/
- public function __construct() {
+ function __construct() {
$this->message = 'The locktoken supplied does not match any locks on this entity';
@@ -31,7 +31,7 @@ class LockTokenMatchesRequestUri extends Conflict {
* @param \DOMElement $errorNode
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $errorNode) {
+ function serialize(DAV\Server $server,\DOMElement $errorNode) {
$error = $errorNode->ownerDocument->createElementNS('DAV:','d:lock-token-matches-request-uri');
$errorNode->appendChild($error);
diff --git a/lib/DAV/Exception/Locked.php b/lib/DAV/Exception/Locked.php
index 2bee1b0..80b949a 100644
--- a/lib/DAV/Exception/Locked.php
+++ b/lib/DAV/Exception/Locked.php
@@ -30,7 +30,7 @@ class Locked extends DAV\Exception {
*
* @param DAV\Locks\LockInfo $lock
*/
- public function __construct(DAV\Locks\LockInfo $lock = null) {
+ function __construct(DAV\Locks\LockInfo $lock = null) {
$this->lock = $lock;
@@ -41,7 +41,7 @@ class Locked extends DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 423;
@@ -54,7 +54,7 @@ class Locked extends DAV\Exception {
* @param \DOMElement $errorNode
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $errorNode) {
+ function serialize(DAV\Server $server,\DOMElement $errorNode) {
if ($this->lock) {
$error = $errorNode->ownerDocument->createElementNS('DAV:','d:lock-token-submitted');
diff --git a/lib/DAV/Exception/MethodNotAllowed.php b/lib/DAV/Exception/MethodNotAllowed.php
index 05970cf..47d6a25 100644
--- a/lib/DAV/Exception/MethodNotAllowed.php
+++ b/lib/DAV/Exception/MethodNotAllowed.php
@@ -18,7 +18,7 @@ class MethodNotAllowed extends \Sabre\DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 405;
@@ -32,13 +32,13 @@ class MethodNotAllowed extends \Sabre\DAV\Exception {
* @param \Sabre\DAV\Server $server
* @return array
*/
- public function getHTTPHeaders(\Sabre\DAV\Server $server) {
+ function getHTTPHeaders(\Sabre\DAV\Server $server) {
$methods = $server->getAllowedMethods($server->getRequestUri());
- return array(
+ return [
'Allow' => strtoupper(implode(', ',$methods)),
- );
+ ];
}
diff --git a/lib/DAV/Exception/NotAuthenticated.php b/lib/DAV/Exception/NotAuthenticated.php
index c082d48..4bef7ab 100644
--- a/lib/DAV/Exception/NotAuthenticated.php
+++ b/lib/DAV/Exception/NotAuthenticated.php
@@ -21,7 +21,7 @@ class NotAuthenticated extends DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 401;
diff --git a/lib/DAV/Exception/NotFound.php b/lib/DAV/Exception/NotFound.php
index 83e699c..d415c78 100644
--- a/lib/DAV/Exception/NotFound.php
+++ b/lib/DAV/Exception/NotFound.php
@@ -18,7 +18,7 @@ class NotFound extends \Sabre\DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 404;
diff --git a/lib/DAV/Exception/NotImplemented.php b/lib/DAV/Exception/NotImplemented.php
index 5f031cb..8208195 100644
--- a/lib/DAV/Exception/NotImplemented.php
+++ b/lib/DAV/Exception/NotImplemented.php
@@ -18,7 +18,7 @@ class NotImplemented extends \Sabre\DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 501;
diff --git a/lib/DAV/Exception/PaymentRequired.php b/lib/DAV/Exception/PaymentRequired.php
index 3c256a0..c217237 100644
--- a/lib/DAV/Exception/PaymentRequired.php
+++ b/lib/DAV/Exception/PaymentRequired.php
@@ -21,7 +21,7 @@ class PaymentRequired extends DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 402;
diff --git a/lib/DAV/Exception/PreconditionFailed.php b/lib/DAV/Exception/PreconditionFailed.php
index deb8a5b..acd41a6 100644
--- a/lib/DAV/Exception/PreconditionFailed.php
+++ b/lib/DAV/Exception/PreconditionFailed.php
@@ -33,7 +33,7 @@ class PreconditionFailed extends DAV\Exception {
* @param string $message
* @param string $header
*/
- public function __construct($message, $header=null) {
+ function __construct($message, $header=null) {
parent::__construct($message);
$this->header = $header;
@@ -45,7 +45,7 @@ class PreconditionFailed extends DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 412;
@@ -58,7 +58,7 @@ class PreconditionFailed extends DAV\Exception {
* @param \DOMElement $errorNode
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $errorNode) {
+ function serialize(DAV\Server $server,\DOMElement $errorNode) {
if ($this->header) {
$prop = $errorNode->ownerDocument->createElement('s:header');
diff --git a/lib/DAV/Exception/ReportNotSupported.php b/lib/DAV/Exception/ReportNotSupported.php
index 8643948..c9e7f44 100644
--- a/lib/DAV/Exception/ReportNotSupported.php
+++ b/lib/DAV/Exception/ReportNotSupported.php
@@ -22,7 +22,7 @@ class ReportNotSupported extends UnsupportedMediaType {
* @param \DOMElement $errorNode
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $errorNode) {
+ function serialize(DAV\Server $server,\DOMElement $errorNode) {
$error = $errorNode->ownerDocument->createElementNS('DAV:','d:supported-report');
$errorNode->appendChild($error);
diff --git a/lib/DAV/Exception/RequestedRangeNotSatisfiable.php b/lib/DAV/Exception/RequestedRangeNotSatisfiable.php
index 25002be..ac3203f 100644
--- a/lib/DAV/Exception/RequestedRangeNotSatisfiable.php
+++ b/lib/DAV/Exception/RequestedRangeNotSatisfiable.php
@@ -21,7 +21,7 @@ class RequestedRangeNotSatisfiable extends DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 416;
diff --git a/lib/DAV/Exception/ServiceUnavailable.php b/lib/DAV/Exception/ServiceUnavailable.php
index 7f870b8..1435cc3 100644
--- a/lib/DAV/Exception/ServiceUnavailable.php
+++ b/lib/DAV/Exception/ServiceUnavailable.php
@@ -21,7 +21,7 @@ class ServiceUnavailable extends DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 503;
diff --git a/lib/DAV/Exception/TooManyMatches.php b/lib/DAV/Exception/TooManyMatches.php
index 19bfbb8..e8bf616 100644
--- a/lib/DAV/Exception/TooManyMatches.php
+++ b/lib/DAV/Exception/TooManyMatches.php
@@ -28,7 +28,7 @@ class TooManyMatches extends Forbidden {
* @param \DOMElement $errorNode
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $errorNode) {
+ function serialize(DAV\Server $server,\DOMElement $errorNode) {
$error = $errorNode->ownerDocument->createElementNS('DAV:','d:number-of-matches-within-limits');
$errorNode->appendChild($error);
diff --git a/lib/DAV/Exception/UnsupportedMediaType.php b/lib/DAV/Exception/UnsupportedMediaType.php
index 46eea60..63b4070 100644
--- a/lib/DAV/Exception/UnsupportedMediaType.php
+++ b/lib/DAV/Exception/UnsupportedMediaType.php
@@ -19,7 +19,7 @@ class UnsupportedMediaType extends \Sabre\DAV\Exception {
*
* @return int
*/
- public function getHTTPCode() {
+ function getHTTPCode() {
return 415;
diff --git a/lib/DAV/FS/Directory.php b/lib/DAV/FS/Directory.php
index 6fdd2ae..3728eea 100644
--- a/lib/DAV/FS/Directory.php
+++ b/lib/DAV/FS/Directory.php
@@ -36,7 +36,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
* @param resource|string $data Initial payload
* @return null|string
*/
- public function createFile($name, $data = null) {
+ function createFile($name, $data = null) {
$newPath = $this->path . '/' . $name;
file_put_contents($newPath,$data);
@@ -49,7 +49,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
* @param string $name
* @return void
*/
- public function createDirectory($name) {
+ function createDirectory($name) {
$newPath = $this->path . '/' . $name;
mkdir($newPath);
@@ -66,7 +66,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
* @throws DAV\Exception\NotFound
* @return DAV\INode
*/
- public function getChild($name) {
+ function getChild($name) {
$path = $this->path . '/' . $name;
@@ -89,9 +89,9 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
*
* @return DAV\INode[]
*/
- public function getChildren() {
+ function getChildren() {
- $nodes = array();
+ $nodes = [];
foreach(scandir($this->path) as $node) if($node!='.' && $node!='..') $nodes[] = $this->getChild($node);
return $nodes;
@@ -103,7 +103,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
* @param string $name
* @return bool
*/
- public function childExists($name) {
+ function childExists($name) {
$path = $this->path . '/' . $name;
return file_exists($path);
@@ -115,7 +115,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
*
* @return void
*/
- public function delete() {
+ function delete() {
foreach($this->getChildren() as $child) $child->delete();
rmdir($this->path);
@@ -127,12 +127,12 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
*
* @return array
*/
- public function getQuotaInfo() {
+ function getQuotaInfo() {
- return array(
+ return [
disk_total_space($this->path)-disk_free_space($this->path),
disk_free_space($this->path)
- );
+ ];
}
diff --git a/lib/DAV/FS/File.php b/lib/DAV/FS/File.php
index d10370f..46fe786 100644
--- a/lib/DAV/FS/File.php
+++ b/lib/DAV/FS/File.php
@@ -19,7 +19,7 @@ class File extends Node implements DAV\IFile {
* @param resource $data
* @return void
*/
- public function put($data) {
+ function put($data) {
file_put_contents($this->path,$data);
@@ -30,7 +30,7 @@ class File extends Node implements DAV\IFile {
*
* @return string
*/
- public function get() {
+ function get() {
return fopen($this->path,'r');
@@ -41,7 +41,7 @@ class File extends Node implements DAV\IFile {
*
* @return void
*/
- public function delete() {
+ function delete() {
unlink($this->path);
@@ -52,7 +52,7 @@ class File extends Node implements DAV\IFile {
*
* @return int
*/
- public function getSize() {
+ function getSize() {
return filesize($this->path);
@@ -68,7 +68,7 @@ class File extends Node implements DAV\IFile {
*
* @return mixed
*/
- public function getETag() {
+ function getETag() {
return null;
@@ -81,7 +81,7 @@ class File extends Node implements DAV\IFile {
*
* @return mixed
*/
- public function getContentType() {
+ function getContentType() {
return null;
diff --git a/lib/DAV/FS/Node.php b/lib/DAV/FS/Node.php
index a5463ef..e1aa1f0 100644
--- a/lib/DAV/FS/Node.php
+++ b/lib/DAV/FS/Node.php
@@ -29,7 +29,7 @@ abstract class Node implements DAV\INode {
*
* @param string $path
*/
- public function __construct($path) {
+ function __construct($path) {
$this->path = $path;
@@ -42,7 +42,7 @@ abstract class Node implements DAV\INode {
*
* @return string
*/
- public function getName() {
+ function getName() {
list(, $name) = URLUtil::splitPath($this->path);
return $name;
@@ -55,7 +55,7 @@ abstract class Node implements DAV\INode {
* @param string $name The new name
* @return void
*/
- public function setName($name) {
+ function setName($name) {
list($parentPath, ) = URLUtil::splitPath($this->path);
list(, $newName) = URLUtil::splitPath($name);
@@ -74,7 +74,7 @@ abstract class Node implements DAV\INode {
*
* @return int
*/
- public function getLastModified() {
+ function getLastModified() {
return filemtime($this->path);
diff --git a/lib/DAV/FSExt/Directory.php b/lib/DAV/FSExt/Directory.php
index da3d2cc..0248c8d 100644
--- a/lib/DAV/FSExt/Directory.php
+++ b/lib/DAV/FSExt/Directory.php
@@ -37,7 +37,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
* @param resource|string $data Initial payload
* @return null|string
*/
- public function createFile($name, $data = null) {
+ function createFile($name, $data = null) {
// We're not allowing dots
if ($name=='.' || $name=='..') throw new DAV\Exception\Forbidden('Permission denied to . and ..');
@@ -54,7 +54,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
* @param string $name
* @return void
*/
- public function createDirectory($name) {
+ function createDirectory($name) {
// We're not allowing dots
if ($name=='.' || $name=='..') throw new DAV\Exception\Forbidden('Permission denied to . and ..');
@@ -73,7 +73,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
* @throws DAV\Exception\NotFound
* @return DAV\INode
*/
- public function getChild($name) {
+ function getChild($name) {
$path = $this->path . '/' . $name;
@@ -98,7 +98,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
* @param string $name
* @return bool
*/
- public function childExists($name) {
+ function childExists($name) {
if ($name=='.' || $name=='..')
throw new DAV\Exception\Forbidden('Permission denied to . and ..');
@@ -113,9 +113,9 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
*
* @return DAV\INode[]
*/
- public function getChildren() {
+ function getChildren() {
- $nodes = array();
+ $nodes = [];
foreach(scandir($this->path) as $node) if($node!='.' && $node!='..' && $node!='.sabredav') $nodes[] = $this->getChild($node);
return $nodes;
@@ -126,7 +126,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
*
* @return bool
*/
- public function delete() {
+ function delete() {
// Deleting all children
foreach($this->getChildren() as $child) $child->delete();
@@ -146,12 +146,12 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
*
* @return array
*/
- public function getQuotaInfo() {
+ function getQuotaInfo() {
- return array(
+ return [
disk_total_space($this->path)-disk_free_space($this->path),
disk_free_space($this->path)
- );
+ ];
}
diff --git a/lib/DAV/FSExt/File.php b/lib/DAV/FSExt/File.php
index 7861082..8bd73f1 100644
--- a/lib/DAV/FSExt/File.php
+++ b/lib/DAV/FSExt/File.php
@@ -20,7 +20,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
* @param resource|string $data
* @return string
*/
- public function put($data) {
+ function put($data) {
file_put_contents($this->path,$data);
return '"' . md5_file($this->path) . '"';
@@ -54,7 +54,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
* @param int $offset
* @return string|null
*/
- public function patch($data, $rangeType, $offset = null) {
+ function patch($data, $rangeType, $offset = null) {
switch($rangeType) {
case 1 :
@@ -84,7 +84,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
*
* @return resource
*/
- public function get() {
+ function get() {
return fopen($this->path,'r');
@@ -95,7 +95,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
*
* @return bool
*/
- public function delete() {
+ function delete() {
return unlink($this->path) && parent::delete();
}
@@ -110,7 +110,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
*
* @return string|null
*/
- public function getETag() {
+ function getETag() {
return '"' . md5_file($this->path). '"';
@@ -123,7 +123,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
*
* @return string|null
*/
- public function getContentType() {
+ function getContentType() {
return null;
@@ -134,7 +134,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
*
* @return int
*/
- public function getSize() {
+ function getSize() {
return filesize($this->path);
diff --git a/lib/DAV/FSExt/Node.php b/lib/DAV/FSExt/Node.php
index 2150241..2b79dc8 100644
--- a/lib/DAV/FSExt/Node.php
+++ b/lib/DAV/FSExt/Node.php
@@ -30,7 +30,7 @@ abstract class Node extends DAV\FS\Node implements DAV\IProperties {
* @param PropPatch $propPatch
* @return void
*/
- public function propPatch(PropPatch $propPatch) {
+ function propPatch(PropPatch $propPatch) {
$propPatch->handleRemaining(function(array $properties) {
@@ -61,14 +61,14 @@ abstract class Node extends DAV\FS\Node implements DAV\IProperties {
* @param array $properties
* @return array
*/
- public function getProperties($properties) {
+ function getProperties($properties) {
$resourceData = $this->getResourceData();
// if the array was empty, we need to return everything
if (!$properties) return $resourceData['properties'];
- $props = array();
+ $props = [];
foreach($properties as $property) {
if (isset($resourceData['properties'][$property])) $props[$property] = $resourceData['properties'][$property];
}
@@ -97,7 +97,7 @@ abstract class Node extends DAV\FS\Node implements DAV\IProperties {
protected function getResourceData() {
$path = $this->getResourceInfoPath();
- if (!file_exists($path)) return array('properties' => array());
+ if (!file_exists($path)) return ['properties' => []];
// opening up the file, and creating a shared lock
$handle = fopen($path,'r');
@@ -116,11 +116,11 @@ abstract class Node extends DAV\FS\Node implements DAV\IProperties {
// Unserializing and checking if the resource file contains data for this file
$data = unserialize($data);
if (!isset($data[$this->getName()])) {
- return array('properties' => array());
+ return ['properties' => []];
}
$data = $data[$this->getName()];
- if (!isset($data['properties'])) $data['properties'] = array();
+ if (!isset($data['properties'])) $data['properties'] = [];
return $data;
}
@@ -165,7 +165,7 @@ abstract class Node extends DAV\FS\Node implements DAV\IProperties {
* @param string $name The new name
* @return void
*/
- public function setName($name) {
+ function setName($name) {
list($parentPath, ) = URLUtil::splitPath($this->path);
list(, $newName) = URLUtil::splitPath($name);
@@ -217,7 +217,7 @@ abstract class Node extends DAV\FS\Node implements DAV\IProperties {
return true;
}
- public function delete() {
+ function delete() {
return $this->deleteResourceData();
diff --git a/lib/DAV/File.php b/lib/DAV/File.php
index af8ce73..8334934 100644
--- a/lib/DAV/File.php
+++ b/lib/DAV/File.php
@@ -22,7 +22,7 @@ abstract class File extends Node implements IFile {
* @param resource $data
* @return void
*/
- public function put($data) {
+ function put($data) {
throw new Exception\Forbidden('Permission denied to change data');
@@ -35,7 +35,7 @@ abstract class File extends Node implements IFile {
*
* @return mixed
*/
- public function get() {
+ function get() {
throw new Exception\Forbidden('Permission denied to read this file');
@@ -46,7 +46,7 @@ abstract class File extends Node implements IFile {
*
* @return int
*/
- public function getSize() {
+ function getSize() {
return 0;
@@ -62,7 +62,7 @@ abstract class File extends Node implements IFile {
*
* @return string|null
*/
- public function getETag() {
+ function getETag() {
return null;
@@ -75,7 +75,7 @@ abstract class File extends Node implements IFile {
*
* @return string|null
*/
- public function getContentType() {
+ function getContentType() {
return null;
diff --git a/lib/DAV/IMultiGet.php b/lib/DAV/IMultiGet.php
index 8fbd189..df119fa 100644
--- a/lib/DAV/IMultiGet.php
+++ b/lib/DAV/IMultiGet.php
@@ -30,6 +30,6 @@ interface IMultiGet extends ICollection {
*
* @return array
*/
- public function getMultipleChildren(array $paths);
+ function getMultipleChildren(array $paths);
}
diff --git a/lib/DAV/IProperties.php b/lib/DAV/IProperties.php
index f940e1a..e042268 100644
--- a/lib/DAV/IProperties.php
+++ b/lib/DAV/IProperties.php
@@ -25,7 +25,7 @@ interface IProperties extends INode {
* @param PropPatch $propPatch
* @return void
*/
- public function propPatch(PropPatch $propPatch);
+ function propPatch(PropPatch $propPatch);
/**
* Returns a list of properties for this nodes.
@@ -42,7 +42,7 @@ interface IProperties extends INode {
* @param array $properties
* @return array
*/
- public function getProperties($properties);
+ function getProperties($properties);
}
diff --git a/lib/DAV/Locks/Backend/BackendInterface.php b/lib/DAV/Locks/Backend/BackendInterface.php
index bae666b..60ade56 100644
--- a/lib/DAV/Locks/Backend/BackendInterface.php
+++ b/lib/DAV/Locks/Backend/BackendInterface.php
@@ -27,7 +27,7 @@ interface BackendInterface {
* @param bool $returnChildLocks
* @return array
*/
- public function getLocks($uri, $returnChildLocks);
+ function getLocks($uri, $returnChildLocks);
/**
* Locks a uri
@@ -36,7 +36,7 @@ interface BackendInterface {
* @param Locks\LockInfo $lockInfo
* @return bool
*/
- public function lock($uri,Locks\LockInfo $lockInfo);
+ function lock($uri,Locks\LockInfo $lockInfo);
/**
* Removes a lock from a uri
@@ -45,7 +45,7 @@ interface BackendInterface {
* @param Locks\LockInfo $lockInfo
* @return bool
*/
- public function unlock($uri,Locks\LockInfo $lockInfo);
+ function unlock($uri,Locks\LockInfo $lockInfo);
}
diff --git a/lib/DAV/Locks/Backend/FS.php b/lib/DAV/Locks/Backend/FS.php
index 37d849a..512f2ca 100644
--- a/lib/DAV/Locks/Backend/FS.php
+++ b/lib/DAV/Locks/Backend/FS.php
@@ -30,7 +30,7 @@ class FS extends AbstractBackend {
*/
private $dataDir;
- public function __construct($dataDir) {
+ function __construct($dataDir) {
$this->dataDir = $dataDir;
@@ -56,9 +56,9 @@ class FS extends AbstractBackend {
* @param bool $returnChildLocks
* @return array
*/
- public function getLocks($uri, $returnChildLocks) {
+ function getLocks($uri, $returnChildLocks) {
- $lockList = array();
+ $lockList = [];
$currentPath = '';
foreach(explode('/',$uri) as $uriPart) {
@@ -96,7 +96,7 @@ class FS extends AbstractBackend {
* @param LockInfo $lockInfo
* @return bool
*/
- public function lock($uri, LockInfo $lockInfo) {
+ function lock($uri, LockInfo $lockInfo) {
// We're making the lock timeout 30 minutes
$lockInfo->timeout = 1800;
@@ -119,7 +119,7 @@ class FS extends AbstractBackend {
* @param LockInfo $lockInfo
* @return bool
*/
- public function unlock($uri, LockInfo $lockInfo) {
+ function unlock($uri, LockInfo $lockInfo) {
$locks = $this->getLocks($uri,false);
foreach($locks as $k=>$lock) {
@@ -145,7 +145,7 @@ class FS extends AbstractBackend {
protected function getData($uri) {
$path = $this->getFilenameForUri($uri);
- if (!file_exists($path)) return array();
+ if (!file_exists($path)) return [];
// opening up the file, and creating a shared lock
$handle = fopen($path,'r');
@@ -163,7 +163,7 @@ class FS extends AbstractBackend {
// Unserializing and checking if the resource file contains data for this file
$data = unserialize($data);
- if (!$data) return array();
+ if (!$data) return [];
return $data;
}
diff --git a/lib/DAV/Locks/Backend/File.php b/lib/DAV/Locks/Backend/File.php
index 17c40b8..dc7f62c 100644
--- a/lib/DAV/Locks/Backend/File.php
+++ b/lib/DAV/Locks/Backend/File.php
@@ -31,7 +31,7 @@ class File extends AbstractBackend {
*
* @param string $locksFile path to file
*/
- public function __construct($locksFile) {
+ function __construct($locksFile) {
$this->locksFile = $locksFile;
@@ -50,9 +50,9 @@ class File extends AbstractBackend {
* @param bool $returnChildLocks
* @return array
*/
- public function getLocks($uri, $returnChildLocks) {
+ function getLocks($uri, $returnChildLocks) {
- $newLocks = array();
+ $newLocks = [];
$locks = $this->getData();
@@ -86,7 +86,7 @@ class File extends AbstractBackend {
* @param LockInfo $lockInfo
* @return bool
*/
- public function lock($uri, LockInfo $lockInfo) {
+ function lock($uri, LockInfo $lockInfo) {
// We're making the lock timeout 30 minutes
$lockInfo->timeout = 1800;
@@ -116,7 +116,7 @@ class File extends AbstractBackend {
* @param LockInfo $lockInfo
* @return bool
*/
- public function unlock($uri, LockInfo $lockInfo) {
+ function unlock($uri, LockInfo $lockInfo) {
$locks = $this->getData();
foreach($locks as $k=>$lock) {
@@ -140,7 +140,7 @@ class File extends AbstractBackend {
*/
protected function getData() {
- if (!file_exists($this->locksFile)) return array();
+ if (!file_exists($this->locksFile)) return [];
// opening up the file, and creating a shared lock
$handle = fopen($this->locksFile,'r');
@@ -155,7 +155,7 @@ class File extends AbstractBackend {
// Unserializing and checking if the resource file contains data for this file
$data = unserialize($data);
- if (!$data) return array();
+ if (!$data) return [];
return $data;
}
diff --git a/lib/DAV/Locks/Backend/PDO.php b/lib/DAV/Locks/Backend/PDO.php
index ebaeef8..8062a17 100644
--- a/lib/DAV/Locks/Backend/PDO.php
+++ b/lib/DAV/Locks/Backend/PDO.php
@@ -36,7 +36,7 @@ class PDO extends AbstractBackend {
* @param PDO $pdo
* @param string $tableName
*/
- public function __construct(\PDO $pdo, $tableName = 'locks') {
+ function __construct(\PDO $pdo, $tableName = 'locks') {
$this->pdo = $pdo;
$this->tableName = $tableName;
@@ -56,13 +56,13 @@ class PDO extends AbstractBackend {
* @param bool $returnChildLocks
* @return array
*/
- public function getLocks($uri, $returnChildLocks) {
+ function getLocks($uri, $returnChildLocks) {
// NOTE: the following 10 lines or so could be easily replaced by
// pure sql. MySQL's non-standard string concatenation prevents us
// from doing this though.
$query = 'SELECT owner, token, timeout, created, scope, depth, uri FROM '.$this->tableName.' WHERE ((created + timeout) > CAST(? AS UNSIGNED INTEGER)) AND ((uri = ?)';
- $params = array(time(),$uri);
+ $params = [time(),$uri];
// We need to check locks for every part in the uri.
$uriParts = explode('/',$uri);
@@ -94,7 +94,7 @@ class PDO extends AbstractBackend {
$stmt->execute($params);
$result = $stmt->fetchAll();
- $lockList = array();
+ $lockList = [];
foreach($result as $row) {
$lockInfo = new LockInfo();
@@ -120,7 +120,7 @@ class PDO extends AbstractBackend {
* @param LockInfo $lockInfo
* @return bool
*/
- public function lock($uri, LockInfo $lockInfo) {
+ function lock($uri, LockInfo $lockInfo) {
// We're making the lock timeout 30 minutes
$lockInfo->timeout = 30*60;
@@ -135,10 +135,26 @@ class PDO extends AbstractBackend {
if ($exists) {
$stmt = $this->pdo->prepare('UPDATE '.$this->tableName.' SET owner = ?, timeout = ?, scope = ?, depth = ?, uri = ?, created = ? WHERE token = ?');
- $stmt->execute(array($lockInfo->owner,$lockInfo->timeout,$lockInfo->scope,$lockInfo->depth,$uri,$lockInfo->created,$lockInfo->token));
+ $stmt->execute([
+ $lockInfo->owner,
+ $lockInfo->timeout,
+ $lockInfo->scope,
+ $lockInfo->depth,
+ $uri,
+ $lockInfo->created,
+ $lockInfo->token
+ ]);
} else {
$stmt = $this->pdo->prepare('INSERT INTO '.$this->tableName.' (owner,timeout,scope,depth,uri,created,token) VALUES (?,?,?,?,?,?,?)');
- $stmt->execute(array($lockInfo->owner,$lockInfo->timeout,$lockInfo->scope,$lockInfo->depth,$uri,$lockInfo->created,$lockInfo->token));
+ $stmt->execute([
+ $lockInfo->owner,
+ $lockInfo->timeout,
+ $lockInfo->scope,
+ $lockInfo->depth,
+ $uri,
+ $lockInfo->created,
+ $lockInfo->token
+ ]);
}
return true;
@@ -154,10 +170,10 @@ class PDO extends AbstractBackend {
* @param LockInfo $lockInfo
* @return bool
*/
- public function unlock($uri, LockInfo $lockInfo) {
+ function unlock($uri, LockInfo $lockInfo) {
$stmt = $this->pdo->prepare('DELETE FROM '.$this->tableName.' WHERE uri = ? AND token = ?');
- $stmt->execute(array($uri,$lockInfo->token));
+ $stmt->execute([$uri, $lockInfo->token]);
return $stmt->rowCount()===1;
diff --git a/lib/DAV/Locks/Plugin.php b/lib/DAV/Locks/Plugin.php
index f1a5e07..01ffa86 100644
--- a/lib/DAV/Locks/Plugin.php
+++ b/lib/DAV/Locks/Plugin.php
@@ -42,7 +42,7 @@ class Plugin extends DAV\ServerPlugin {
*
* @param Backend\BackendInterface $locksBackend
*/
- public function __construct(Backend\BackendInterface $locksBackend = null) {
+ function __construct(Backend\BackendInterface $locksBackend = null) {
$this->locksBackend = $locksBackend;
@@ -56,7 +56,7 @@ class Plugin extends DAV\ServerPlugin {
* @param DAV\Server $server
* @return void
*/
- public function initialize(DAV\Server $server) {
+ function initialize(DAV\Server $server) {
$this->server = $server;
$server->on('method:LOCK', [$this, 'httpLock']);
@@ -75,7 +75,7 @@ class Plugin extends DAV\ServerPlugin {
*
* @return string
*/
- public function getPluginName() {
+ function getPluginName() {
return 'locks';
@@ -89,7 +89,7 @@ class Plugin extends DAV\ServerPlugin {
* @param DAV\INode $node
* @return void
*/
- public function propFind(DAV\PropFind $propFind, DAV\INode $node) {
+ function propFind(DAV\PropFind $propFind, DAV\INode $node) {
$propFind->handle('{DAV:}supportedlock', function() {
return new DAV\Property\SupportedLock(!!$this->locksBackend);
@@ -112,7 +112,7 @@ class Plugin extends DAV\ServerPlugin {
* @param string $uri
* @return array
*/
- public function getHTTPMethods($uri) {
+ function getHTTPMethods($uri) {
if ($this->locksBackend)
return ['LOCK','UNLOCK'];
@@ -129,9 +129,9 @@ class Plugin extends DAV\ServerPlugin {
*
* @return array
*/
- public function getFeatures() {
+ function getFeatures() {
- return array(2);
+ return [2];
}
@@ -148,9 +148,9 @@ class Plugin extends DAV\ServerPlugin {
* @param bool $returnChildLocks
* @return array
*/
- public function getLocks($uri, $returnChildLocks = false) {
+ function getLocks($uri, $returnChildLocks = false) {
- $lockList = array();
+ $lockList = [];
if ($this->locksBackend)
$lockList = array_merge($lockList,$this->locksBackend->getLocks($uri, $returnChildLocks));
@@ -174,7 +174,7 @@ class Plugin extends DAV\ServerPlugin {
* @param ResponseInterface $response
* @return bool
*/
- public function httpLock(RequestInterface $request, ResponseInterface $response) {
+ function httpLock(RequestInterface $request, ResponseInterface $response) {
$lastLock = null;
@@ -280,7 +280,7 @@ class Plugin extends DAV\ServerPlugin {
* @param ResponseInterface $response
* @return void
*/
- public function httpUnlock(RequestInterface $request, ResponseInterface $response) {
+ function httpUnlock(RequestInterface $request, ResponseInterface $response) {
$lockToken = $request->getHeader('Lock-Token');
@@ -323,7 +323,7 @@ class Plugin extends DAV\ServerPlugin {
* @param string $path
* @return void
*/
- public function afterUnbind($path) {
+ function afterUnbind($path) {
$locks = $this->getLocks($path, $includeChildren = true);
foreach($locks as $lock) {
@@ -342,7 +342,7 @@ class Plugin extends DAV\ServerPlugin {
* @param LockInfo $lockInfo
* @return bool
*/
- public function lockNode($uri,LockInfo $lockInfo) {
+ function lockNode($uri,LockInfo $lockInfo) {
if (!$this->server->emit('beforeLock', [$uri,$lockInfo])) return;
@@ -360,7 +360,7 @@ class Plugin extends DAV\ServerPlugin {
* @param LockInfo $lockInfo
* @return bool
*/
- public function unlockNode($uri, LockInfo $lockInfo) {
+ function unlockNode($uri, LockInfo $lockInfo) {
if (!$this->server->emit('beforeUnlock', [$uri,$lockInfo])) return;
if ($this->locksBackend) return $this->locksBackend->unlock($uri,$lockInfo);
@@ -375,7 +375,7 @@ class Plugin extends DAV\ServerPlugin {
*
* @return int
*/
- public function getTimeoutHeader() {
+ function getTimeoutHeader() {
$header = $this->server->httpRequest->getHeader('Timeout');
@@ -412,7 +412,7 @@ class Plugin extends DAV\ServerPlugin {
$lockDiscovery = $dom->createElementNS('DAV:','d:lockdiscovery');
$prop->appendChild($lockDiscovery);
- $lockObj = new DAV\Property\LockDiscovery(array($lockInfo));
+ $lockObj = new DAV\Property\LockDiscovery([$lockInfo]);
$lockObj->serialize($this->server,$lockDiscovery);
return $dom->saveXML();
@@ -432,7 +432,7 @@ class Plugin extends DAV\ServerPlugin {
* @param mixed $conditions
* @return void
*/
- public function validateTokens( RequestInterface $request, &$conditions ) {
+ function validateTokens( RequestInterface $request, &$conditions ) {
// First we need to gather a list of locks that must be satisfied.
$mustLocks = [];
diff --git a/lib/DAV/Mount/Plugin.php b/lib/DAV/Mount/Plugin.php
index fb3fed3..e876b78 100644
--- a/lib/DAV/Mount/Plugin.php
+++ b/lib/DAV/Mount/Plugin.php
@@ -31,7 +31,7 @@ class Plugin extends DAV\ServerPlugin {
* @param DAV\Server $server
* @return void
*/
- public function initialize(DAV\Server $server) {
+ function initialize(DAV\Server $server) {
$this->server = $server;
$this->server->on('method:GET', [$this,'httpGet'], 90);
@@ -46,7 +46,7 @@ class Plugin extends DAV\ServerPlugin {
* @param ResponseInterface $response
* @return bool
*/
- public function httpGet(RequestInterface $request, ResponseInterface $response) {
+ function httpGet(RequestInterface $request, ResponseInterface $response) {
$queryParams = $request->getQueryParameters();
if (!array_key_exists('mount', $queryParams)) return;
@@ -69,7 +69,7 @@ class Plugin extends DAV\ServerPlugin {
* @param string $uri absolute uri
* @return void
*/
- public function davMount(ResponseInterface $response, $uri) {
+ function davMount(ResponseInterface $response, $uri) {
$response->setStatus(200);
$response->setHeader('Content-Type','application/davmount+xml');
diff --git a/lib/DAV/Node.php b/lib/DAV/Node.php
index 44e47be..a10cce6 100644
--- a/lib/DAV/Node.php
+++ b/lib/DAV/Node.php
@@ -20,7 +20,7 @@ abstract class Node implements INode {
*
* @return int
*/
- public function getLastModified() {
+ function getLastModified() {
return time();
@@ -32,7 +32,7 @@ abstract class Node implements INode {
* @throws Sabre\DAV\Exception\Forbidden
* @return void
*/
- public function delete() {
+ function delete() {
throw new Exception\Forbidden('Permission denied to delete node');
@@ -45,7 +45,7 @@ abstract class Node implements INode {
* @param string $name The new name
* @return void
*/
- public function setName($name) {
+ function setName($name) {
throw new Exception\Forbidden('Permission denied to rename file');
diff --git a/lib/DAV/ObjectTree.php b/lib/DAV/ObjectTree.php
index 8c2bbcc..3c5c3fc 100644
--- a/lib/DAV/ObjectTree.php
+++ b/lib/DAV/ObjectTree.php
@@ -27,7 +27,7 @@ class ObjectTree extends Tree {
*
* @var array
*/
- protected $cache = array();
+ protected $cache = [];
/**
* Creates the object
@@ -36,7 +36,7 @@ class ObjectTree extends Tree {
*
* @param ICollection $rootNode
*/
- public function __construct(ICollection $rootNode) {
+ function __construct(ICollection $rootNode) {
$this->rootNode = $rootNode;
@@ -48,7 +48,7 @@ class ObjectTree extends Tree {
* @param string $path
* @return INode
*/
- public function getNodeForPath($path) {
+ function getNodeForPath($path) {
$path = trim($path,'/');
if (isset($this->cache[$path])) return $this->cache[$path];
@@ -86,7 +86,7 @@ class ObjectTree extends Tree {
* @param string $path
* @return bool
*/
- public function nodeExists($path) {
+ function nodeExists($path) {
try {
@@ -113,7 +113,7 @@ class ObjectTree extends Tree {
* @param string $path
* @return array
*/
- public function getChildren($path) {
+ function getChildren($path) {
$node = $this->getNodeForPath($path);
$children = $node->getChildren();
@@ -144,7 +144,7 @@ class ObjectTree extends Tree {
* @param string $path
* @return void
*/
- public function markDirty($path) {
+ function markDirty($path) {
// We don't care enough about sub-paths
// flushing the entire cache
@@ -171,7 +171,7 @@ class ObjectTree extends Tree {
* @param array $paths List of nodes that must be fetched.
* @return array
*/
- public function getMultipleNodes($paths) {
+ function getMultipleNodes($paths) {
// Finding common parents
$parents = [];
diff --git a/lib/DAV/PartialUpdate/Plugin.php b/lib/DAV/PartialUpdate/Plugin.php
index c92ec28..26fe61b 100644
--- a/lib/DAV/PartialUpdate/Plugin.php
+++ b/lib/DAV/PartialUpdate/Plugin.php
@@ -42,7 +42,7 @@ class Plugin extends DAV\ServerPlugin {
* @param DAV\Server $server
* @return void
*/
- public function initialize(DAV\Server $server) {
+ function initialize(DAV\Server $server) {
$this->server = $server;
$server->on('method:PATCH', [$this,'httpPatch']);
@@ -57,7 +57,7 @@ class Plugin extends DAV\ServerPlugin {
*
* @return string
*/
- public function getPluginName() {
+ function getPluginName() {
return 'partialupdate';
@@ -70,24 +70,24 @@ class Plugin extends DAV\ServerPlugin {
* This method is passed a uri. It should only return HTTP methods that are
* available for the specified uri.
*
- * We claim to support PATCH method (partial update) if and only if
+ * We claim to support PATCH method (partirl update) if and only if
* - the node exist
* - the node implements our partial update interface
*
* @param string $uri
* @return array
*/
- public function getHTTPMethods($uri) {
+ function getHTTPMethods($uri) {
$tree = $this->server->tree;
if ($tree->nodeExists($uri)) {
$node = $tree->getNodeForPath($uri);
if ($node instanceof IFile || $node instanceof IPatchSupport) {
- return array('PATCH');
+ return ['PATCH'];
}
}
- return array();
+ return [];
}
@@ -96,9 +96,9 @@ class Plugin extends DAV\ServerPlugin {
*
* @return array
*/
- public function getFeatures() {
+ function getFeatures() {
- return array('sabredav-partialupdate');
+ return ['sabredav-partialupdate'];
}
@@ -113,7 +113,7 @@ class Plugin extends DAV\ServerPlugin {
* @param ResponseInterface $response
* @return void
*/
- public function httpPatch(RequestInterface $request, ResponseInterface $response) {
+ function httpPatch(RequestInterface $request, ResponseInterface $response) {
$path = $request->getPath();
@@ -201,15 +201,15 @@ class Plugin extends DAV\ServerPlugin {
* Examples:
*
* null - invalid
- * array(1) - append
- * array(2,10,15) - update bytes 10, 11, 12, 13, 14, 15
- * array(2,10,null) - update bytes 10 until the end of the patch body
- * array(3,-5) - update from 5 bytes from the end of the file.
+ * [1] - append
+ * [2,10,15] - update bytes 10, 11, 12, 13, 14, 15
+ * [2,10,null] - update bytes 10 until the end of the patch body
+ * [3,-5] - update from 5 bytes from the end of the file.
*
* @param RequestInterface $request
* @return array|null
*/
- public function getHTTPUpdateRange(RequestInterface $request) {
+ function getHTTPUpdateRange(RequestInterface $request) {
$range = $request->getHeader('X-Update-Range');
if (is_null($range)) return null;
@@ -219,11 +219,11 @@ class Plugin extends DAV\ServerPlugin {
if (!preg_match('/^(append)|(?:bytes=([0-9]+)-([0-9]*))|(?:bytes=(-[0-9]+))$/i',$range,$matches)) return null;
if ($matches[1]==='append') {
- return array(self::RANGE_APPEND);
+ return [self::RANGE_APPEND];
} elseif (strlen($matches[2])>0) {
- return array(self::RANGE_START, $matches[2], $matches[3]?:null);
+ return [self::RANGE_START, $matches[2], $matches[3]?:null];
} elseif ($matches[4]) {
- return array(self::RANGE_END, $matches[4]);
+ return [self::RANGE_END, $matches[4]];
} else {
return null;
}
diff --git a/lib/DAV/PropFind.php b/lib/DAV/PropFind.php
index 247a0af..9f9dae2 100644
--- a/lib/DAV/PropFind.php
+++ b/lib/DAV/PropFind.php
@@ -40,7 +40,7 @@ class PropFind {
* @param int $depth
* @param int $requestType
*/
- public function __construct($path, array $properties, $depth = 0, $requestType = self::NORMAL) {
+ function __construct($path, array $properties, $depth = 0, $requestType = self::NORMAL) {
$this->path = $path;
$this->properties = $properties;
@@ -91,7 +91,7 @@ class PropFind {
* @param mixed $valueOrCallBack
* @return void
*/
- public function handle($propertyName, $valueOrCallBack) {
+ function handle($propertyName, $valueOrCallBack) {
if ($this->itemsLeft && isset($this->result[$propertyName]) && $this->result[$propertyName][0] === 404) {
if (is_callable($valueOrCallBack)) {
@@ -118,7 +118,7 @@ class PropFind {
* @param int $status
* @return void
*/
- public function set($propertyName, $value, $status = null) {
+ function set($propertyName, $value, $status = null) {
if (is_null($status)) {
$status = is_null($value) ? 404 : 200;
@@ -146,7 +146,7 @@ class PropFind {
* @param string $propertyName
* @return mixed
*/
- public function get($propertyName) {
+ function get($propertyName) {
return isset($this->result[$propertyName])?$this->result[$propertyName][1]:null;
@@ -161,7 +161,7 @@ class PropFind {
* @param string $propertyName
* @return int|null
*/
- public function getStatus($propertyName) {
+ function getStatus($propertyName) {
return isset($this->result[$propertyName])?$this->result[$propertyName][0]:null;
@@ -173,7 +173,7 @@ class PropFind {
* @param string $path
* @return void
*/
- public function setPath($path) {
+ function setPath($path) {
$this->path = $path;
@@ -184,7 +184,7 @@ class PropFind {
*
* @return string
*/
- public function getPath() {
+ function getPath() {
return $this->path;
@@ -195,7 +195,7 @@ class PropFind {
*
* @return int
*/
- public function getDepth() {
+ function getDepth() {
return $this->depth;
@@ -207,7 +207,7 @@ class PropFind {
* @param int $depth
* @return void
*/
- public function setDepth($depth) {
+ function setDepth($depth) {
$this->depth = $depth;
@@ -219,7 +219,7 @@ class PropFind {
*
* @return array
*/
- public function get404Properties() {
+ function get404Properties() {
if ($this->itemsLeft === 0) {
return [];
@@ -241,7 +241,7 @@ class PropFind {
*
* @return array
*/
- public function getRequestedProperties() {
+ function getRequestedProperties() {
return $this->properties;
@@ -259,7 +259,7 @@ class PropFind {
*
* @return array
*/
- public function getResultForMultiStatus() {
+ function getResultForMultiStatus() {
$r = [
200 => [],
diff --git a/lib/DAV/PropPatch.php b/lib/DAV/PropPatch.php
index b7e834f..4c537a9 100644
--- a/lib/DAV/PropPatch.php
+++ b/lib/DAV/PropPatch.php
@@ -56,7 +56,7 @@ class PropPatch {
*
* @param array $mutations A list of updates
*/
- public function __construct(array $mutations) {
+ function __construct(array $mutations) {
$this->mutations = $mutations;
@@ -77,7 +77,7 @@ class PropPatch {
* @param callable $callback
* @return void
*/
- public function handle($properties, callable $callback) {
+ function handle($properties, callable $callback) {
$usedProperties = [];
foreach((array)$properties as $propertyName) {
@@ -113,7 +113,7 @@ class PropPatch {
* @param callable $callback
* @return void
*/
- public function handleRemaining(callable $callback) {
+ function handleRemaining(callable $callback) {
$properties = $this->getRemainingMutations();
if (!$properties) {
@@ -140,7 +140,7 @@ class PropPatch {
* @param int $resultCode
* @return void
*/
- public function setResultCode($properties, $resultCode) {
+ function setResultCode($properties, $resultCode) {
foreach((array)$properties as $propertyName) {
$this->result[$propertyName] = $resultCode;
@@ -158,7 +158,7 @@ class PropPatch {
* @param int $resultCode
* @return void
*/
- public function setRemainingResultCode($resultCode) {
+ function setRemainingResultCode($resultCode) {
$this->setResultCode(
$this->getRemainingMutations(),
@@ -172,7 +172,7 @@ class PropPatch {
*
* @return array
*/
- public function getRemainingMutations() {
+ function getRemainingMutations() {
$remaining = [];
foreach($this->mutations as $propertyName => $propValue) {
@@ -193,7 +193,7 @@ class PropPatch {
*
* @return bool
*/
- public function commit() {
+ function commit() {
// First we validate if every property has a handler
foreach($this->mutations as $propertyName => $value) {
@@ -324,7 +324,7 @@ class PropPatch {
*
* @return array
*/
- public function getResult() {
+ function getResult() {
return $this->result;
@@ -335,7 +335,7 @@ class PropPatch {
*
* @return array
*/
- public function getMutations() {
+ function getMutations() {
return $this->mutations;
diff --git a/lib/DAV/Property/GetLastModified.php b/lib/DAV/Property/GetLastModified.php
index 987e3fc..4fc9586 100644
--- a/lib/DAV/Property/GetLastModified.php
+++ b/lib/DAV/Property/GetLastModified.php
@@ -32,7 +32,7 @@ class GetLastModified extends DAV\Property {
*
* @param int|DateTime $time
*/
- public function __construct($time) {
+ function __construct($time) {
if ($time instanceof \DateTime) {
$this->time = $time;
@@ -54,7 +54,7 @@ class GetLastModified extends DAV\Property {
* @param \DOMElement $prop
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $prop) {
+ function serialize(DAV\Server $server, \DOMElement $prop) {
$doc = $prop->ownerDocument;
//$prop->setAttribute('xmlns:b','urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/');
@@ -68,7 +68,7 @@ class GetLastModified extends DAV\Property {
*
* @return \DateTime
*/
- public function getTime() {
+ function getTime() {
return $this->time;
diff --git a/lib/DAV/Property/Href.php b/lib/DAV/Property/Href.php
index 20ecbf8..042ccec 100644
--- a/lib/DAV/Property/Href.php
+++ b/lib/DAV/Property/Href.php
@@ -36,7 +36,7 @@ class Href extends DAV\Property implements IHref {
* @param string $href
* @param bool $autoPrefix
*/
- public function __construct($href, $autoPrefix = true) {
+ function __construct($href, $autoPrefix = true) {
$this->href = $href;
$this->autoPrefix = $autoPrefix;
@@ -48,7 +48,7 @@ class Href extends DAV\Property implements IHref {
*
* @return string
*/
- public function getHref() {
+ function getHref() {
return $this->href;
@@ -63,7 +63,7 @@ class Href extends DAV\Property implements IHref {
* @param \DOMElement $dom
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $dom) {
+ function serialize(DAV\Server $server, \DOMElement $dom) {
$prefix = $server->xmlNamespaces['DAV:'];
$elem = $dom->ownerDocument->createElement($prefix . ':href');
diff --git a/lib/DAV/Property/HrefList.php b/lib/DAV/Property/HrefList.php
index 6bfa5c2..6b87019 100644
--- a/lib/DAV/Property/HrefList.php
+++ b/lib/DAV/Property/HrefList.php
@@ -35,7 +35,7 @@ class HrefList extends DAV\Property {
* @param array $hrefs
* @param bool $autoPrefix
*/
- public function __construct(array $hrefs, $autoPrefix = true) {
+ function __construct(array $hrefs, $autoPrefix = true) {
$this->hrefs = $hrefs;
$this->autoPrefix = $autoPrefix;
@@ -47,7 +47,7 @@ class HrefList extends DAV\Property {
*
* @return array
*/
- public function getHrefs() {
+ function getHrefs() {
return $this->hrefs;
@@ -62,7 +62,7 @@ class HrefList extends DAV\Property {
* @param \DOMElement $dom
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $dom) {
+ function serialize(DAV\Server $server,\DOMElement $dom) {
$prefix = $server->xmlNamespaces['DAV:'];
@@ -93,7 +93,7 @@ class HrefList extends DAV\Property {
*/
static function unserialize(\DOMElement $dom, array $propertyMap) {
- $hrefs = array();
+ $hrefs = [];
foreach($dom->childNodes as $child) {
if (DAV\XMLUtil::toClarkNotation($child)==='{DAV:}href') {
$hrefs[] = $child->textContent;
diff --git a/lib/DAV/Property/LockDiscovery.php b/lib/DAV/Property/LockDiscovery.php
index 0f7e709..ed3c138 100644
--- a/lib/DAV/Property/LockDiscovery.php
+++ b/lib/DAV/Property/LockDiscovery.php
@@ -36,7 +36,7 @@ class LockDiscovery extends DAV\Property {
* @param array $locks
* @param bool $revealLockToken
*/
- public function __construct($locks) {
+ function __construct($locks) {
$this->locks = $locks;
@@ -49,7 +49,7 @@ class LockDiscovery extends DAV\Property {
* @param \DOMElement $prop
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $prop) {
+ function serialize(DAV\Server $server, \DOMElement $prop) {
$doc = $prop->ownerDocument;
diff --git a/lib/DAV/Property/ResourceType.php b/lib/DAV/Property/ResourceType.php
index 4ed0513..55e9ed6 100644
--- a/lib/DAV/Property/ResourceType.php
+++ b/lib/DAV/Property/ResourceType.php
@@ -21,19 +21,19 @@ class ResourceType extends DAV\Property {
*
* @var array
*/
- public $resourceType = array();
+ public $resourceType = [];
/**
* __construct
*
* @param mixed $resourceType
*/
- public function __construct($resourceType = []) {
+ function __construct($resourceType = []) {
if (is_array($resourceType))
$this->resourceType = $resourceType;
else
- $this->resourceType = array($resourceType);
+ $this->resourceType = [$resourceType];
}
@@ -44,7 +44,7 @@ class ResourceType extends DAV\Property {
* @param \DOMElement $prop
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $prop) {
+ function serialize(DAV\Server $server, \DOMElement $prop) {
$propName = null;
$rt = $this->resourceType;
@@ -66,11 +66,11 @@ class ResourceType extends DAV\Property {
/**
* Returns the values in clark-notation
*
- * For example array('{DAV:}collection')
+ * For example ['{DAV:}collection']
*
* @return array
*/
- public function getValue() {
+ function getValue() {
return $this->resourceType;
@@ -82,7 +82,7 @@ class ResourceType extends DAV\Property {
* @param string $type
* @return bool
*/
- public function is($type) {
+ function is($type) {
return in_array($type, $this->resourceType);
@@ -94,7 +94,7 @@ class ResourceType extends DAV\Property {
* @param string $type
* @return void
*/
- public function add($type) {
+ function add($type) {
$this->resourceType[] = $type;
$this->resourceType = array_unique($this->resourceType);
@@ -108,9 +108,9 @@ class ResourceType extends DAV\Property {
* @param array $propertyMap
* @return DAV\Property\ResourceType
*/
- static public function unserialize(\DOMElement $dom, array $propertyMap) {
+ static function unserialize(\DOMElement $dom, array $propertyMap) {
- $value = array();
+ $value = [];
foreach($dom->childNodes as $child) {
$value[] = DAV\XMLUtil::toClarkNotation($child);
diff --git a/lib/DAV/Property/Response.php b/lib/DAV/Property/Response.php
index a5b76dd..e2bb21e 100644
--- a/lib/DAV/Property/Response.php
+++ b/lib/DAV/Property/Response.php
@@ -61,7 +61,7 @@ class Response extends DAV\Property implements IHref {
* @param array $responseProperties
* @param string $httpStatus
*/
- public function __construct($href, array $responseProperties, $httpStatus = null) {
+ function __construct($href, array $responseProperties, $httpStatus = null) {
$this->href = $href;
$this->responseProperties = $responseProperties;
@@ -74,7 +74,7 @@ class Response extends DAV\Property implements IHref {
*
* @return string
*/
- public function getHref() {
+ function getHref() {
return $this->href;
@@ -85,7 +85,7 @@ class Response extends DAV\Property implements IHref {
*
* @return string
*/
- public function getHttpStatus() {
+ function getHttpStatus() {
return $this->httpStatus;
@@ -96,7 +96,7 @@ class Response extends DAV\Property implements IHref {
*
* @return array
*/
- public function getResponseProperties() {
+ function getResponseProperties() {
return $this->responseProperties;
@@ -109,7 +109,7 @@ class Response extends DAV\Property implements IHref {
* @param \DOMElement $dom
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $dom) {
+ function serialize(DAV\Server $server, \DOMElement $dom) {
$document = $dom->ownerDocument;
$properties = $this->responseProperties;
@@ -207,7 +207,7 @@ class Response extends DAV\Property implements IHref {
* @param array $propertyMap
* @return DAV\IProperty
*/
- public static function unserialize(\DOMElement $prop, array $propertyMap) {
+ static function unserialize(\DOMElement $prop, array $propertyMap) {
// Delegating this to the ResponseList property. It does make more
// sense there.
diff --git a/lib/DAV/Property/ResponseList.php b/lib/DAV/Property/ResponseList.php
index d15ac85..ceef79c 100644
--- a/lib/DAV/Property/ResponseList.php
+++ b/lib/DAV/Property/ResponseList.php
@@ -30,7 +30,7 @@ class ResponseList extends DAV\Property {
*
* @param array $responses;
*/
- public function __construct($responses) {
+ function __construct($responses) {
foreach($responses as $response) {
if (!($response instanceof Response)) {
@@ -46,7 +46,7 @@ class ResponseList extends DAV\Property {
*
* @return Response[]
*/
- public function getResponses() {
+ function getResponses() {
return $this->responses;
@@ -59,7 +59,7 @@ class ResponseList extends DAV\Property {
* @param \DOMElement $dom
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $dom) {
+ function serialize(DAV\Server $server,\DOMElement $dom) {
foreach($this->responses as $response) {
$response->serialize($server, $dom);
@@ -76,7 +76,7 @@ class ResponseList extends DAV\Property {
* @param array $propertyMap
* @return DAV\IProperty
*/
- public static function unserialize(\DOMElement $prop, array $propertyMap) {
+ static function unserialize(\DOMElement $prop, array $propertyMap) {
$xpath = new \DOMXPath( $prop->ownerDocument );
$xpath->registerNamespace('d','urn:DAV');
@@ -87,7 +87,7 @@ class ResponseList extends DAV\Property {
$prop
);
- $result = array();
+ $result = [];
for($jj=0; $jj < $xResponses->length; $jj++) {
diff --git a/lib/DAV/Property/SupportedLock.php b/lib/DAV/Property/SupportedLock.php
index 035c2f3..a49f621 100644
--- a/lib/DAV/Property/SupportedLock.php
+++ b/lib/DAV/Property/SupportedLock.php
@@ -28,7 +28,7 @@ class SupportedLock extends DAV\Property {
*
* @param mixed $supportsLocks
*/
- public function __construct($supportsLocks) {
+ function __construct($supportsLocks) {
$this->supportsLocks = $supportsLocks;
@@ -41,7 +41,7 @@ class SupportedLock extends DAV\Property {
* @param \DOMElement $prop
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $prop) {
+ function serialize(DAV\Server $server,\DOMElement $prop) {
$doc = $prop->ownerDocument;
diff --git a/lib/DAV/Property/SupportedMethodSet.php b/lib/DAV/Property/SupportedMethodSet.php
index dfb4420..b0f6503 100644
--- a/lib/DAV/Property/SupportedMethodSet.php
+++ b/lib/DAV/Property/SupportedMethodSet.php
@@ -29,7 +29,7 @@ class SupportedMethodSet extends DAV\Property {
*
* @param string[] $methods
*/
- public function __construct(array $method) {
+ function __construct(array $method) {
$this->methods = $method;
@@ -40,7 +40,7 @@ class SupportedMethodSet extends DAV\Property {
*
* @return string[]
*/
- public function getValue() {
+ function getValue() {
return $this->methods;
@@ -53,7 +53,7 @@ class SupportedMethodSet extends DAV\Property {
* @param \DOMElement $prop
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $prop) {
+ function serialize(DAV\Server $server, \DOMElement $prop) {
foreach($this->methods as $method) {
diff --git a/lib/DAV/Property/SupportedReportSet.php b/lib/DAV/Property/SupportedReportSet.php
index 6551ea0..28a28d1 100644
--- a/lib/DAV/Property/SupportedReportSet.php
+++ b/lib/DAV/Property/SupportedReportSet.php
@@ -21,7 +21,7 @@ class SupportedReportSet extends DAV\Property {
*
* @var array
*/
- protected $reports = array();
+ protected $reports = [];
/**
* Creates the property
@@ -33,7 +33,7 @@ class SupportedReportSet extends DAV\Property {
*
* @param mixed $reports
*/
- public function __construct($reports = null) {
+ function __construct($reports = null) {
if (!is_null($reports))
$this->addReport($reports);
@@ -49,9 +49,9 @@ class SupportedReportSet extends DAV\Property {
* @param mixed $report
* @return void
*/
- public function addReport($report) {
+ function addReport($report) {
- if (!is_array($report)) $report = array($report);
+ if (!is_array($report)) $report = [$report];
foreach($report as $r) {
@@ -69,7 +69,7 @@ class SupportedReportSet extends DAV\Property {
*
* @return array
*/
- public function getValue() {
+ function getValue() {
return $this->reports;
@@ -81,7 +81,7 @@ class SupportedReportSet extends DAV\Property {
* @param string $reportName
* @return bool
*/
- public function has($reportName) {
+ function has($reportName) {
return in_array(
$reportName,
@@ -97,7 +97,7 @@ class SupportedReportSet extends DAV\Property {
* @param \DOMElement $prop
* @return void
*/
- public function serialize(DAV\Server $server, \DOMElement $prop) {
+ function serialize(DAV\Server $server, \DOMElement $prop) {
foreach($this->reports as $reportName) {
diff --git a/lib/DAV/PropertyInterface.php b/lib/DAV/PropertyInterface.php
index 00765e0..60ebee0 100644
--- a/lib/DAV/PropertyInterface.php
+++ b/lib/DAV/PropertyInterface.php
@@ -20,7 +20,7 @@ interface PropertyInterface {
* @param \DOMElement $prop
* @return void
*/
- public function serialize(Server $server, \DOMElement $prop);
+ function serialize(Server $server, \DOMElement $prop);
/**
* This method unserializes the property FROM an xml document.
@@ -33,7 +33,7 @@ interface PropertyInterface {
* @param array $propertyMap
* @return mixed
*/
- static public function unserialize(\DOMElement $prop, array $propertyMap);
+ static function unserialize(\DOMElement $prop, array $propertyMap);
}
diff --git a/lib/DAV/PropertyStorage/Backend/BackendInterface.php b/lib/DAV/PropertyStorage/Backend/BackendInterface.php
index e4f9e58..746378b 100644
--- a/lib/DAV/PropertyStorage/Backend/BackendInterface.php
+++ b/lib/DAV/PropertyStorage/Backend/BackendInterface.php
@@ -21,7 +21,7 @@ interface BackendInterface {
* @param PropFind $propFind
* @return void
*/
- public function propFind($path, PropFind $propFind);
+ function propFind($path, PropFind $propFind);
/**
* Updates properties for a path
@@ -36,14 +36,14 @@ interface BackendInterface {
* @param PropPatch $propPatch
* @return void
*/
- public function propPatch($path, PropPatch $propPatch);
+ function propPatch($path, PropPatch $propPatch);
/**
* This method is called after a node is deleted.
*
* This allows a backend to clean up all associated properties.
*/
- public function delete($path);
+ function delete($path);
/**
* This method is called after a successful MOVE
@@ -56,6 +56,6 @@ interface BackendInterface {
* @param string $destination
* @return void
*/
- public function move($source, $destination);
+ function move($source, $destination);
}
diff --git a/lib/DAV/PropertyStorage/Backend/PDO.php b/lib/DAV/PropertyStorage/Backend/PDO.php
index 3b2d23d..f518e92 100644
--- a/lib/DAV/PropertyStorage/Backend/PDO.php
+++ b/lib/DAV/PropertyStorage/Backend/PDO.php
@@ -19,7 +19,7 @@ class PDO implements BackendInterface {
*
* @param \PDO $pdo
*/
- public function __construct(\PDO $pdo) {
+ function __construct(\PDO $pdo) {
$this->pdo = $pdo;
@@ -39,7 +39,7 @@ class PDO implements BackendInterface {
* @param PropFind $propFind
* @return void
*/
- public function propFind($path, PropFind $propFind) {
+ function propFind($path, PropFind $propFind) {
$propertyNames = $propFind->get404Properties();
if (!$propertyNames) {
@@ -69,7 +69,7 @@ class PDO implements BackendInterface {
* @param PropPatch $propPatch
* @return void
*/
- public function propPatch($path, PropPatch $propPatch) {
+ function propPatch($path, PropPatch $propPatch) {
$propPatch->handleRemaining(function($properties) use ($path) {
@@ -97,7 +97,7 @@ class PDO implements BackendInterface {
*
* This allows a backend to clean up all associated properties.
*/
- public function delete($path) {
+ function delete($path) {
$stmt = $this->pdo->prepare("DELETE FROM propertystorage WHERE path = ?");
$stmt->execute([$path]);
@@ -115,7 +115,7 @@ class PDO implements BackendInterface {
* @param string $destination
* @return void
*/
- public function move($source, $destination) {
+ function move($source, $destination) {
// I don't know a way to write this all in a single sql query that's
// also compatible across db engines, so we're letting PHP do all the
diff --git a/lib/DAV/PropertyStorage/Plugin.php b/lib/DAV/PropertyStorage/Plugin.php
index ff8bec5..14f60bf 100644
--- a/lib/DAV/PropertyStorage/Plugin.php
+++ b/lib/DAV/PropertyStorage/Plugin.php
@@ -27,7 +27,7 @@ class Plugin extends ServerPlugin {
*
* @param Backend\BackendInterface $backend
*/
- public function __construct(Backend\BackendInterface $backend) {
+ function __construct(Backend\BackendInterface $backend) {
$this->backend = $backend;
@@ -44,7 +44,7 @@ class Plugin extends ServerPlugin {
* @param Server $server
* @return void
*/
- public function initialize(Server $server) {
+ function initialize(Server $server) {
$server->on('propFind', [$this, 'propFind'], 130);
$server->on('propPatch', [$this, 'propPatch'], 300);
@@ -63,7 +63,7 @@ class Plugin extends ServerPlugin {
* @param INode $node
* @return void
*/
- public function propFind(PropFind $propFind, INode $node) {
+ function propFind(PropFind $propFind, INode $node) {
$path = $propFind->getPath();
$pathFilter = $this->pathFilter;
@@ -82,7 +82,7 @@ class Plugin extends ServerPlugin {
* @param PropPatch $propPatch
* @return void
*/
- public function propPatch($path, PropPatch $propPatch) {
+ function propPatch($path, PropPatch $propPatch) {
$pathFilter = $this->pathFilter;
if ($pathFilter && !$pathFilter($path)) return;
@@ -99,7 +99,7 @@ class Plugin extends ServerPlugin {
* @param string $path
* @return void
*/
- public function afterUnbind($path) {
+ function afterUnbind($path) {
$pathFilter = $this->pathFilter;
if ($pathFilter && !$pathFilter($path)) return;
@@ -116,7 +116,7 @@ class Plugin extends ServerPlugin {
* @param string $destination
* @return void
*/
- public function afterMove($source, $destination) {
+ function afterMove($source, $destination) {
$pathFilter = $this->pathFilter;
if ($pathFilter && !$pathFilter($source)) return;
diff --git a/lib/DAV/ServerPlugin.php b/lib/DAV/ServerPlugin.php
index 8fb43c2..415b1e6 100644
--- a/lib/DAV/ServerPlugin.php
+++ b/lib/DAV/ServerPlugin.php
@@ -24,7 +24,7 @@ abstract class ServerPlugin {
* @param Server $server
* @return void
*/
- abstract public function initialize(Server $server);
+ abstract function initialize(Server $server);
/**
* This method should return a list of server-features.
@@ -34,7 +34,7 @@ abstract class ServerPlugin {
*
* @return array
*/
- public function getFeatures() {
+ function getFeatures() {
return [];
@@ -50,7 +50,7 @@ abstract class ServerPlugin {
* @param string $path
* @return array
*/
- public function getHTTPMethods($path) {
+ function getHTTPMethods($path) {
return [];
@@ -64,7 +64,7 @@ abstract class ServerPlugin {
*
* @return string
*/
- public function getPluginName() {
+ function getPluginName() {
return get_class($this);
@@ -80,7 +80,7 @@ abstract class ServerPlugin {
* @param string $uri
* @return array
*/
- public function getSupportedReportSet($uri) {
+ function getSupportedReportSet($uri) {
return [];
diff --git a/lib/DAV/SimpleCollection.php b/lib/DAV/SimpleCollection.php
index bf9f32c..e5dc706 100644
--- a/lib/DAV/SimpleCollection.php
+++ b/lib/DAV/SimpleCollection.php
@@ -19,7 +19,7 @@ class SimpleCollection extends Collection {
*
* @var INode[]
*/
- protected $children = array();
+ protected $children = [];
/**
* Name of this resource
@@ -37,7 +37,7 @@ class SimpleCollection extends Collection {
* @param string $name
* @param INode[] $children
*/
- public function __construct($name,array $children = array()) {
+ function __construct($name, array $children = []) {
$this->name = $name;
foreach($children as $child) {
@@ -55,7 +55,7 @@ class SimpleCollection extends Collection {
* @param INode $child
* @return void
*/
- public function addChild(INode $child) {
+ function addChild(INode $child) {
$this->children[$child->getName()] = $child;
@@ -66,7 +66,7 @@ class SimpleCollection extends Collection {
*
* @return string
*/
- public function getName() {
+ function getName() {
return $this->name;
@@ -85,7 +85,7 @@ class SimpleCollection extends Collection {
* @throws Exception\NotFound
* @return INode
*/
- public function getChild($name) {
+ function getChild($name) {
if (isset($this->children[$name])) return $this->children[$name];
throw new Exception\NotFound('File not found: ' . $name . ' in \'' . $this->getName() . '\'');
@@ -97,7 +97,7 @@ class SimpleCollection extends Collection {
*
* @return INode[]
*/
- public function getChildren() {
+ function getChildren() {
return array_values($this->children);
diff --git a/lib/DAV/SimpleFile.php b/lib/DAV/SimpleFile.php
index b7413fd..840470b 100644
--- a/lib/DAV/SimpleFile.php
+++ b/lib/DAV/SimpleFile.php
@@ -20,7 +20,7 @@ class SimpleFile extends File {
*
* @var string
*/
- protected $contents = array();
+ protected $contents = [];
/**
* Name of this resource
@@ -46,7 +46,7 @@ class SimpleFile extends File {
* @param string $contents
* @param string|null $mimeType
*/
- public function __construct($name, $contents, $mimeType = null) {
+ function __construct($name, $contents, $mimeType = null) {
$this->name = $name;
$this->contents = $contents;
@@ -61,7 +61,7 @@ class SimpleFile extends File {
*
* @return string
*/
- public function getName() {
+ function getName() {
return $this->name;
@@ -74,7 +74,7 @@ class SimpleFile extends File {
*
* @return mixed
*/
- public function get() {
+ function get() {
return $this->contents;
@@ -85,7 +85,7 @@ class SimpleFile extends File {
*
* @return int
*/
- public function getSize() {
+ function getSize() {
return strlen($this->contents);
@@ -100,7 +100,7 @@ class SimpleFile extends File {
* Return null if the ETag can not effectively be determined
* @return string
*/
- public function getETag() {
+ function getETag() {
return '"' . md5($this->contents) . '"';
@@ -112,7 +112,7 @@ class SimpleFile extends File {
* If null is returned, we'll assume application/octet-stream
* @return string
*/
- public function getContentType() {
+ function getContentType() {
return $this->mimeType;
diff --git a/lib/DAV/StringUtil.php b/lib/DAV/StringUtil.php
index c71575f..62c4354 100644
--- a/lib/DAV/StringUtil.php
+++ b/lib/DAV/StringUtil.php
@@ -24,7 +24,7 @@ class StringUtil {
* @param string $matchType
* @return bool
*/
- static public function textMatch($haystack, $needle, $collation, $matchType = 'contains') {
+ static function textMatch($haystack, $needle, $collation, $matchType = 'contains') {
switch($collation) {
@@ -76,9 +76,9 @@ class StringUtil {
* @param string $input
* @return string
*/
- static public function ensureUTF8($input) {
+ static function ensureUTF8($input) {
- $encoding = mb_detect_encoding($input , array('UTF-8','ISO-8859-1'), true);
+ $encoding = mb_detect_encoding($input , ['UTF-8','ISO-8859-1'], true);
if ($encoding === 'ISO-8859-1') {
return utf8_encode($input);
diff --git a/lib/DAV/Sync/ISyncCollection.php b/lib/DAV/Sync/ISyncCollection.php
index 11f8540..13f1cb9 100644
--- a/lib/DAV/Sync/ISyncCollection.php
+++ b/lib/DAV/Sync/ISyncCollection.php
@@ -34,7 +34,7 @@ interface ISyncCollection extends DAV\ICollection {
*
* This function should return an array, such as the following:
*
- * array(
+ * [
* 'syncToken' => 'The current synctoken',
* 'added' => [
* 'new.txt',
@@ -46,7 +46,7 @@ interface ISyncCollection extends DAV\ICollection {
* 'foo.php.bak',
* 'old.txt'
* )
- * );
+ * ];
*
* The syncToken property should reflect the *current* syncToken of the
* collection, as reported getSyncToken(). This is needed here too, to
diff --git a/lib/DAV/Sync/Plugin.php b/lib/DAV/Sync/Plugin.php
index c4c13df..d0cfdea 100644
--- a/lib/DAV/Sync/Plugin.php
+++ b/lib/DAV/Sync/Plugin.php
@@ -36,7 +36,7 @@ class Plugin extends DAV\ServerPlugin {
*
* @return string
*/
- public function getPluginName() {
+ function getPluginName() {
return 'sync';
@@ -50,7 +50,7 @@ class Plugin extends DAV\ServerPlugin {
* @param DAV\Server $server
* @return void
*/
- public function initialize(DAV\Server $server) {
+ function initialize(DAV\Server $server) {
$this->server = $server;
@@ -81,16 +81,16 @@ class Plugin extends DAV\ServerPlugin {
* @param string $uri
* @return array
*/
- public function getSupportedReportSet($uri) {
+ function getSupportedReportSet($uri) {
$node = $this->server->tree->getNodeForPath($uri);
if ($node instanceof ISyncCollection && $node->getSyncToken()) {
- return array(
+ return [
'{DAV:}sync-collection',
- );
+ ];
}
- return array();
+ return [];
}
@@ -102,7 +102,7 @@ class Plugin extends DAV\ServerPlugin {
* @param \DOMDocument $dom
* @return void
*/
- public function syncCollection($uri, \DOMDocument $dom) {
+ function syncCollection($uri, \DOMDocument $dom) {
// rfc3253 specifies 0 is the default value for Depth:
$depth = $this->server->getHTTPDepth(0);
@@ -208,12 +208,12 @@ class Plugin extends DAV\ServerPlugin {
DAV\XMLUtil::parseProperties($dom->documentElement)
);
- return array(
+ return [
$syncToken,
$syncLevel,
$limit,
$properties,
- );
+ ];
}
@@ -264,7 +264,7 @@ class Plugin extends DAV\ServerPlugin {
foreach($deleted as $item) {
$fullPath = $collectionUrl . '/' . $item;
- $response = new DAV\Property\Response($fullPath, array(), 404);
+ $response = new DAV\Property\Response($fullPath, [], 404);
$response->serialize($this->server, $multiStatus);
}
@@ -286,7 +286,7 @@ class Plugin extends DAV\ServerPlugin {
* @param DAV\INode $node
* @return void
*/
- public function propFind(DAV\PropFind $propFind, DAV\INode $node) {
+ function propFind(DAV\PropFind $propFind, DAV\INode $node) {
$propFind->handle('{DAV:}sync-token', function() use ($node) {
if (!$node instanceof ISyncCollection || !$token = $node->getSyncToken()) {
@@ -306,7 +306,7 @@ class Plugin extends DAV\ServerPlugin {
* @param mixed $conditions
* @return void
*/
- public function validateTokens( RequestInterface $request, &$conditions ) {
+ function validateTokens( RequestInterface $request, &$conditions ) {
foreach($conditions as $kk=>$condition) {
diff --git a/lib/DAV/TemporaryFileFilterPlugin.php b/lib/DAV/TemporaryFileFilterPlugin.php
index ea08756..e5a4716 100644
--- a/lib/DAV/TemporaryFileFilterPlugin.php
+++ b/lib/DAV/TemporaryFileFilterPlugin.php
@@ -38,7 +38,7 @@ class TemporaryFileFilterPlugin extends ServerPlugin {
*
* @var array
*/
- public $temporaryFilePatterns = array(
+ public $temporaryFilePatterns = [
'/^\._(.*)$/', // OS/X resource forks
'/^.DS_Store$/', // OS/X custom folder settings
'/^desktop.ini$/', // Windows custom folder settings
@@ -46,7 +46,7 @@ class TemporaryFileFilterPlugin extends ServerPlugin {
'/^.(.*).swp$/', // ViM temporary files
'/^\.dat(.*)$/', // Smultron seems to create these
'/^~lock.(.*)#$/', // Windows 7 lockfiles
- );
+ ];
/**
* A reference to the main Server class
@@ -72,7 +72,7 @@ class TemporaryFileFilterPlugin extends ServerPlugin {
*
* @param string|null $dataDir
*/
- public function __construct($dataDir = null) {
+ function __construct($dataDir = null) {
if (!$dataDir) $dataDir = ini_get('session.save_path').'/sabredav/';
if (!is_dir($dataDir)) mkdir($dataDir);
@@ -89,7 +89,7 @@ class TemporaryFileFilterPlugin extends ServerPlugin {
* @param Server $server
* @return void
*/
- public function initialize(Server $server) {
+ function initialize(Server $server) {
$this->server = $server;
$server->on('beforeMethod', [$this,'beforeMethod']);
@@ -107,7 +107,7 @@ class TemporaryFileFilterPlugin extends ServerPlugin {
* @param ResponseInterface $response
* @return bool
*/
- public function beforeMethod(RequestInterface $request, ResponseInterface $response) {
+ function beforeMethod(RequestInterface $request, ResponseInterface $response) {
if (!$tempLocation = $this->isTempFile($request->getPath()))
return true;
@@ -136,7 +136,7 @@ class TemporaryFileFilterPlugin extends ServerPlugin {
* @param resource $data
* @return bool
*/
- public function beforeCreateFile($uri,$data) {
+ function beforeCreateFile($uri,$data) {
if ($tempPath = $this->isTempFile($uri)) {
@@ -185,7 +185,7 @@ class TemporaryFileFilterPlugin extends ServerPlugin {
* @param string $tempLocation
* @return bool
*/
- public function httpGet(RequestInterface $request, ResponseInterface $hR, $tempLocation) {
+ function httpGet(RequestInterface $request, ResponseInterface $hR, $tempLocation) {
if (!file_exists($tempLocation)) return true;
@@ -206,7 +206,7 @@ class TemporaryFileFilterPlugin extends ServerPlugin {
* @param string $tempLocation
* @return bool
*/
- public function httpPut(RequestInterface $request, ResponseInterface $hR, $tempLocation) {
+ function httpPut(RequestInterface $request, ResponseInterface $hR, $tempLocation) {
$hR->setHeader('X-Sabre-Temp','true');
@@ -233,7 +233,7 @@ class TemporaryFileFilterPlugin extends ServerPlugin {
* @param string $tempLocation
* @return bool
*/
- public function httpDelete(RequestInterface $request, ResponseInterface $hR, $tempLocation) {
+ function httpDelete(RequestInterface $request, ResponseInterface $hR, $tempLocation) {
if (!file_exists($tempLocation)) return true;
@@ -256,7 +256,7 @@ class TemporaryFileFilterPlugin extends ServerPlugin {
* @param string $tempLocation
* @return bool
*/
- public function httpPropfind(RequestInterface $request, ResponseInterface $hR, $tempLocation) {
+ function httpPropfind(RequestInterface $request, ResponseInterface $hR, $tempLocation) {
if (!file_exists($tempLocation)) return true;
diff --git a/lib/DAV/Tree.php b/lib/DAV/Tree.php
index 46440ad..e33ee44 100644
--- a/lib/DAV/Tree.php
+++ b/lib/DAV/Tree.php
@@ -32,7 +32,7 @@ abstract class Tree {
* @param string $path
* @return bool
*/
- public function nodeExists($path) {
+ function nodeExists($path) {
try {
@@ -54,7 +54,7 @@ abstract class Tree {
* @param string $destinationPath The full destination path
* @return void
*/
- public function copy($sourcePath, $destinationPath) {
+ function copy($sourcePath, $destinationPath) {
$sourceNode = $this->getNodeForPath($sourcePath);
@@ -75,7 +75,7 @@ abstract class Tree {
* @param string $destinationPath The full destination path, so not just the destination parent node
* @return int
*/
- public function move($sourcePath, $destinationPath) {
+ function move($sourcePath, $destinationPath) {
list($sourceDir, $sourceName) = URLUtil::splitPath($sourcePath);
list($destinationDir, $destinationName) = URLUtil::splitPath($destinationPath);
@@ -98,7 +98,7 @@ abstract class Tree {
* @param string $path
* @return void
*/
- public function delete($path) {
+ function delete($path) {
$node = $this->getNodeForPath($path);
$node->delete();
@@ -114,7 +114,7 @@ abstract class Tree {
* @param string $path
* @return array
*/
- public function getChildren($path) {
+ function getChildren($path) {
$node = $this->getNodeForPath($path);
return $node->getChildren();
@@ -139,7 +139,7 @@ abstract class Tree {
* @param string $path
* @return void
*/
- public function markDirty($path) {
+ function markDirty($path) {
}
@@ -158,7 +158,7 @@ abstract class Tree {
* @param array $paths List of nodes that must be fetched.
* @return array
*/
- public function getMultipleNodes($paths) {
+ function getMultipleNodes($paths) {
$result = [];
foreach($paths as $path) {
@@ -209,7 +209,7 @@ abstract class Tree {
}
if ($source instanceof IProperties && $destination instanceof IProperties) {
- $props = $source->getProperties(array());
+ $props = $source->getProperties([]);
$propPatch = new PropPatch($props);
$destination->propPatch($propPatch);
$propPatch->commit();
diff --git a/lib/DAV/Tree/Filesystem.php b/lib/DAV/Tree/Filesystem.php
index ab34836..2a54b51 100644
--- a/lib/DAV/Tree/Filesystem.php
+++ b/lib/DAV/Tree/Filesystem.php
@@ -33,7 +33,7 @@ class Filesystem extends DAV\Tree {
*
* @param string $basePath
*/
- public function __construct($basePath) {
+ function __construct($basePath) {
$this->basePath = $basePath;
@@ -45,7 +45,7 @@ class Filesystem extends DAV\Tree {
* @param string $path
* @return DAV\FS\Node
*/
- public function getNodeForPath($path) {
+ function getNodeForPath($path) {
$realPath = $this->getRealPath($path);
if (!file_exists($realPath)) {
@@ -81,7 +81,7 @@ class Filesystem extends DAV\Tree {
* @param string $destination
* @return void
*/
- public function copy($source,$destination) {
+ function copy($source,$destination) {
$source = $this->getRealPath($source);
$destination = $this->getRealPath($destination);
@@ -121,7 +121,7 @@ class Filesystem extends DAV\Tree {
* @param string $destination
* @return void
*/
- public function move($source,$destination) {
+ function move($source,$destination) {
$source = $this->getRealPath($source);
$destination = $this->getRealPath($destination);
diff --git a/lib/DAV/XMLUtil.php b/lib/DAV/XMLUtil.php
index 9b063fe..b0a09e2 100644
--- a/lib/DAV/XMLUtil.php
+++ b/lib/DAV/XMLUtil.php
@@ -60,10 +60,10 @@ class XMLUtil {
throw new \InvalidArgumentException('\'' . $str . '\' is not a valid clark-notation formatted string');
}
- return array(
+ return [
$matches[1],
$matches[2]
- );
+ ];
}
@@ -165,9 +165,9 @@ class XMLUtil {
* @param array $propertyMap
* @return array
*/
- static function parseProperties(\DOMElement $parentNode, array $propertyMap = array()) {
+ static function parseProperties(\DOMElement $parentNode, array $propertyMap = []) {
- $propList = array();
+ $propList = [];
foreach($parentNode->childNodes as $propNode) {
if (self::toClarkNotation($propNode)!=='{DAV:}prop') continue;
@@ -179,7 +179,7 @@ class XMLUtil {
$propertyName = self::toClarkNotation($propNodeData);
if (isset($propertyMap[$propertyName])) {
- $propList[$propertyName] = call_user_func(array($propertyMap[$propertyName],'unserialize'),$propNodeData, $propertyMap);
+ $propList[$propertyName] = call_user_func([$propertyMap[$propertyName],'unserialize'],$propNodeData, $propertyMap);
} else {
$propList[$propertyName] = $propNodeData->textContent;
}
diff --git a/lib/DAVACL/Property/Acl.php b/lib/DAVACL/Property/Acl.php
index 4d01c9a..354dac9 100644
--- a/lib/DAVACL/Property/Acl.php
+++ b/lib/DAVACL/Property/Acl.php
@@ -45,7 +45,7 @@ class Acl extends DAV\Property {
* @param bool $prefixBaseUrl
* @param array $privileges
*/
- public function __construct(array $privileges, $prefixBaseUrl = true) {
+ function __construct(array $privileges, $prefixBaseUrl = true) {
$this->privileges = $privileges;
$this->prefixBaseUrl = $prefixBaseUrl;
@@ -57,7 +57,7 @@ class Acl extends DAV\Property {
*
* @return array
*/
- public function getPrivileges() {
+ function getPrivileges() {
return $this->privileges;
@@ -70,7 +70,7 @@ class Acl extends DAV\Property {
* @param \DOMElement $node
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $node) {
+ function serialize(DAV\Server $server,\DOMElement $node) {
$doc = $node->ownerDocument;
foreach($this->privileges as $ace) {
@@ -88,7 +88,7 @@ class Acl extends DAV\Property {
* @param array $propertyMap
* @return Acl
*/
- static public function unserialize(\DOMElement $dom, array $propertyMap) {
+ static function unserialize(\DOMElement $dom, array $propertyMap) {
$privileges = [];
$xaces = $dom->getElementsByTagNameNS('urn:DAV','ace');
diff --git a/lib/DAVACL/Property/AclRestrictions.php b/lib/DAVACL/Property/AclRestrictions.php
index aa6fd17..1961818 100644
--- a/lib/DAVACL/Property/AclRestrictions.php
+++ b/lib/DAVACL/Property/AclRestrictions.php
@@ -22,7 +22,7 @@ class AclRestrictions extends DAV\Property {
* @param \DOMElement $elem
* @return void
*/
- public function serialize(DAV\Server $server,\DOMElement $elem) {
+ function serialize(DAV\Server $server,\DOMElement $elem) {
$doc = $elem->ownerDocument;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git
More information about the Pkg-owncloud-commits
mailing list