diff --git a/.gitignore b/.gitignore index f287cca1af..db1c54bc57 100644 --- a/.gitignore +++ b/.gitignore @@ -21,9 +21,6 @@ bin/vobject bin/generate_vcards bin/phpdocmd -# Assuming every .php file in the root is for testing -/*.php - # Other testing stuff /tmpdata /data @@ -37,4 +34,4 @@ build.properties docs/api docs/wikidocs -.php_cs.cache +.php-cs-fixer.cache diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 79% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index c5c78a971d..eb32278a05 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -1,6 +1,6 @@ getFinder() ->exclude('vendor') ->in(__DIR__); diff --git a/bin/migrateto20.php b/bin/migrateto20.php index fb24fe599d..a258f25c73 100755 --- a/bin/migrateto20.php +++ b/bin/migrateto20.php @@ -34,7 +34,7 @@ HELLO; - exit(); + exit; } // There's a bunch of places where the autoloader could be, so we'll try all of diff --git a/bin/migrateto21.php b/bin/migrateto21.php index 2c15b0a217..a8776f096b 100755 --- a/bin/migrateto21.php +++ b/bin/migrateto21.php @@ -35,7 +35,7 @@ HELLO; - exit(); + exit; } // There's a bunch of places where the autoloader could be, so we'll try all of diff --git a/bin/migrateto30.php b/bin/migrateto30.php index 9798cadd25..5ca99c6476 100755 --- a/bin/migrateto30.php +++ b/bin/migrateto30.php @@ -34,7 +34,7 @@ HELLO; - exit(); + exit; } // There's a bunch of places where the autoloader could be, so we'll try all of diff --git a/bin/migrateto32.php b/bin/migrateto32.php index 09ac55d13e..210f1c1818 100755 --- a/bin/migrateto32.php +++ b/bin/migrateto32.php @@ -35,7 +35,7 @@ HELLO; - exit(); + exit; } // There's a bunch of places where the autoloader could be, so we'll try all of @@ -110,7 +110,7 @@ UNIQUE(calendarid, share_href) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; SQL - ); + ); $pdo->exec(' INSERT INTO calendarinstances ( @@ -159,7 +159,7 @@ UNIQUE (calendarid, share_href) ); SQL - ); + ); $pdo->exec(' INSERT INTO calendarinstances ( @@ -233,7 +233,7 @@ components VARBINARY(21) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; SQL -); + ); break; case 'sqlite': $pdo->exec(<<addPlugin(new Sabre\DAV\Auth\Plugin($authBackend)); $server->addPlugin(new Sabre\DAV\Browser\Plugin()); -//$server->addPlugin(new Sabre\CalDAV\Plugin()); +// $server->addPlugin(new Sabre\CalDAV\Plugin()); $server->addPlugin(new Sabre\CardDAV\Plugin()); $server->addPlugin(new Sabre\DAVACL\Plugin()); $server->addPlugin(new Sabre\DAV\Sync\Plugin()); diff --git a/examples/groupwareserver.php b/examples/groupwareserver.php index 2c3eb6ee79..48d9e61852 100644 --- a/examples/groupwareserver.php +++ b/examples/groupwareserver.php @@ -78,7 +78,7 @@ // Logging $server->setLogger($logger); -//$server->debugExceptions = true; //enable this to include the stacktrace in exception responses +// $server->debugExceptions = true; //enable this to include the stacktrace in exception responses // Plugins $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend)); diff --git a/lib/CalDAV/Backend/AbstractBackend.php b/lib/CalDAV/Backend/AbstractBackend.php index c761bff51b..2d7a6515be 100644 --- a/lib/CalDAV/Backend/AbstractBackend.php +++ b/lib/CalDAV/Backend/AbstractBackend.php @@ -29,8 +29,6 @@ abstract class AbstractBackend implements BackendInterface * promise I can handle updating this property". * * Read the PropPatch documentation for more info and examples. - * - * @param mixed $calendarId */ public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch) { @@ -44,8 +42,6 @@ public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch) * * If the backend supports this, it may allow for some speed-ups. * - * @param mixed $calendarId - * * @return array */ public function getMultipleCalendarObjects($calendarId, array $uris) @@ -100,8 +96,6 @@ public function getMultipleCalendarObjects($calendarId, array $uris) * as possible, so it gives you a good idea on what type of stuff you need * to think of. * - * @param mixed $calendarId - * * @return array */ public function calendarQuery($calendarId, array $filters) diff --git a/lib/CalDAV/Backend/BackendInterface.php b/lib/CalDAV/Backend/BackendInterface.php index 8bfa7446ab..1c78f92a9d 100644 --- a/lib/CalDAV/Backend/BackendInterface.php +++ b/lib/CalDAV/Backend/BackendInterface.php @@ -51,8 +51,6 @@ public function getCalendarsForUser($principalUri); * * @param string $principalUri * @param string $calendarUri - * - * @return mixed */ public function createCalendar($principalUri, $calendarUri, array $properties); @@ -67,15 +65,11 @@ public function createCalendar($principalUri, $calendarUri, array $properties); * promise I can handle updating this property". * * Read the PropPatch documentation for more info and examples. - * - * @param mixed $calendarId */ public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch); /** * Delete a calendar and all its objects. - * - * @param mixed $calendarId */ public function deleteCalendar($calendarId); @@ -107,8 +101,6 @@ public function deleteCalendar($calendarId); * used/fetched to determine these numbers. If both are specified the * amount of times this is needed is reduced by a great degree. * - * @param mixed $calendarId - * * @return array */ public function getCalendarObjects($calendarId); @@ -125,7 +117,6 @@ public function getCalendarObjects($calendarId); * * This method must return null if the object did not exist. * - * @param mixed $calendarId * @param string $objectUri * * @return array|null @@ -140,8 +131,6 @@ public function getCalendarObject($calendarId, $objectUri); * * If the backend supports this, it may allow for some speed-ups. * - * @param mixed $calendarId - * * @return array */ public function getMultipleCalendarObjects($calendarId, array $uris); @@ -159,7 +148,6 @@ public function getMultipleCalendarObjects($calendarId, array $uris); * calendar-data. If the result of a subsequent GET to this object is not * the exact same as this request body, you should omit the ETag. * - * @param mixed $calendarId * @param string $objectUri * @param string $calendarData * @@ -180,7 +168,6 @@ public function createCalendarObject($calendarId, $objectUri, $calendarData); * calendar-data. If the result of a subsequent GET to this object is not * the exact same as this request body, you should omit the ETag. * - * @param mixed $calendarId * @param string $objectUri * @param string $calendarData * @@ -193,7 +180,6 @@ public function updateCalendarObject($calendarId, $objectUri, $calendarData); * * The object uri is only the basename, or filename and not a full path. * - * @param mixed $calendarId * @param string $objectUri */ public function deleteCalendarObject($calendarId, $objectUri); @@ -243,8 +229,6 @@ public function deleteCalendarObject($calendarId, $objectUri); * as possible, so it gives you a good idea on what type of stuff you need * to think of. * - * @param mixed $calendarId - * * @return array */ public function calendarQuery($calendarId, array $filters); diff --git a/lib/CalDAV/Backend/PDO.php b/lib/CalDAV/Backend/PDO.php index b9f112cf8d..53ef03f333 100644 --- a/lib/CalDAV/Backend/PDO.php +++ b/lib/CalDAV/Backend/PDO.php @@ -31,7 +31,7 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S * in 2038-01-19 to avoid problems when the date is converted * to a unix timestamp. */ - const MAX_DATE = '2038-01-01'; + public const MAX_DATE = '2038-01-01'; /** * pdo. @@ -193,8 +193,8 @@ public function getCalendarsForUser($principalUri) // 1 = owner, 2 = readonly, 3 = readwrite if ($row['access'] > 1) { // We need to find more information about the original owner. - //$stmt2 = $this->pdo->prepare('SELECT principaluri FROM ' . $this->calendarInstancesTableName . ' WHERE access = 1 AND id = ?'); - //$stmt2->execute([$row['id']]); + // $stmt2 = $this->pdo->prepare('SELECT principaluri FROM ' . $this->calendarInstancesTableName . ' WHERE access = 1 AND id = ?'); + // $stmt2->execute([$row['id']]); // read-only is for backwards compatbility. Might go away in // the future. @@ -287,8 +287,6 @@ public function createCalendar($principalUri, $calendarUri, array $properties) * promise I can handle updating this property". * * Read the PropPatch documentation for more info and examples. - * - * @param mixed $calendarId */ public function updateCalendar($calendarId, PropPatch $propPatch) { @@ -331,8 +329,6 @@ public function updateCalendar($calendarId, PropPatch $propPatch) /** * Delete a calendar and all it's objects. - * - * @param mixed $calendarId */ public function deleteCalendar($calendarId) { @@ -399,8 +395,6 @@ public function deleteCalendar($calendarId) * used/fetched to determine these numbers. If both are specified the * amount of times this is needed is reduced by a great degree. * - * @param mixed $calendarId - * * @return array */ public function getCalendarObjects($calendarId) @@ -440,7 +434,6 @@ public function getCalendarObjects($calendarId) * * This method must return null if the object did not exist. * - * @param mixed $calendarId * @param string $objectUri * * @return array|null @@ -479,8 +472,6 @@ public function getCalendarObject($calendarId, $objectUri) * * If the backend supports this, it may allow for some speed-ups. * - * @param mixed $calendarId - * * @return array */ public function getMultipleCalendarObjects($calendarId, array $uris) @@ -529,7 +520,6 @@ public function getMultipleCalendarObjects($calendarId, array $uris) * calendar-data. If the result of a subsequent GET to this object is not * the exact same as this request body, you should omit the ETag. * - * @param mixed $calendarId * @param string $objectUri * @param string $calendarData * @@ -575,7 +565,6 @@ public function createCalendarObject($calendarId, $objectUri, $calendarData) * calendar-data. If the result of a subsequent GET to this object is not * the exact same as this request body, you should omit the ETag. * - * @param mixed $calendarId * @param string $objectUri * @param string $calendarData * @@ -691,7 +680,6 @@ protected function getDenormalizedData($calendarData) * * The object uri is only the basename, or filename and not a full path. * - * @param mixed $calendarId * @param string $objectUri */ public function deleteCalendarObject($calendarId, $objectUri) @@ -755,8 +743,6 @@ public function deleteCalendarObject($calendarId, $objectUri) * This specific implementation (for the PDO) backend optimizes filters on * specific components, and VEVENT time-ranges. * - * @param mixed $calendarId - * * @return array */ public function calendarQuery($calendarId, array $filters) @@ -934,7 +920,6 @@ public function getCalendarObjectByUID($principalUri, $uid) * * The limit is 'suggestive'. You are free to ignore it. * - * @param mixed $calendarId * @param string $syncToken * @param int $syncLevel * @param int $limit @@ -1031,9 +1016,8 @@ public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limi /** * Adds a change record to the calendarchanges table. * - * @param mixed $calendarId * @param string $objectUri - * @param int $operation 1 = add, 2 = modify, 3 = delete + * @param int $operation 1 = add, 2 = modify, 3 = delete */ protected function addChange($calendarId, $objectUri, $operation) { @@ -1128,8 +1112,6 @@ public function getSubscriptionsForUser($principalUri) * * @param string $principalUri * @param string $uri - * - * @return mixed */ public function createSubscription($principalUri, $uri, array $properties) { @@ -1177,8 +1159,6 @@ public function createSubscription($principalUri, $uri, array $properties) * promise I can handle updating this property". * * Read the PropPatch documentation for more info and examples. - * - * @param mixed $subscriptionId */ public function updateSubscription($subscriptionId, PropPatch $propPatch) { @@ -1214,8 +1194,6 @@ public function updateSubscription($subscriptionId, PropPatch $propPatch) /** * Deletes a subscription. - * - * @param mixed $subscriptionId */ public function deleteSubscription($subscriptionId) { @@ -1323,7 +1301,6 @@ public function createSchedulingObject($principalUri, $objectUri, $objectData) /** * Updates the list of shares. * - * @param mixed $calendarId * @param \Sabre\DAV\Xml\Element\Sharee[] $sharees */ public function updateInvites($calendarId, array $sharees) @@ -1431,8 +1408,6 @@ public function updateInvites($calendarId, array $sharees) * and optionally: * $properties * - * @param mixed $calendarId - * * @return \Sabre\DAV\Xml\Element\Sharee[] */ public function getInvites($calendarId) @@ -1462,7 +1437,7 @@ public function getInvites($calendarId) $result[] = new Sharee([ 'href' => isset($row['share_href']) ? $row['share_href'] : \Sabre\HTTP\encodePath($row['principaluri']), 'access' => (int) $row['access'], - /// Everyone is always immediately accepted, for now. + // Everyone is always immediately accepted, for now. 'inviteStatus' => (int) $row['share_invitestatus'], 'properties' => !empty($row['share_displayname']) ? ['{DAV:}displayname' => $row['share_displayname']] @@ -1477,8 +1452,7 @@ public function getInvites($calendarId) /** * Publishes a calendar. * - * @param mixed $calendarId - * @param bool $value + * @param bool $value */ public function setPublishStatus($calendarId, $value) { diff --git a/lib/CalDAV/Backend/SharingSupport.php b/lib/CalDAV/Backend/SharingSupport.php index ce61059902..c5847896f2 100644 --- a/lib/CalDAV/Backend/SharingSupport.php +++ b/lib/CalDAV/Backend/SharingSupport.php @@ -27,7 +27,6 @@ interface SharingSupport extends BackendInterface /** * Updates the list of shares. * - * @param mixed $calendarId * @param \Sabre\DAV\Xml\Element\Sharee[] $sharees */ public function updateInvites($calendarId, array $sharees); @@ -44,8 +43,6 @@ public function updateInvites($calendarId, array $sharees); * and optionally: * $properties * - * @param mixed $calendarId - * * @return \Sabre\DAV\Xml\Element\Sharee[] */ public function getInvites($calendarId); @@ -53,8 +50,7 @@ public function getInvites($calendarId); /** * Publishes a calendar. * - * @param mixed $calendarId - * @param bool $value + * @param bool $value */ public function setPublishStatus($calendarId, $value); } diff --git a/lib/CalDAV/Backend/SimplePDO.php b/lib/CalDAV/Backend/SimplePDO.php index 8f42072c9e..ae6a12fbe1 100644 --- a/lib/CalDAV/Backend/SimplePDO.php +++ b/lib/CalDAV/Backend/SimplePDO.php @@ -228,7 +228,6 @@ public function getCalendarObject($calendarId, $objectUri) * calendar-data. If the result of a subsequent GET to this object is not * the exact same as this request body, you should omit the ETag. * - * @param mixed $calendarId * @param string $objectUri * @param string $calendarData * @@ -259,7 +258,6 @@ public function createCalendarObject($calendarId, $objectUri, $calendarData) * calendar-data. If the result of a subsequent GET to this object is not * the exact same as this request body, you should omit the ETag. * - * @param mixed $calendarId * @param string $objectUri * @param string $calendarData * diff --git a/lib/CalDAV/Backend/SubscriptionSupport.php b/lib/CalDAV/Backend/SubscriptionSupport.php index 7655c2e11a..d9bcd36c10 100644 --- a/lib/CalDAV/Backend/SubscriptionSupport.php +++ b/lib/CalDAV/Backend/SubscriptionSupport.php @@ -58,8 +58,6 @@ public function getSubscriptionsForUser($principalUri); * * @param string $principalUri * @param string $uri - * - * @return mixed */ public function createSubscription($principalUri, $uri, array $properties); @@ -75,15 +73,12 @@ public function createSubscription($principalUri, $uri, array $properties); * * Read the PropPatch documentation for more info and examples. * - * @param mixed $subscriptionId * @param \Sabre\DAV\PropPatch $propPatch */ public function updateSubscription($subscriptionId, DAV\PropPatch $propPatch); /** * Deletes a subscription. - * - * @param mixed $subscriptionId */ public function deleteSubscription($subscriptionId); } diff --git a/lib/CalDAV/Calendar.php b/lib/CalDAV/Calendar.php index 6c0bf54115..3148553903 100644 --- a/lib/CalDAV/Calendar.php +++ b/lib/CalDAV/Calendar.php @@ -366,14 +366,14 @@ public function calendarQuery(array $filters) public function getSyncToken() { if ( - $this->caldavBackend instanceof Backend\SyncSupport && - isset($this->calendarInfo['{DAV:}sync-token']) + $this->caldavBackend instanceof Backend\SyncSupport + && isset($this->calendarInfo['{DAV:}sync-token']) ) { return $this->calendarInfo['{DAV:}sync-token']; } if ( - $this->caldavBackend instanceof Backend\SyncSupport && - isset($this->calendarInfo['{http://sabredav.org/ns}sync-token']) + $this->caldavBackend instanceof Backend\SyncSupport + && isset($this->calendarInfo['{http://sabredav.org/ns}sync-token']) ) { return $this->calendarInfo['{http://sabredav.org/ns}sync-token']; } diff --git a/lib/CalDAV/CalendarQueryValidator.php b/lib/CalDAV/CalendarQueryValidator.php index ee525da7a5..0cbdf3aa5a 100644 --- a/lib/CalDAV/CalendarQueryValidator.php +++ b/lib/CalDAV/CalendarQueryValidator.php @@ -4,7 +4,6 @@ namespace Sabre\CalDAV; -use DateTime; use Sabre\VObject; /** @@ -38,8 +37,8 @@ public function validate(VObject\Component\VCalendar $vObject, array $filters) } return - $this->validateCompFilters($vObject, $filters['comp-filters']) && - $this->validatePropFilters($vObject, $filters['prop-filters']); + $this->validateCompFilters($vObject, $filters['comp-filters']) + && $this->validatePropFilters($vObject, $filters['prop-filters']); } /** @@ -93,8 +92,8 @@ protected function validateCompFilters(VObject\Component $parent, array $filters // for which the subfilters hold true. foreach ($parent->{$filter['name']} as $subComponent) { if ( - $this->validateCompFilters($subComponent, $filter['comp-filters']) && - $this->validatePropFilters($subComponent, $filter['prop-filters'])) { + $this->validateCompFilters($subComponent, $filter['comp-filters']) + && $this->validatePropFilters($subComponent, $filter['prop-filters'])) { // We had a match, so this comp-filter succeeds continue 2; } @@ -162,8 +161,8 @@ protected function validatePropFilters(VObject\Component $parent, array $filters // for which the subfilters hold true. foreach ($parent->{$filter['name']} as $subComponent) { if ( - $this->validateParamFilters($subComponent, $filter['param-filters']) && - (!$filter['text-match'] || $this->validateTextMatch($subComponent, $filter['text-match'])) + $this->validateParamFilters($subComponent, $filter['param-filters']) + && (!$filter['text-match'] || $this->validateTextMatch($subComponent, $filter['text-match'])) ) { // We had a match, so this prop-filter succeeds continue 2; @@ -256,18 +255,18 @@ protected function validateTextMatch($check, array $textMatch) * This is all based on the rules specified in rfc4791, which are quite * complex. * - * @param DateTime $start - * @param DateTime $end + * @param \DateTime $start + * @param \DateTime $end * * @return bool */ protected function validateTimeRange(VObject\Node $component, $start, $end) { if (is_null($start)) { - $start = new DateTime('1900-01-01'); + $start = new \DateTime('1900-01-01'); } if (is_null($end)) { - $end = new DateTime('3000-01-01'); + $end = new \DateTime('3000-01-01'); } switch ($component->name) { diff --git a/lib/CalDAV/ICSExportPlugin.php b/lib/CalDAV/ICSExportPlugin.php index 9171e36e79..128cc0c602 100644 --- a/lib/CalDAV/ICSExportPlugin.php +++ b/lib/CalDAV/ICSExportPlugin.php @@ -4,8 +4,6 @@ namespace Sabre\CalDAV; -use DateTime; -use DateTimeZone; use Sabre\DAV; use Sabre\DAV\Exception\BadRequest; use Sabre\HTTP\RequestInterface; @@ -74,11 +72,11 @@ public function initialize(DAV\Server $server) /** * Intercepts GET requests on calendar urls ending with ?export. * + * @return bool + * * @throws BadRequest * @throws DAV\Exception\NotFound * @throws VObject\InvalidDataException - * - * @return bool */ public function httpGet(RequestInterface $request, ResponseInterface $response) { @@ -113,13 +111,13 @@ public function httpGet(RequestInterface $request, ResponseInterface $response) if (!ctype_digit($queryParams['start'])) { throw new BadRequest('The start= parameter must contain a unix timestamp'); } - $start = DateTime::createFromFormat('U', $queryParams['start']); + $start = \DateTime::createFromFormat('U', $queryParams['start']); } if (isset($queryParams['end'])) { if (!ctype_digit($queryParams['end'])) { throw new BadRequest('The end= parameter must contain a unix timestamp'); } - $end = DateTime::createFromFormat('U', $queryParams['end']); + $end = \DateTime::createFromFormat('U', $queryParams['end']); } if (isset($queryParams['expand']) && (bool) $queryParams['expand']) { if (!$start || !$end) { @@ -161,13 +159,13 @@ public function httpGet(RequestInterface $request, ResponseInterface $response) /** * This method is responsible for generating the actual, full response. * - * @param string $path - * @param DateTime|null $start - * @param DateTime|null $end - * @param bool $expand - * @param string $componentType - * @param string $format - * @param array $properties + * @param string $path + * @param \DateTime|null $start + * @param \DateTime|null $end + * @param bool $expand + * @param string $componentType + * @param string $format + * @param array $properties * * @throws DAV\Exception\NotFound * @throws VObject\InvalidDataException @@ -243,7 +241,7 @@ function ($item) use ($path) { unset($vtimezoneObj); } else { // Defaulting to UTC. - $calendarTimeZone = new DateTimeZone('UTC'); + $calendarTimeZone = new \DateTimeZone('UTC'); } $mergedCalendar = $mergedCalendar->expand($start, $end, $calendarTimeZone); @@ -315,7 +313,7 @@ public function mergeObjects(array $properties, array $inputObjects) $objects[] = clone $child; break; - // VTIMEZONE is special, because we need to filter out the duplicates + // VTIMEZONE is special, because we need to filter out the duplicates case 'VTIMEZONE': // Naively just checking tzid. if (in_array((string) $child->TZID, $collectedTimezones)) { diff --git a/lib/CalDAV/Notifications/Plugin.php b/lib/CalDAV/Notifications/Plugin.php index 56b2fe9384..c1db94cc73 100644 --- a/lib/CalDAV/Notifications/Plugin.php +++ b/lib/CalDAV/Notifications/Plugin.php @@ -31,7 +31,7 @@ class Plugin extends ServerPlugin /** * This is the namespace for the proprietary calendarserver extensions. */ - const NS_CALENDARSERVER = 'http://calendarserver.org/ns/'; + public const NS_CALENDARSERVER = 'http://calendarserver.org/ns/'; /** * Reference to the main server object. diff --git a/lib/CalDAV/Plugin.php b/lib/CalDAV/Plugin.php index 98f4f554c2..d1e6ff67ed 100644 --- a/lib/CalDAV/Plugin.php +++ b/lib/CalDAV/Plugin.php @@ -4,7 +4,6 @@ namespace Sabre\CalDAV; -use DateTimeZone; use Sabre\CalDAV\Xml\Request\CalendarMultiGetReport; use Sabre\DAV; use Sabre\DAV\Exception\BadRequest; @@ -33,18 +32,18 @@ class Plugin extends DAV\ServerPlugin /** * This is the official CalDAV namespace. */ - const NS_CALDAV = 'urn:ietf:params:xml:ns:caldav'; + public const NS_CALDAV = 'urn:ietf:params:xml:ns:caldav'; /** * This is the namespace for the proprietary calendarserver extensions. */ - const NS_CALENDARSERVER = 'http://calendarserver.org/ns/'; + public const NS_CALENDARSERVER = 'http://calendarserver.org/ns/'; /** * The hardcoded root for calendar objects. It is unfortunate * that we're stuck with it, but it will have to do for now. */ - const CALENDAR_ROOT = 'calendars'; + public const CALENDAR_ROOT = 'calendars'; /** * Reference to server object. @@ -240,8 +239,6 @@ public function initialize(DAV\Server $server) * This functions handles REPORT requests specific to CalDAV. * * @param string $reportName - * @param mixed $report - * @param mixed $path * * @return bool|null */ @@ -453,7 +450,7 @@ public function calendarMultiGetReport($report) $timeZone = $vtimezoneObj->VTIMEZONE->getTimeZone(); } else { // Defaulting to UTC. - $timeZone = new DateTimeZone('UTC'); + $timeZone = new \DateTimeZone('UTC'); } $timeZones[$calendarPath] = $timeZone; } @@ -518,7 +515,7 @@ public function calendarQueryReport($report) $vtimezoneObj->destroy(); } else { // Defaulting to UTC. - $calendarTimeZone = new DateTimeZone('UTC'); + $calendarTimeZone = new \DateTimeZone('UTC'); } } @@ -601,7 +598,7 @@ public function calendarQueryReport($report) list($properties) = $this->server->getPropertiesForPath($this->server->getRequestUri().'/'.$path, $report->properties); - if (($needsJson || $report->expand)) { + if ($needsJson || $report->expand) { $vObject = VObject\Reader::read($properties[200]['{'.self::NS_CALDAV.'}calendar-data']); if ($report->expand) { @@ -660,7 +657,7 @@ protected function freeBusyQueryReport(Xml\Request\FreeBusyQueryReport $report) // Destroy circular references so PHP will garbage collect the object. $vtimezoneObj->destroy(); } else { - $calendarTimeZone = new DateTimeZone('UTC'); + $calendarTimeZone = new \DateTimeZone('UTC'); } // Doing a calendar-query first, to make sure we get the most diff --git a/lib/CalDAV/Schedule/IMipPlugin.php b/lib/CalDAV/Schedule/IMipPlugin.php index dcaf951efd..e413b798b3 100644 --- a/lib/CalDAV/Schedule/IMipPlugin.php +++ b/lib/CalDAV/Schedule/IMipPlugin.php @@ -26,17 +26,15 @@ class IMipPlugin extends DAV\ServerPlugin /** * Email address used in From: header. * + * This should generally be some kind of no-reply + * email address that you own. + * * @var string */ protected $senderEmail; /** * Creates the email handler. - * - * @param string $senderEmail. The 'senderEmail' is the email that shows up - * in the 'From:' address. This should - * generally be some kind of no-reply email - * address you own. */ public function __construct($senderEmail) { diff --git a/lib/CalDAV/Schedule/Inbox.php b/lib/CalDAV/Schedule/Inbox.php index 4620690969..94166ee7b2 100644 --- a/lib/CalDAV/Schedule/Inbox.php +++ b/lib/CalDAV/Schedule/Inbox.php @@ -68,7 +68,7 @@ public function getChildren() $objs = $this->caldavBackend->getSchedulingObjects($this->principalUri); $children = []; foreach ($objs as $obj) { - //$obj['acl'] = $this->getACL(); + // $obj['acl'] = $this->getACL(); $obj['principaluri'] = $this->principalUri; $children[] = new SchedulingObject($this->caldavBackend, $obj); } diff --git a/lib/CalDAV/Schedule/Plugin.php b/lib/CalDAV/Schedule/Plugin.php index 5e56596101..00725ce9ed 100644 --- a/lib/CalDAV/Schedule/Plugin.php +++ b/lib/CalDAV/Schedule/Plugin.php @@ -4,7 +4,6 @@ namespace Sabre\CalDAV\Schedule; -use DateTimeZone; use Sabre\CalDAV\ICalendar; use Sabre\CalDAV\ICalendarObject; use Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp; @@ -60,7 +59,7 @@ class Plugin extends ServerPlugin /** * This is the official CalDAV namespace. */ - const NS_CALDAV = 'urn:ietf:params:xml:ns:caldav'; + public const NS_CALDAV = 'urn:ietf:params:xml:ns:caldav'; /** * Reference to main Server object. @@ -269,20 +268,20 @@ public function propFind(PropFind $propFind, INode $node) // old property to a different namespace. $availProp = '{'.self::NS_CALDAV.'}calendar-availability'; $subPropFind = new PropFind( - $propFind->getPath(), - [$availProp] - ); + $propFind->getPath(), + [$availProp] + ); $this->server->getPropertiesByNode( - $subPropFind, - $node - ); + $subPropFind, + $node + ); $propFind->set( - '{http://calendarserver.org/ns/}calendar-availability', - $subPropFind->get($availProp), - $subPropFind->getStatus($availProp) - ); + '{http://calendarserver.org/ns/}calendar-availability', + $subPropFind->get($availProp), + $subPropFind->getStatus($availProp) + ); }); } @@ -873,7 +872,7 @@ protected function getFreeBusyForEmail($email, \DateTimeInterface $start, \DateT // Grabbing the calendar list $objects = []; - $calendarTimeZone = new DateTimeZone('UTC'); + $calendarTimeZone = new \DateTimeZone('UTC'); foreach ($this->server->tree->getNodeForPath($homeSet)->getChildren() as $node) { if (!$node instanceof ICalendar) { diff --git a/lib/CalDAV/SharingPlugin.php b/lib/CalDAV/SharingPlugin.php index f7dca9be69..74dc65e3ec 100644 --- a/lib/CalDAV/SharingPlugin.php +++ b/lib/CalDAV/SharingPlugin.php @@ -224,8 +224,8 @@ public function httpPost(RequestInterface $request, ResponseInterface $response) // Breaking the event chain return false; - // The invite-reply document is sent when the user replies to an - // invitation of a calendar share. + // The invite-reply document is sent when the user replies to an + // invitation of a calendar share. case '{'.Plugin::NS_CALENDARSERVER.'}invite-reply': // This only works on the calendar-home-root node. if (!$node instanceof CalendarHome) { diff --git a/lib/CalDAV/Xml/Filter/CalendarData.php b/lib/CalDAV/Xml/Filter/CalendarData.php index c9656d8a30..e934d0ea57 100644 --- a/lib/CalDAV/Xml/Filter/CalendarData.php +++ b/lib/CalDAV/Xml/Filter/CalendarData.php @@ -46,8 +46,6 @@ class CalendarData implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/CalDAV/Xml/Filter/CompFilter.php b/lib/CalDAV/Xml/Filter/CompFilter.php index 929000bb8b..dcf96c4c97 100644 --- a/lib/CalDAV/Xml/Filter/CompFilter.php +++ b/lib/CalDAV/Xml/Filter/CompFilter.php @@ -43,8 +43,6 @@ class CompFilter implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { @@ -64,28 +62,28 @@ public static function xmlDeserialize(Reader $reader) if (is_array($elems)) { foreach ($elems as $elem) { switch ($elem['name']) { - case '{'.Plugin::NS_CALDAV.'}comp-filter': - $result['comp-filters'][] = $elem['value']; - break; - case '{'.Plugin::NS_CALDAV.'}prop-filter': - $result['prop-filters'][] = $elem['value']; - break; - case '{'.Plugin::NS_CALDAV.'}is-not-defined': - $result['is-not-defined'] = true; - break; - case '{'.Plugin::NS_CALDAV.'}time-range': - if ('VCALENDAR' === $result['name']) { - throw new BadRequest('You cannot add time-range filters on the VCALENDAR component'); - } - $result['time-range'] = [ - 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, - 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, - ]; - if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { - throw new BadRequest('The end-date must be larger than the start-date'); - } - break; - } + case '{'.Plugin::NS_CALDAV.'}comp-filter': + $result['comp-filters'][] = $elem['value']; + break; + case '{'.Plugin::NS_CALDAV.'}prop-filter': + $result['prop-filters'][] = $elem['value']; + break; + case '{'.Plugin::NS_CALDAV.'}is-not-defined': + $result['is-not-defined'] = true; + break; + case '{'.Plugin::NS_CALDAV.'}time-range': + if ('VCALENDAR' === $result['name']) { + throw new BadRequest('You cannot add time-range filters on the VCALENDAR component'); + } + $result['time-range'] = [ + 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, + 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, + ]; + if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { + throw new BadRequest('The end-date must be larger than the start-date'); + } + break; + } } } diff --git a/lib/CalDAV/Xml/Filter/ParamFilter.php b/lib/CalDAV/Xml/Filter/ParamFilter.php index 1e6dd5946d..a012de3655 100644 --- a/lib/CalDAV/Xml/Filter/ParamFilter.php +++ b/lib/CalDAV/Xml/Filter/ParamFilter.php @@ -41,8 +41,6 @@ class ParamFilter implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { @@ -60,17 +58,17 @@ public static function xmlDeserialize(Reader $reader) if (is_array($elems)) { foreach ($elems as $elem) { switch ($elem['name']) { - case '{'.Plugin::NS_CALDAV.'}is-not-defined': - $result['is-not-defined'] = true; - break; - case '{'.Plugin::NS_CALDAV.'}text-match': - $result['text-match'] = [ - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', - 'value' => $elem['value'], - ]; - break; - } + case '{'.Plugin::NS_CALDAV.'}is-not-defined': + $result['is-not-defined'] = true; + break; + case '{'.Plugin::NS_CALDAV.'}text-match': + $result['text-match'] = [ + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', + 'value' => $elem['value'], + ]; + break; + } } } diff --git a/lib/CalDAV/Xml/Filter/PropFilter.php b/lib/CalDAV/Xml/Filter/PropFilter.php index f1d66cc0d6..2ffb946944 100644 --- a/lib/CalDAV/Xml/Filter/PropFilter.php +++ b/lib/CalDAV/Xml/Filter/PropFilter.php @@ -43,8 +43,6 @@ class PropFilter implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { @@ -64,29 +62,29 @@ public static function xmlDeserialize(Reader $reader) if (is_array($elems)) { foreach ($elems as $elem) { switch ($elem['name']) { - case '{'.Plugin::NS_CALDAV.'}param-filter': - $result['param-filters'][] = $elem['value']; - break; - case '{'.Plugin::NS_CALDAV.'}is-not-defined': - $result['is-not-defined'] = true; - break; - case '{'.Plugin::NS_CALDAV.'}time-range': - $result['time-range'] = [ - 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, - 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, - ]; - if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { - throw new BadRequest('The end-date must be larger than the start-date'); - } - break; - case '{'.Plugin::NS_CALDAV.'}text-match': - $result['text-match'] = [ - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', - 'value' => $elem['value'], - ]; - break; - } + case '{'.Plugin::NS_CALDAV.'}param-filter': + $result['param-filters'][] = $elem['value']; + break; + case '{'.Plugin::NS_CALDAV.'}is-not-defined': + $result['is-not-defined'] = true; + break; + case '{'.Plugin::NS_CALDAV.'}time-range': + $result['time-range'] = [ + 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, + 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, + ]; + if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { + throw new BadRequest('The end-date must be larger than the start-date'); + } + break; + case '{'.Plugin::NS_CALDAV.'}text-match': + $result['text-match'] = [ + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', + 'value' => $elem['value'], + ]; + break; + } } } diff --git a/lib/CalDAV/Xml/Notification/Invite.php b/lib/CalDAV/Xml/Notification/Invite.php index 71ccf49b15..28bb00a6b1 100644 --- a/lib/CalDAV/Xml/Notification/Invite.php +++ b/lib/CalDAV/Xml/Notification/Invite.php @@ -5,7 +5,7 @@ namespace Sabre\CalDAV\Xml\Notification; use Sabre\CalDAV; -use Sabre\CalDAV\SharingPlugin as SharingPlugin; +use Sabre\CalDAV\SharingPlugin; use Sabre\DAV; use Sabre\Xml\Writer; diff --git a/lib/CalDAV/Xml/Notification/SystemStatus.php b/lib/CalDAV/Xml/Notification/SystemStatus.php index 666f8f4c5e..cfe892b882 100644 --- a/lib/CalDAV/Xml/Notification/SystemStatus.php +++ b/lib/CalDAV/Xml/Notification/SystemStatus.php @@ -19,9 +19,9 @@ */ class SystemStatus implements NotificationInterface { - const TYPE_LOW = 1; - const TYPE_MEDIUM = 2; - const TYPE_HIGH = 3; + public const TYPE_LOW = 1; + public const TYPE_MEDIUM = 2; + public const TYPE_HIGH = 3; /** * A unique id. diff --git a/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php b/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php index 45e290bc01..7a5fa8dd3c 100644 --- a/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php +++ b/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php @@ -28,8 +28,8 @@ */ class ScheduleCalendarTransp implements Element { - const TRANSPARENT = 'transparent'; - const OPAQUE = 'opaque'; + public const TRANSPARENT = 'transparent'; + public const OPAQUE = 'opaque'; /** * value. @@ -106,8 +106,6 @@ public function xmlSerialize(Writer $writer): void * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php b/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php index 3fe03f4f2d..cfb32efd9d 100644 --- a/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php +++ b/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php @@ -94,8 +94,6 @@ public function xmlSerialize(Writer $writer): void * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php b/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php index 3b3a94b268..dda5a6c4db 100644 --- a/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php +++ b/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php @@ -45,7 +45,7 @@ class CalendarMultiGetReport implements XmlDeserializable * * @var array|null */ - public $expand = null; + public $expand; /** * The mimetype of the content that should be returend. Usually @@ -53,7 +53,7 @@ class CalendarMultiGetReport implements XmlDeserializable * * @var string */ - public $contentType = null; + public $contentType; /** * The version of calendar-data that should be returned. Usually '2.0', @@ -61,7 +61,7 @@ class CalendarMultiGetReport implements XmlDeserializable * * @var string */ - public $version = null; + public $version; /** * The deserialize method is called during xml parsing. @@ -80,8 +80,6 @@ class CalendarMultiGetReport implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/CalDAV/Xml/Request/CalendarQueryReport.php b/lib/CalDAV/Xml/Request/CalendarQueryReport.php index b3cc299d3d..03997d0055 100644 --- a/lib/CalDAV/Xml/Request/CalendarQueryReport.php +++ b/lib/CalDAV/Xml/Request/CalendarQueryReport.php @@ -45,7 +45,7 @@ class CalendarQueryReport implements XmlDeserializable * * @var array|null */ - public $expand = null; + public $expand; /** * The mimetype of the content that should be returend. Usually @@ -53,7 +53,7 @@ class CalendarQueryReport implements XmlDeserializable * * @var string */ - public $contentType = null; + public $contentType; /** * The version of calendar-data that should be returned. Usually '2.0', @@ -61,7 +61,7 @@ class CalendarQueryReport implements XmlDeserializable * * @var string */ - public $version = null; + public $version; /** * The deserialize method is called during xml parsing. @@ -80,8 +80,6 @@ class CalendarQueryReport implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/CalDAV/Xml/Request/FreeBusyQueryReport.php b/lib/CalDAV/Xml/Request/FreeBusyQueryReport.php index 17df05a78a..24b6a650f1 100644 --- a/lib/CalDAV/Xml/Request/FreeBusyQueryReport.php +++ b/lib/CalDAV/Xml/Request/FreeBusyQueryReport.php @@ -54,8 +54,6 @@ class FreeBusyQueryReport implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/CalDAV/Xml/Request/InviteReply.php b/lib/CalDAV/Xml/Request/InviteReply.php index 166721eb36..f73e6b721d 100644 --- a/lib/CalDAV/Xml/Request/InviteReply.php +++ b/lib/CalDAV/Xml/Request/InviteReply.php @@ -97,8 +97,6 @@ public function __construct($href, $calendarUri, $inReplyTo, $summary, $status) * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/CalDAV/Xml/Request/MkCalendar.php b/lib/CalDAV/Xml/Request/MkCalendar.php index b5701e2ead..48c80a32de 100644 --- a/lib/CalDAV/Xml/Request/MkCalendar.php +++ b/lib/CalDAV/Xml/Request/MkCalendar.php @@ -54,8 +54,6 @@ public function getProperties() * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/CalDAV/Xml/Request/Share.php b/lib/CalDAV/Xml/Request/Share.php index d597b76f1e..46a5d6386e 100644 --- a/lib/CalDAV/Xml/Request/Share.php +++ b/lib/CalDAV/Xml/Request/Share.php @@ -56,8 +56,6 @@ public function __construct(array $sharees) * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/CardDAV/AddressBook.php b/lib/CardDAV/AddressBook.php index f5744f644b..69e4ceedb9 100644 --- a/lib/CardDAV/AddressBook.php +++ b/lib/CardDAV/AddressBook.php @@ -250,14 +250,14 @@ public function getChildACL() public function getSyncToken() { if ( - $this->carddavBackend instanceof Backend\SyncSupport && - isset($this->addressBookInfo['{DAV:}sync-token']) + $this->carddavBackend instanceof Backend\SyncSupport + && isset($this->addressBookInfo['{DAV:}sync-token']) ) { return $this->addressBookInfo['{DAV:}sync-token']; } if ( - $this->carddavBackend instanceof Backend\SyncSupport && - isset($this->addressBookInfo['{http://sabredav.org/ns}sync-token']) + $this->carddavBackend instanceof Backend\SyncSupport + && isset($this->addressBookInfo['{http://sabredav.org/ns}sync-token']) ) { return $this->addressBookInfo['{http://sabredav.org/ns}sync-token']; } diff --git a/lib/CardDAV/Backend/AbstractBackend.php b/lib/CardDAV/Backend/AbstractBackend.php index a900c62562..6a9aecf032 100644 --- a/lib/CardDAV/Backend/AbstractBackend.php +++ b/lib/CardDAV/Backend/AbstractBackend.php @@ -25,8 +25,6 @@ abstract class AbstractBackend implements BackendInterface * * If the backend supports this, it may allow for some speed-ups. * - * @param mixed $addressBookId - * * @return array */ public function getMultipleCards($addressBookId, array $uris) diff --git a/lib/CardDAV/Backend/BackendInterface.php b/lib/CardDAV/Backend/BackendInterface.php index 6ef34d173c..c4c4faf945 100644 --- a/lib/CardDAV/Backend/BackendInterface.php +++ b/lib/CardDAV/Backend/BackendInterface.php @@ -63,15 +63,11 @@ public function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatc * * @param string $principalUri * @param string $url just the 'basename' of the url - * - * @return mixed */ public function createAddressBook($principalUri, $url, array $properties); /** * Deletes an entire addressbook and all its contents. - * - * @param mixed $addressBookId */ public function deleteAddressBook($addressBookId); @@ -91,8 +87,6 @@ public function deleteAddressBook($addressBookId); * calculating them. If they are specified, you can also ommit carddata. * This may speed up certain requests, especially with large cards. * - * @param mixed $addressbookId - * * @return array */ public function getCards($addressbookId); @@ -105,7 +99,6 @@ public function getCards($addressbookId); * * If the card does not exist, you must return false. * - * @param mixed $addressBookId * @param string $cardUri * * @return array @@ -120,8 +113,6 @@ public function getCard($addressBookId, $cardUri); * * If the backend supports this, it may allow for some speed-ups. * - * @param mixed $addressBookId - * * @return array */ public function getMultipleCards($addressBookId, array $uris); @@ -146,7 +137,6 @@ public function getMultipleCards($addressBookId, array $uris); * * If you don't return an ETag, you can just return null. * - * @param mixed $addressBookId * @param string $cardUri * @param string $cardData * @@ -174,7 +164,6 @@ public function createCard($addressBookId, $cardUri, $cardData); * * If you don't return an ETag, you can just return null. * - * @param mixed $addressBookId * @param string $cardUri * @param string $cardData * @@ -185,7 +174,6 @@ public function updateCard($addressBookId, $cardUri, $cardData); /** * Deletes a card. * - * @param mixed $addressBookId * @param string $cardUri * * @return bool diff --git a/lib/CardDAV/Backend/PDO.php b/lib/CardDAV/Backend/PDO.php index 4ca9284a9e..13a7bd48e9 100644 --- a/lib/CardDAV/Backend/PDO.php +++ b/lib/CardDAV/Backend/PDO.php @@ -208,8 +208,6 @@ public function deleteAddressBook($addressBookId) * calculating them. If they are specified, you can also ommit carddata. * This may speed up certain requests, especially with large cards. * - * @param mixed $addressbookId - * * @return array */ public function getCards($addressbookId) @@ -235,7 +233,6 @@ public function getCards($addressbookId) * * If the card does not exist, you must return false. * - * @param mixed $addressBookId * @param string $cardUri * * @return array @@ -265,8 +262,6 @@ public function getCard($addressBookId, $cardUri) * * If the backend supports this, it may allow for some speed-ups. * - * @param mixed $addressBookId - * * @return array */ public function getMultipleCards($addressBookId, array $uris) @@ -308,7 +303,6 @@ public function getMultipleCards($addressBookId, array $uris) * * If you don't return an ETag, you can just return null. * - * @param mixed $addressBookId * @param string $cardUri * @param string $cardData * @@ -354,7 +348,6 @@ public function createCard($addressBookId, $cardUri, $cardData) * * If you don't return an ETag, you can just return null. * - * @param mixed $addressBookId * @param string $cardUri * @param string $cardData * @@ -382,7 +375,6 @@ public function updateCard($addressBookId, $cardUri, $cardData) /** * Deletes a card. * - * @param mixed $addressBookId * @param string $cardUri * * @return bool @@ -518,9 +510,8 @@ public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, /** * Adds a change record to the addressbookchanges table. * - * @param mixed $addressBookId * @param string $objectUri - * @param int $operation 1 = add, 2 = modify, 3 = delete + * @param int $operation 1 = add, 2 = modify, 3 = delete */ protected function addChange($addressBookId, $objectUri, $operation) { diff --git a/lib/CardDAV/Plugin.php b/lib/CardDAV/Plugin.php index c2d31d9dfe..afac8494f6 100644 --- a/lib/CardDAV/Plugin.php +++ b/lib/CardDAV/Plugin.php @@ -28,12 +28,12 @@ class Plugin extends DAV\ServerPlugin /** * Url to the addressbooks. */ - const ADDRESSBOOK_ROOT = 'addressbooks'; + public const ADDRESSBOOK_ROOT = 'addressbooks'; /** * xml namespace for CardDAV elements. */ - const NS_CARDDAV = 'urn:ietf:params:xml:ns:carddav'; + public const NS_CARDDAV = 'urn:ietf:params:xml:ns:carddav'; /** * Add urls to this property to have them automatically exposed as @@ -177,7 +177,6 @@ public function propFindEarly(DAV\PropFind $propFind, DAV\INode $node) * * @param string $reportName * @param \DOMNode $dom - * @param mixed $path * * @return bool */ @@ -579,7 +578,7 @@ protected function validateParamFilters(array $vProperties, array $filters, $tes $success = true; } - // If there's no text-match, we can just check for existence + // If there's no text-match, we can just check for existence } elseif (!$filter['text-match'] || !$isDefined) { $success = $isDefined; } else { @@ -786,7 +785,7 @@ protected function negotiateVCard($input, &$mimeType = null) case 'application/vcard+json': return 'jcard'; - // @codeCoverageIgnoreStart + // @codeCoverageIgnoreStart } // @codeCoverageIgnoreEnd } @@ -796,7 +795,6 @@ protected function negotiateVCard($input, &$mimeType = null) * * @param string|resource $data * @param string $target - * @param array $propertiesFilter * * @return string */ diff --git a/lib/CardDAV/Xml/Filter/AddressData.php b/lib/CardDAV/Xml/Filter/AddressData.php index b60fcebb63..41ecab4a1c 100644 --- a/lib/CardDAV/Xml/Filter/AddressData.php +++ b/lib/CardDAV/Xml/Filter/AddressData.php @@ -42,8 +42,6 @@ class AddressData implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { @@ -54,8 +52,8 @@ public static function xmlDeserialize(Reader $reader) $elems = (array) $reader->parseInnerTree(); $elems = array_filter($elems, function ($element) { - return '{urn:ietf:params:xml:ns:carddav}prop' === $element['name'] && - isset($element['attributes']['name']); + return '{urn:ietf:params:xml:ns:carddav}prop' === $element['name'] + && isset($element['attributes']['name']); }); $result['addressDataProperties'] = array_map(function ($element) { return $element['attributes']['name']; diff --git a/lib/CardDAV/Xml/Filter/ParamFilter.php b/lib/CardDAV/Xml/Filter/ParamFilter.php index 0a7ec06590..a44a6b82fb 100644 --- a/lib/CardDAV/Xml/Filter/ParamFilter.php +++ b/lib/CardDAV/Xml/Filter/ParamFilter.php @@ -42,8 +42,6 @@ abstract class ParamFilter implements Element * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { @@ -61,23 +59,23 @@ public static function xmlDeserialize(Reader $reader) if (is_array($elems)) { foreach ($elems as $elem) { switch ($elem['name']) { - case '{'.Plugin::NS_CARDDAV.'}is-not-defined': - $result['is-not-defined'] = true; - break; - case '{'.Plugin::NS_CARDDAV.'}text-match': - $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; + case '{'.Plugin::NS_CARDDAV.'}is-not-defined': + $result['is-not-defined'] = true; + break; + case '{'.Plugin::NS_CARDDAV.'}text-match': + $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; - if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { - throw new BadRequest('Unknown match-type: '.$matchType); - } - $result['text-match'] = [ - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', - 'value' => $elem['value'], - 'match-type' => $matchType, - ]; - break; - } + if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { + throw new BadRequest('Unknown match-type: '.$matchType); + } + $result['text-match'] = [ + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', + 'value' => $elem['value'], + 'match-type' => $matchType, + ]; + break; + } } } diff --git a/lib/CardDAV/Xml/Filter/PropFilter.php b/lib/CardDAV/Xml/Filter/PropFilter.php index 5dedac8007..4c90412d1b 100644 --- a/lib/CardDAV/Xml/Filter/PropFilter.php +++ b/lib/CardDAV/Xml/Filter/PropFilter.php @@ -42,8 +42,6 @@ class PropFilter implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { @@ -67,26 +65,26 @@ public static function xmlDeserialize(Reader $reader) if (is_array($elems)) { foreach ($elems as $elem) { switch ($elem['name']) { - case '{'.Plugin::NS_CARDDAV.'}param-filter': - $result['param-filters'][] = $elem['value']; - break; - case '{'.Plugin::NS_CARDDAV.'}is-not-defined': - $result['is-not-defined'] = true; - break; - case '{'.Plugin::NS_CARDDAV.'}text-match': - $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; + case '{'.Plugin::NS_CARDDAV.'}param-filter': + $result['param-filters'][] = $elem['value']; + break; + case '{'.Plugin::NS_CARDDAV.'}is-not-defined': + $result['is-not-defined'] = true; + break; + case '{'.Plugin::NS_CARDDAV.'}text-match': + $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; - if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { - throw new BadRequest('Unknown match-type: '.$matchType); - } - $result['text-matches'][] = [ - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', - 'value' => $elem['value'], - 'match-type' => $matchType, - ]; - break; - } + if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { + throw new BadRequest('Unknown match-type: '.$matchType); + } + $result['text-matches'][] = [ + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', + 'value' => $elem['value'], + 'match-type' => $matchType, + ]; + break; + } } } diff --git a/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php b/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php index 491f969088..1640e10a6f 100644 --- a/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php +++ b/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php @@ -43,7 +43,7 @@ class AddressBookMultiGetReport implements XmlDeserializable * * @var string */ - public $contentType = null; + public $contentType; /** * The version of vcard data that should be returned. Usually 3.0, @@ -51,7 +51,7 @@ class AddressBookMultiGetReport implements XmlDeserializable * * @var string */ - public $version = null; + public $version; /** * An array with requested vcard properties. @@ -77,8 +77,6 @@ class AddressBookMultiGetReport implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/CardDAV/Xml/Request/AddressBookQueryReport.php b/lib/CardDAV/Xml/Request/AddressBookQueryReport.php index e1096fe28e..bcaf82af7c 100644 --- a/lib/CardDAV/Xml/Request/AddressBookQueryReport.php +++ b/lib/CardDAV/Xml/Request/AddressBookQueryReport.php @@ -87,7 +87,7 @@ class AddressBookQueryReport implements XmlDeserializable * * @var string */ - public $contentType = null; + public $contentType; /** * The version of vcard data that should be returned. Usually 3.0, @@ -95,7 +95,7 @@ class AddressBookQueryReport implements XmlDeserializable * * @var string */ - public $version = null; + public $version; /** * The deserialize method is called during xml parsing. @@ -114,8 +114,6 @@ class AddressBookQueryReport implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { @@ -179,7 +177,7 @@ public static function xmlDeserialize(Reader $reader) * include the filter element, and we need to treat it as if no * filters are supplied */ - //throw new BadRequest('The {' . Plugin::NS_CARDDAV . '}filter element is required for this request'); + // throw new BadRequest('The {' . Plugin::NS_CARDDAV . '}filter element is required for this request'); $newProps['filters'] = []; } diff --git a/lib/DAV/Auth/Plugin.php b/lib/DAV/Auth/Plugin.php index eb4f27ca67..86855cca59 100644 --- a/lib/DAV/Auth/Plugin.php +++ b/lib/DAV/Auth/Plugin.php @@ -55,8 +55,6 @@ class Plugin extends ServerPlugin /** * Creates the authentication plugin. - * - * @param Backend\BackendInterface $authBackend */ public function __construct(Backend\BackendInterface $authBackend = null) { @@ -187,6 +185,7 @@ public function check(RequestInterface $request, ResponseInterface $response) if ($result[0]) { $this->currentPrincipal = $result[1]; + // Exit early return [true, $result[1]]; } diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php index 89495e5dbd..2179cc1da0 100644 --- a/lib/DAV/Browser/Plugin.php +++ b/lib/DAV/Browser/Plugin.php @@ -159,8 +159,8 @@ public function httpPOST(RequestInterface $request, ResponseInterface $response) return; } list($contentType) = explode(';', $contentType); - if ('application/x-www-form-urlencoded' !== $contentType && - 'multipart/form-data' !== $contentType) { + if ('application/x-www-form-urlencoded' !== $contentType + && 'multipart/form-data' !== $contentType) { return; } $postVars = $request->getPostData(); @@ -208,7 +208,7 @@ public function httpPOST(RequestInterface $request, ResponseInterface $response) } break; - // @codeCoverageIgnoreStart + // @codeCoverageIgnoreStart case 'put': if ($_FILES) { $file = current($_FILES); @@ -228,7 +228,7 @@ public function httpPOST(RequestInterface $request, ResponseInterface $response) $this->server->createFile($uri.'/'.$newName, fopen($file['tmp_name'], 'r')); } break; - // @codeCoverageIgnoreEnd + // @codeCoverageIgnoreEnd } } $response->setHeader('Location', $request->getUrl()); @@ -488,7 +488,6 @@ public function generateFooter() * This specifically generates the interfaces for creating new files, and * creating new directories. * - * @param mixed $output * @param string $path */ public function htmlActionsPanel(DAV\INode $node, &$output, $path) @@ -538,9 +537,9 @@ protected function getAssetUrl($assetName) * * @param string $assetName * - * @throws DAV\Exception\NotFound - * * @return string + * + * @throws DAV\Exception\NotFound */ protected function getLocalAssetPath($assetName) { @@ -711,7 +710,6 @@ private function mapResourceType(array $resourceTypes, $node) * Draws a table row for a property. * * @param string $name - * @param mixed $value * * @return string */ @@ -729,7 +727,6 @@ private function drawPropertyRow($name, $value) * Draws a table row for a property. * * @param HtmlOutputHelper $html - * @param mixed $value * * @return string */ diff --git a/lib/DAV/Browser/PropFindAll.php b/lib/DAV/Browser/PropFindAll.php index 34702bdd8a..b15a9a9266 100644 --- a/lib/DAV/Browser/PropFindAll.php +++ b/lib/DAV/Browser/PropFindAll.php @@ -45,7 +45,6 @@ public function __construct($path) * It's also possible to not pass a callback, but immediately pass a value * * @param string $propertyName - * @param mixed $valueOrCallBack */ public function handle($propertyName, $valueOrCallBack) { @@ -66,7 +65,6 @@ public function handle($propertyName, $valueOrCallBack) * properties, and 404 for null properties. * * @param string $propertyName - * @param mixed $value * @param int $status */ public function set($propertyName, $value, $status = null) @@ -81,8 +79,6 @@ public function set($propertyName, $value, $status = null) * Returns the current value for a property. * * @param string $propertyName - * - * @return mixed */ public function get($propertyName) { diff --git a/lib/DAV/Client.php b/lib/DAV/Client.php index a9de71cdbb..21be629dab 100644 --- a/lib/DAV/Client.php +++ b/lib/DAV/Client.php @@ -25,8 +25,6 @@ class Client extends HTTP\Client * The xml service. * * Uset this service to configure the property and namespace maps. - * - * @var mixed */ public $xml; @@ -54,37 +52,37 @@ class Client extends HTTP\Client /** * Basic authentication. */ - const AUTH_BASIC = 1; + public const AUTH_BASIC = 1; /** * Digest authentication. */ - const AUTH_DIGEST = 2; + public const AUTH_DIGEST = 2; /** * NTLM authentication. */ - const AUTH_NTLM = 4; + public const AUTH_NTLM = 4; /** * Identity encoding, which basically does not nothing. */ - const ENCODING_IDENTITY = 1; + public const ENCODING_IDENTITY = 1; /** * Deflate encoding. */ - const ENCODING_DEFLATE = 2; + public const ENCODING_DEFLATE = 2; /** * Gzip encoding. */ - const ENCODING_GZIP = 4; + public const ENCODING_GZIP = 4; /** * Sends all encoding headers. */ - const ENCODING_ALL = 7; + public const ENCODING_ALL = 7; /** * Content-encoding. @@ -356,9 +354,9 @@ public function options() * @param string $url * @param string|resource|null $body * - * @throws clientException, in case a curl error occurred - * * @return array + * + * @throws clientException, in case a curl error occurred */ public function request($method, $url = '', $body = null, array $headers = []) { diff --git a/lib/DAV/Collection.php b/lib/DAV/Collection.php index 2728bb27ed..6d8557db41 100644 --- a/lib/DAV/Collection.php +++ b/lib/DAV/Collection.php @@ -28,9 +28,9 @@ abstract class Collection extends Node implements ICollection * * @param string $name * - * @throws Exception\NotFound - * * @return INode + * + * @throws Exception\NotFound */ public function getChild($name) { diff --git a/lib/DAV/CorePlugin.php b/lib/DAV/CorePlugin.php index dbd8976b17..de0f90a781 100644 --- a/lib/DAV/CorePlugin.php +++ b/lib/DAV/CorePlugin.php @@ -197,6 +197,7 @@ public function httpGet(RequestInterface $request, ResponseInterface $response) $response->setStatus(200); $response->setBody($body); } + // Sending back false will interrupt the event chain and tell the server // we've handled this method. return false; diff --git a/lib/DAV/Exception/Locked.php b/lib/DAV/Exception/Locked.php index 28263cf13e..65bcb4f8b0 100644 --- a/lib/DAV/Exception/Locked.php +++ b/lib/DAV/Exception/Locked.php @@ -29,8 +29,6 @@ class Locked extends DAV\Exception * * A LockInfo object should be passed if the user should be informed * which lock actually has the file locked. - * - * @param DAV\Locks\LockInfo $lock */ public function __construct(DAV\Locks\LockInfo $lock = null) { diff --git a/lib/DAV/Exception/PreconditionFailed.php b/lib/DAV/Exception/PreconditionFailed.php index 7240f36964..5a57c347a2 100644 --- a/lib/DAV/Exception/PreconditionFailed.php +++ b/lib/DAV/Exception/PreconditionFailed.php @@ -27,7 +27,7 @@ class PreconditionFailed extends DAV\Exception * * @var string */ - public $header = null; + public $header; /** * Create the exception. diff --git a/lib/DAV/FS/Directory.php b/lib/DAV/FS/Directory.php index 047692294b..690929b016 100644 --- a/lib/DAV/FS/Directory.php +++ b/lib/DAV/FS/Directory.php @@ -67,9 +67,9 @@ public function createDirectory($name) * * @param string $name * - * @throws DAV\Exception\NotFound - * * @return DAV\INode + * + * @throws DAV\Exception\NotFound */ public function getChild($name) { diff --git a/lib/DAV/FS/File.php b/lib/DAV/FS/File.php index b78a801389..0048b8c705 100644 --- a/lib/DAV/FS/File.php +++ b/lib/DAV/FS/File.php @@ -61,8 +61,6 @@ public function getSize() * The ETag is an arbitrary string, but MUST be surrounded by double-quotes. * * Return null if the ETag can not effectively be determined - * - * @return mixed */ public function getETag() { @@ -77,8 +75,6 @@ public function getETag() * Returns the mime-type for a file. * * If null is returned, we'll assume application/octet-stream - * - * @return mixed */ public function getContentType() { diff --git a/lib/DAV/FSExt/Directory.php b/lib/DAV/FSExt/Directory.php index d6aea00949..37fd0b5761 100644 --- a/lib/DAV/FSExt/Directory.php +++ b/lib/DAV/FSExt/Directory.php @@ -82,9 +82,9 @@ public function createDirectory($name) * * @param string $name * - * @throws DAV\Exception\NotFound - * * @return DAV\INode + * + * @throws DAV\Exception\NotFound */ public function getChild($name) { diff --git a/lib/DAV/File.php b/lib/DAV/File.php index daf83aa4d8..7a16ef04d0 100644 --- a/lib/DAV/File.php +++ b/lib/DAV/File.php @@ -46,8 +46,6 @@ public function put($data) * Returns the data. * * This method may either return a string or a readable stream resource - * - * @return mixed */ public function get() { diff --git a/lib/DAV/IFile.php b/lib/DAV/IFile.php index 974aee00dd..b9cf23c5f2 100644 --- a/lib/DAV/IFile.php +++ b/lib/DAV/IFile.php @@ -44,8 +44,6 @@ public function put($data); * Returns the data. * * This method may either return a string or a readable stream resource - * - * @return mixed */ public function get(); diff --git a/lib/DAV/Locks/Backend/File.php b/lib/DAV/Locks/Backend/File.php index b381894999..5b9de471ed 100644 --- a/lib/DAV/Locks/Backend/File.php +++ b/lib/DAV/Locks/Backend/File.php @@ -59,12 +59,12 @@ public function getLocks($uri, $returnChildLocks) $locks = $this->getData(); foreach ($locks as $lock) { - if ($lock->uri === $uri || - //deep locks on parents - (0 != $lock->depth && 0 === strpos($uri, $lock->uri.'/')) || + if ($lock->uri === $uri + // deep locks on parents + || (0 != $lock->depth && 0 === strpos($uri, $lock->uri.'/')) // locks on children - ($returnChildLocks && (0 === strpos($lock->uri, $uri.'/')))) { + || ($returnChildLocks && (0 === strpos($lock->uri, $uri.'/')))) { $newLocks[] = $lock; } } @@ -97,8 +97,8 @@ public function lock($uri, LockInfo $lockInfo) foreach ($locks as $k => $lock) { if ( - ($lock->token == $lockInfo->token) || - (time() > $lock->timeout + $lock->created) + ($lock->token == $lockInfo->token) + || (time() > $lock->timeout + $lock->created) ) { unset($locks[$k]); } diff --git a/lib/DAV/Locks/LockInfo.php b/lib/DAV/Locks/LockInfo.php index df82275665..2e9a4431b3 100644 --- a/lib/DAV/Locks/LockInfo.php +++ b/lib/DAV/Locks/LockInfo.php @@ -19,17 +19,17 @@ class LockInfo /** * A shared lock. */ - const SHARED = 1; + public const SHARED = 1; /** * An exclusive lock. */ - const EXCLUSIVE = 2; + public const EXCLUSIVE = 2; /** * A never expiring timeout. */ - const TIMEOUT_INFINITE = -1; + public const TIMEOUT_INFINITE = -1; /** * The owner of the lock. @@ -75,8 +75,6 @@ class LockInfo * The uri this lock locks. * * TODO: This value is not always set - * - * @var mixed */ public $uri; } diff --git a/lib/DAV/Locks/Plugin.php b/lib/DAV/Locks/Plugin.php index 2443f204c3..9a43a38a9e 100644 --- a/lib/DAV/Locks/Plugin.php +++ b/lib/DAV/Locks/Plugin.php @@ -353,7 +353,7 @@ public function getTimeoutHeader() if ($header) { if (0 === stripos($header, 'second-')) { - $header = (int) (substr($header, 7)); + $header = (int) substr($header, 7); } elseif (0 === stripos($header, 'infinite')) { $header = LockInfo::TIMEOUT_INFINITE; } else { @@ -387,8 +387,6 @@ protected function generateLockResponse(LockInfo $lockInfo) * In addition, it will also ensure that it checks any missing lokens that * must be present in the request, and reject requests without the proper * tokens. - * - * @param mixed $conditions */ public function validateTokens(RequestInterface $request, &$conditions) { @@ -432,7 +430,7 @@ public function validateTokens(RequestInterface $request, &$conditions) )); break; case 'LOCK': - //Temporary measure.. figure out later why this is needed + // Temporary measure.. figure out later why this is needed // Here we basically ignore all incoming tokens... foreach ($conditions as $ii => $condition) { foreach ($condition['tokens'] as $jj => $token) { diff --git a/lib/DAV/PartialUpdate/Plugin.php b/lib/DAV/PartialUpdate/Plugin.php index d6f4d32bd1..d7d6a6a60c 100644 --- a/lib/DAV/PartialUpdate/Plugin.php +++ b/lib/DAV/PartialUpdate/Plugin.php @@ -24,9 +24,9 @@ */ class Plugin extends DAV\ServerPlugin { - const RANGE_APPEND = 1; - const RANGE_START = 2; - const RANGE_END = 3; + public const RANGE_APPEND = 1; + public const RANGE_START = 2; + public const RANGE_END = 3; /** * Reference to server. diff --git a/lib/DAV/PropFind.php b/lib/DAV/PropFind.php index e9ffb07cbc..bbab0decf4 100644 --- a/lib/DAV/PropFind.php +++ b/lib/DAV/PropFind.php @@ -15,7 +15,7 @@ class PropFind /** * A normal propfind. */ - const NORMAL = 0; + public const NORMAL = 0; /** * An allprops request. @@ -26,13 +26,13 @@ class PropFind * * So 'all properties' now means a hardcoded list. */ - const ALLPROPS = 1; + public const ALLPROPS = 1; /** * A propname request. This just returns a list of properties that are * defined on a node, without their values. */ - const PROPNAME = 2; + public const PROPNAME = 2; /** * Creates the PROPFIND object. @@ -86,7 +86,6 @@ public function __construct($path, array $properties, $depth = 0, $requestType = * It's also possible to not pass a callback, but immediately pass a value * * @param string $propertyName - * @param mixed $valueOrCallBack */ public function handle($propertyName, $valueOrCallBack) { @@ -110,7 +109,6 @@ public function handle($propertyName, $valueOrCallBack) * properties, and 404 for null properties. * * @param string $propertyName - * @param mixed $value * @param int $status */ public function set($propertyName, $value, $status = null) @@ -139,8 +137,6 @@ public function set($propertyName, $value, $status = null) * Returns the current value for a property. * * @param string $propertyName - * - * @return mixed */ public function get($propertyName) { diff --git a/lib/DAV/PropPatch.php b/lib/DAV/PropPatch.php index 092909dea8..a2d7c8c929 100644 --- a/lib/DAV/PropPatch.php +++ b/lib/DAV/PropPatch.php @@ -4,8 +4,6 @@ namespace Sabre\DAV; -use UnexpectedValueException; - /** * This class represents a set of properties that are going to be updated. * @@ -267,7 +265,7 @@ private function doCallBackSingleProp($propertyName, callable $callback) } } if (!is_int($result)) { - throw new UnexpectedValueException('A callback sent to handle() did not return an int or a bool'); + throw new \UnexpectedValueException('A callback sent to handle() did not return an int or a bool'); } $this->result[$propertyName] = $result; if ($result >= 400) { @@ -311,7 +309,7 @@ private function doCallBackMultiProp(array $propertyList, callable $callback) $this->result[$propertyName] = 403; } } else { - throw new UnexpectedValueException('A callback sent to handle() did not return an array or a bool'); + throw new \UnexpectedValueException('A callback sent to handle() did not return an array or a bool'); } } diff --git a/lib/DAV/PropertyStorage/Backend/PDO.php b/lib/DAV/PropertyStorage/Backend/PDO.php index 8960331926..15546ddb63 100644 --- a/lib/DAV/PropertyStorage/Backend/PDO.php +++ b/lib/DAV/PropertyStorage/Backend/PDO.php @@ -25,17 +25,17 @@ class PDO implements BackendInterface /** * Value is stored as string. */ - const VT_STRING = 1; + public const VT_STRING = 1; /** * Value is stored as XML fragment. */ - const VT_XML = 2; + public const VT_XML = 2; /** * Value is stored as a property object. */ - const VT_OBJECT = 3; + public const VT_OBJECT = 3; /** * PDO. diff --git a/lib/DAV/Server.php b/lib/DAV/Server.php index 1f8300d4a5..2f9e5af3c5 100644 --- a/lib/DAV/Server.php +++ b/lib/DAV/Server.php @@ -31,12 +31,12 @@ class Server implements LoggerAwareInterface, EmitterInterface /** * Infinity is used for some request supporting the HTTP Depth header and indicates that the operation should traverse the entire tree. */ - const DEPTH_INFINITY = -1; + public const DEPTH_INFINITY = -1; /** * XML namespace for all SabreDAV related elements. */ - const NS_SABREDAV = 'http://sabredav.org/ns'; + public const NS_SABREDAV = 'http://sabredav.org/ns'; /** * The tree object. @@ -50,7 +50,7 @@ class Server implements LoggerAwareInterface, EmitterInterface * * @var string */ - protected $baseUri = null; + protected $baseUri; /** * httpResponse. @@ -552,9 +552,9 @@ public function getRequestUri() * * @param string $uri * - * @throws Exception\Forbidden A permission denied exception is thrown whenever there was an attempt to supply a uri outside of the base uri - * * @return string + * + * @throws Exception\Forbidden A permission denied exception is thrown whenever there was an attempt to supply a uri outside of the base uri */ public function calculateUri($uri) { @@ -583,8 +583,6 @@ public function calculateUri($uri) * This method returns the contents of the HTTP depth request header. If the depth header was 'infinity' it will return the Sabre\DAV\Server::DEPTH_INFINITY object * It is possible to supply a default depth value, which is used when the depth header has invalid content, or is completely non-existent * - * @param mixed $default - * * @return int */ public function getHTTPDepth($default = self::DEPTH_INFINITY) @@ -706,6 +704,8 @@ public function getHTTPPrefer() * * destination - Destination path * * destinationExists - Whether or not the destination is an existing url (and should therefore be overwritten) * + * @return array + * * @throws Exception\BadRequest upon missing or broken request headers * @throws Exception\UnsupportedMediaType when trying to copy into a * non-collection @@ -715,8 +715,6 @@ public function getHTTPPrefer() * identical * @throws Exception\Conflict when trying to copy a node into its own * subtree - * - * @return array */ public function getCopyAndMoveInfo(RequestInterface $request) { @@ -878,8 +876,6 @@ public function getHTTPHeaders($path) /** * Small helper to support PROPFIND with DEPTH_INFINITY. * - * @param array $yieldFirst - * * @return \Traversable */ private function generatePathNodes(PropFind $propFind, array $yieldFirst = null) @@ -1649,9 +1645,6 @@ public function generateMultiStatus($fileProperties, $strip404s = false) return $w->outputMemory(); } - /** - * @param $fileProperties - */ private function writeMultiStatus(Writer $w, $fileProperties, bool $strip404s) { $w->contextUri = $this->baseUri; diff --git a/lib/DAV/Sharing/Plugin.php b/lib/DAV/Sharing/Plugin.php index e7adbeee66..dbf7ebc002 100644 --- a/lib/DAV/Sharing/Plugin.php +++ b/lib/DAV/Sharing/Plugin.php @@ -28,16 +28,16 @@ */ class Plugin extends ServerPlugin { - const ACCESS_NOTSHARED = 0; - const ACCESS_SHAREDOWNER = 1; - const ACCESS_READ = 2; - const ACCESS_READWRITE = 3; - const ACCESS_NOACCESS = 4; - - const INVITE_NORESPONSE = 1; - const INVITE_ACCEPTED = 2; - const INVITE_DECLINED = 3; - const INVITE_INVALID = 4; + public const ACCESS_NOTSHARED = 0; + public const ACCESS_SHAREDOWNER = 1; + public const ACCESS_READ = 2; + public const ACCESS_READWRITE = 3; + public const ACCESS_NOACCESS = 4; + + public const INVITE_NORESPONSE = 1; + public const INVITE_ACCEPTED = 2; + public const INVITE_DECLINED = 3; + public const INVITE_INVALID = 4; /** * Reference to SabreDAV server object. diff --git a/lib/DAV/SimpleCollection.php b/lib/DAV/SimpleCollection.php index 3cd14d9ba8..81f5ae8776 100644 --- a/lib/DAV/SimpleCollection.php +++ b/lib/DAV/SimpleCollection.php @@ -4,8 +4,6 @@ namespace Sabre\DAV; -use InvalidArgumentException; - /** * SimpleCollection. * @@ -50,7 +48,7 @@ public function __construct($name, array $children = []) } elseif (is_array($child)) { $child = new self($key, $child); } elseif (!$child instanceof INode) { - throw new InvalidArgumentException('Children must be specified as strings, arrays or instances of Sabre\DAV\INode'); + throw new \InvalidArgumentException('Children must be specified as strings, arrays or instances of Sabre\DAV\INode'); } $this->addChild($child); } @@ -85,9 +83,9 @@ public function getName() * * @param string $name * - * @throws Exception\NotFound - * * @return INode + * + * @throws Exception\NotFound */ public function getChild($name) { diff --git a/lib/DAV/SimpleFile.php b/lib/DAV/SimpleFile.php index ca808b6720..74de8be885 100644 --- a/lib/DAV/SimpleFile.php +++ b/lib/DAV/SimpleFile.php @@ -71,8 +71,6 @@ public function getName() * Returns the data. * * This method may either return a string or a readable stream resource - * - * @return mixed */ public function get() { diff --git a/lib/DAV/Sync/Plugin.php b/lib/DAV/Sync/Plugin.php index 8609f759e5..3592eb36d8 100644 --- a/lib/DAV/Sync/Plugin.php +++ b/lib/DAV/Sync/Plugin.php @@ -29,7 +29,7 @@ class Plugin extends DAV\ServerPlugin */ protected $server; - const SYNCTOKEN_PREFIX = 'http://sabre.io/ns/sync/'; + public const SYNCTOKEN_PREFIX = 'http://sabre.io/ns/sync/'; /** * Returns a plugin name. @@ -218,8 +218,8 @@ public function validateTokens(RequestInterface $request, &$conditions) $node = $this->server->tree->getNodeForPath($condition['uri']); if ( - $node instanceof ISyncCollection && - $node->getSyncToken() == substr($token['token'], strlen(self::SYNCTOKEN_PREFIX)) + $node instanceof ISyncCollection + && $node->getSyncToken() == substr($token['token'], strlen(self::SYNCTOKEN_PREFIX)) ) { $conditions[$kk]['tokens'][$ii]['validToken'] = true; } diff --git a/lib/DAV/TemporaryFileFilterPlugin.php b/lib/DAV/TemporaryFileFilterPlugin.php index 9f8ec5b54e..d61ca5eca0 100644 --- a/lib/DAV/TemporaryFileFilterPlugin.php +++ b/lib/DAV/TemporaryFileFilterPlugin.php @@ -216,7 +216,7 @@ public function httpPut(RequestInterface $request, ResponseInterface $hR, $tempL $newFile = !file_exists($tempLocation); - if (!$newFile && ($this->server->httpRequest->getHeader('If-None-Match'))) { + if (!$newFile && $this->server->httpRequest->getHeader('If-None-Match')) { throw new Exception\PreconditionFailed('The resource already exists, and an If-None-Match header was supplied'); } diff --git a/lib/DAV/UUIDUtil.php b/lib/DAV/UUIDUtil.php index 8c36e1b0b8..62b5046210 100644 --- a/lib/DAV/UUIDUtil.php +++ b/lib/DAV/UUIDUtil.php @@ -30,22 +30,22 @@ public static function getUUID() { return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', // 32 bits for "time_low" - mt_rand(0, 0xffff), mt_rand(0, 0xffff), + mt_rand(0, 0xFFFF), mt_rand(0, 0xFFFF), // 16 bits for "time_mid" - mt_rand(0, 0xffff), + mt_rand(0, 0xFFFF), // 16 bits for "time_hi_and_version", // four most significant bits holds version number 4 - mt_rand(0, 0x0fff) | 0x4000, + mt_rand(0, 0x0FFF) | 0x4000, // 16 bits, 8 bits for "clk_seq_hi_res", // 8 bits for "clk_seq_low", // two most significant bits holds zero and one for variant DCE1.1 - mt_rand(0, 0x3fff) | 0x8000, + mt_rand(0, 0x3FFF) | 0x8000, // 48 bits for "node" - mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff) + mt_rand(0, 0xFFFF), mt_rand(0, 0xFFFF), mt_rand(0, 0xFFFF) ); } diff --git a/lib/DAV/Xml/Element/Prop.php b/lib/DAV/Xml/Element/Prop.php index 9c214792f1..f922ee770e 100644 --- a/lib/DAV/Xml/Element/Prop.php +++ b/lib/DAV/Xml/Element/Prop.php @@ -38,8 +38,6 @@ class Prop implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Element/Response.php b/lib/DAV/Xml/Element/Response.php index 86f2d33882..5e19c0609a 100644 --- a/lib/DAV/Xml/Element/Response.php +++ b/lib/DAV/Xml/Element/Response.php @@ -177,8 +177,6 @@ public function xmlSerialize(Writer $writer): void * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Element/Sharee.php b/lib/DAV/Xml/Element/Sharee.php index 79d6aa90db..cbbf74ace5 100644 --- a/lib/DAV/Xml/Element/Sharee.php +++ b/lib/DAV/Xml/Element/Sharee.php @@ -152,8 +152,6 @@ public function xmlSerialize(Writer $writer): void * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Property/Complex.php b/lib/DAV/Xml/Property/Complex.php index 9db5ad6790..8ecb5fe8bf 100644 --- a/lib/DAV/Xml/Property/Complex.php +++ b/lib/DAV/Xml/Property/Complex.php @@ -36,8 +36,6 @@ class Complex extends XmlFragment * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Property/GetLastModified.php b/lib/DAV/Xml/Property/GetLastModified.php index 0a1b7f800e..1142ab7131 100644 --- a/lib/DAV/Xml/Property/GetLastModified.php +++ b/lib/DAV/Xml/Property/GetLastModified.php @@ -4,8 +4,6 @@ namespace Sabre\DAV\Xml\Property; -use DateTime; -use DateTimeZone; use Sabre\HTTP; use Sabre\Xml\Element; use Sabre\Xml\Reader; @@ -26,31 +24,31 @@ class GetLastModified implements Element /** * time. * - * @var DateTime + * @var \DateTime */ public $time; /** * Constructor. * - * @param int|DateTime $time + * @param int|\DateTime $time */ public function __construct($time) { - if ($time instanceof DateTime) { + if ($time instanceof \DateTime) { $this->time = clone $time; } else { - $this->time = new DateTime('@'.$time); + $this->time = new \DateTime('@'.$time); } // Setting timezone to UTC - $this->time->setTimezone(new DateTimeZone('UTC')); + $this->time->setTimezone(new \DateTimeZone('UTC')); } /** * getTime. * - * @return DateTime + * @return \DateTime */ public function getTime() { @@ -93,11 +91,9 @@ public function xmlSerialize(Writer $writer): void * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { - return new self(new DateTime($reader->parseInnerTree())); + return new self(new \DateTime($reader->parseInnerTree())); } } diff --git a/lib/DAV/Xml/Property/Href.php b/lib/DAV/Xml/Property/Href.php index f736be6c21..06377ce52c 100644 --- a/lib/DAV/Xml/Property/Href.php +++ b/lib/DAV/Xml/Property/Href.php @@ -146,8 +146,6 @@ public function toHtml(HtmlOutputHelper $html) * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Property/LockDiscovery.php b/lib/DAV/Xml/Property/LockDiscovery.php index 7fdc8ef591..44fde50788 100644 --- a/lib/DAV/Xml/Property/LockDiscovery.php +++ b/lib/DAV/Xml/Property/LockDiscovery.php @@ -86,8 +86,8 @@ public function xmlSerialize(Writer $writer): void $writer->writeElement('{DAV:}href', $writer->contextUri.$lock->uri); $writer->endElement(); // {DAV:}lockroot } - $writer->writeElement('{DAV:}depth', (DAV\Server::DEPTH_INFINITY == $lock->depth ? 'infinity' : $lock->depth)); - $writer->writeElement('{DAV:}timeout', (LockInfo::TIMEOUT_INFINITE === $lock->timeout ? 'Infinite' : 'Second-'.$lock->timeout)); + $writer->writeElement('{DAV:}depth', DAV\Server::DEPTH_INFINITY == $lock->depth ? 'infinity' : $lock->depth); + $writer->writeElement('{DAV:}timeout', LockInfo::TIMEOUT_INFINITE === $lock->timeout ? 'Infinite' : 'Second-'.$lock->timeout); // optional according to https://tools.ietf.org/html/rfc4918#section-6.5 if (null !== $lock->token && '' !== $lock->token) { diff --git a/lib/DAV/Xml/Property/ResourceType.php b/lib/DAV/Xml/Property/ResourceType.php index 75ddcba3fe..85f98aef3d 100644 --- a/lib/DAV/Xml/Property/ResourceType.php +++ b/lib/DAV/Xml/Property/ResourceType.php @@ -89,8 +89,6 @@ public function add($type) * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Property/ShareAccess.php b/lib/DAV/Xml/Property/ShareAccess.php index 878e3eeca3..d59bb938ab 100644 --- a/lib/DAV/Xml/Property/ShareAccess.php +++ b/lib/DAV/Xml/Property/ShareAccess.php @@ -110,8 +110,6 @@ public function xmlSerialize(Writer $writer): void * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Property/SupportedReportSet.php b/lib/DAV/Xml/Property/SupportedReportSet.php index 35e1614423..4f5d02ec60 100644 --- a/lib/DAV/Xml/Property/SupportedReportSet.php +++ b/lib/DAV/Xml/Property/SupportedReportSet.php @@ -54,8 +54,6 @@ public function __construct($reports = null) * * The report must be a string in clark-notation. * Multiple reports can be specified as an array. - * - * @param mixed $report */ public function addReport($report) { diff --git a/lib/DAV/Xml/Request/Lock.php b/lib/DAV/Xml/Request/Lock.php index 57d12ef93e..fcc973c72f 100644 --- a/lib/DAV/Xml/Request/Lock.php +++ b/lib/DAV/Xml/Request/Lock.php @@ -55,8 +55,6 @@ class Lock implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Request/MkCol.php b/lib/DAV/Xml/Request/MkCol.php index e0d7e90a26..c4d84941c4 100644 --- a/lib/DAV/Xml/Request/MkCol.php +++ b/lib/DAV/Xml/Request/MkCol.php @@ -55,8 +55,6 @@ public function getProperties() * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Request/PropFind.php b/lib/DAV/Xml/Request/PropFind.php index 505e7c79ce..7dbf05b869 100644 --- a/lib/DAV/Xml/Request/PropFind.php +++ b/lib/DAV/Xml/Request/PropFind.php @@ -52,8 +52,6 @@ class PropFind implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Request/PropPatch.php b/lib/DAV/Xml/Request/PropPatch.php index c1ed0d3afe..39dfc9e3e4 100644 --- a/lib/DAV/Xml/Request/PropPatch.php +++ b/lib/DAV/Xml/Request/PropPatch.php @@ -78,8 +78,6 @@ public function xmlSerialize(Writer $writer): void * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Request/ShareResource.php b/lib/DAV/Xml/Request/ShareResource.php index 79d7dc8264..56d943c6d1 100644 --- a/lib/DAV/Xml/Request/ShareResource.php +++ b/lib/DAV/Xml/Request/ShareResource.php @@ -55,8 +55,6 @@ public function __construct(array $sharees) * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Request/SyncCollectionReport.php b/lib/DAV/Xml/Request/SyncCollectionReport.php index 8dd95765b6..c3f1e244eb 100644 --- a/lib/DAV/Xml/Request/SyncCollectionReport.php +++ b/lib/DAV/Xml/Request/SyncCollectionReport.php @@ -67,8 +67,6 @@ class SyncCollectionReport implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAV/Xml/Response/MultiStatus.php b/lib/DAV/Xml/Response/MultiStatus.php index 8f9d45c80f..981b33f2e6 100644 --- a/lib/DAV/Xml/Response/MultiStatus.php +++ b/lib/DAV/Xml/Response/MultiStatus.php @@ -108,8 +108,6 @@ public function xmlSerialize(Writer $writer): void * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAVACL/AbstractPrincipalCollection.php b/lib/DAVACL/AbstractPrincipalCollection.php index d26f7d27b4..3d73bd49b4 100644 --- a/lib/DAVACL/AbstractPrincipalCollection.php +++ b/lib/DAVACL/AbstractPrincipalCollection.php @@ -105,9 +105,9 @@ public function getChildren() * * @param string $name * - * @throws DAV\Exception\NotFound - * * @return DAV\INode + * + * @throws DAV\Exception\NotFound */ public function getChild($name) { diff --git a/lib/DAVACL/FS/Collection.php b/lib/DAVACL/FS/Collection.php index 85b04e2bdf..3ecdad7983 100644 --- a/lib/DAVACL/FS/Collection.php +++ b/lib/DAVACL/FS/Collection.php @@ -57,9 +57,9 @@ public function __construct($path, array $acl, $owner = null) * * @param string $name * - * @throws NotFound - * * @return \Sabre\DAV\INode + * + * @throws NotFound */ public function getChild($name) { diff --git a/lib/DAVACL/Plugin.php b/lib/DAVACL/Plugin.php index 46d680e154..2c535862ab 100644 --- a/lib/DAVACL/Plugin.php +++ b/lib/DAVACL/Plugin.php @@ -37,21 +37,21 @@ class Plugin extends DAV\ServerPlugin * * This only checks the base node */ - const R_PARENT = 1; + public const R_PARENT = 1; /** * Recursion constants. * * This checks every node in the tree */ - const R_RECURSIVE = 2; + public const R_RECURSIVE = 2; /** * Recursion constants. * * This checks every parentnode in the tree, but not leaf-nodes. */ - const R_RECURSIVEPARENTS = 3; + public const R_RECURSIVEPARENTS = 3; /** * Reference to server object. @@ -185,10 +185,10 @@ public function getSupportedReportSet($uri) * @param int $recursion * @param bool $throwExceptions if set to false, this method won't throw exceptions * + * @return bool + * * @throws NeedPrivileges * @throws NotAuthenticated - * - * @return bool */ public function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) { @@ -618,7 +618,7 @@ public function getCurrentUserPrivilegeSet($node) } break; - // 'all' matches for every user + // 'all' matches for every user case '{DAV:}all': $collected[] = $ace; break; @@ -917,6 +917,7 @@ public function beforeUnbind($uri) * Triggered before a node is unlocked. * * @param string $uri + * * @TODO: not yet implemented */ public function beforeUnlock($uri, DAV\Locks\LockInfo $lock) @@ -1066,8 +1067,6 @@ public function propPatch($path, DAV\PropPatch $propPatch) * This method handles HTTP REPORT requests. * * @param string $reportName - * @param mixed $report - * @param mixed $path */ public function report($reportName, $report, $path) { @@ -1141,9 +1140,9 @@ public function httpAcl(RequestInterface $request, ResponseInterface $response) $found = false; foreach ($newAcl as $newAce) { if ( - $newAce['privilege'] === $oldAce['privilege'] && - $newAce['principal'] === $oldAce['principal'] && - $newAce['protected'] + $newAce['privilege'] === $oldAce['privilege'] + && $newAce['principal'] === $oldAce['principal'] + && $newAce['protected'] ) { $found = true; } diff --git a/lib/DAVACL/PrincipalBackend/PDO.php b/lib/DAVACL/PrincipalBackend/PDO.php index 17bc245c5f..28ab04c818 100644 --- a/lib/DAVACL/PrincipalBackend/PDO.php +++ b/lib/DAVACL/PrincipalBackend/PDO.php @@ -237,7 +237,7 @@ public function searchPrincipals($prefixPath, array $searchProperties, $test = ' { if (0 == count($searchProperties)) { return []; - } //No criteria + } // No criteria $query = 'SELECT uri FROM '.$this->tableName.' WHERE '; $values = []; @@ -320,7 +320,7 @@ public function findByUri($uri, $principalPrefix) } $uri = $row['uri']; - break; //Stop on first match + break; // Stop on first match } } else { $pathParts = Uri\split($uriParts['path']); // We can do this since $uriParts['path'] is not null diff --git a/lib/DAVACL/Xml/Property/Acl.php b/lib/DAVACL/Xml/Property/Acl.php index 086d123037..92240cb8f2 100644 --- a/lib/DAVACL/Xml/Property/Acl.php +++ b/lib/DAVACL/Xml/Property/Acl.php @@ -155,8 +155,6 @@ public function toHtml(HtmlOutputHelper $html) * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php b/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php index 4a7ad25b48..8611a26c58 100644 --- a/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php +++ b/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php @@ -104,8 +104,6 @@ public function getValue() * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAVACL/Xml/Property/Principal.php b/lib/DAVACL/Xml/Property/Principal.php index e19ad61744..d48716c873 100644 --- a/lib/DAVACL/Xml/Property/Principal.php +++ b/lib/DAVACL/Xml/Property/Principal.php @@ -25,22 +25,22 @@ class Principal extends DAV\Xml\Property\Href /** * To specify a not-logged-in user, use the UNAUTHENTICATED principal. */ - const UNAUTHENTICATED = 1; + public const UNAUTHENTICATED = 1; /** * To specify any principal that is logged in, use AUTHENTICATED. */ - const AUTHENTICATED = 2; + public const AUTHENTICATED = 2; /** * Specific principals can be specified with the HREF. */ - const HREF = 3; + public const HREF = 3; /** * Everybody, basically. */ - const ALL = 4; + public const ALL = 4; /** * Principal-type. @@ -163,8 +163,6 @@ public function toHtml(HtmlOutputHelper $html) * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAVACL/Xml/Request/AclPrincipalPropSetReport.php b/lib/DAVACL/Xml/Request/AclPrincipalPropSetReport.php index 4fc61273af..99a7e2bd49 100644 --- a/lib/DAVACL/Xml/Request/AclPrincipalPropSetReport.php +++ b/lib/DAVACL/Xml/Request/AclPrincipalPropSetReport.php @@ -40,8 +40,6 @@ class AclPrincipalPropSetReport implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAVACL/Xml/Request/ExpandPropertyReport.php b/lib/DAVACL/Xml/Request/ExpandPropertyReport.php index 70a7e22000..9534b27af9 100644 --- a/lib/DAVACL/Xml/Request/ExpandPropertyReport.php +++ b/lib/DAVACL/Xml/Request/ExpandPropertyReport.php @@ -51,8 +51,6 @@ class ExpandPropertyReport implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAVACL/Xml/Request/PrincipalMatchReport.php b/lib/DAVACL/Xml/Request/PrincipalMatchReport.php index b49582450d..97e5bef321 100644 --- a/lib/DAVACL/Xml/Request/PrincipalMatchReport.php +++ b/lib/DAVACL/Xml/Request/PrincipalMatchReport.php @@ -25,12 +25,12 @@ class PrincipalMatchReport implements XmlDeserializable /** * Report on a list of principals that match the current principal. */ - const SELF = 1; + public const SELF = 1; /** * Report on a property on resources, such as {DAV:}owner, that match the current principal. */ - const PRINCIPAL_PROPERTY = 2; + public const PRINCIPAL_PROPERTY = 2; /** * Must be SELF or PRINCIPAL_PROPERTY. @@ -71,8 +71,6 @@ class PrincipalMatchReport implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php b/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php index bddceca8da..f52cc83de0 100644 --- a/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php +++ b/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php @@ -72,8 +72,6 @@ class PrincipalPropertySearchReport implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/lib/DAVACL/Xml/Request/PrincipalSearchPropertySetReport.php b/lib/DAVACL/Xml/Request/PrincipalSearchPropertySetReport.php index 7f15d8a4e7..a039cbd0dc 100644 --- a/lib/DAVACL/Xml/Request/PrincipalSearchPropertySetReport.php +++ b/lib/DAVACL/Xml/Request/PrincipalSearchPropertySetReport.php @@ -39,8 +39,6 @@ class PrincipalSearchPropertySetReport implements XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/tests/Sabre/AbstractDAVServerTestCase.php b/tests/Sabre/AbstractDAVServerTestCase.php index 40dcb41dfa..78833b2118 100644 --- a/tests/Sabre/AbstractDAVServerTestCase.php +++ b/tests/Sabre/AbstractDAVServerTestCase.php @@ -116,7 +116,7 @@ abstract class AbstractDAVServerTestCase extends TestCase * If this string is set, we will automatically log in the user with this * name. */ - protected $autoLogin = null; + protected $autoLogin; public function setup(): void { diff --git a/tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php b/tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php index f25773e00f..39f9e04ffe 100644 --- a/tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php +++ b/tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php @@ -4,7 +4,6 @@ namespace Sabre\CalDAV\Backend; -use DateTime; use PHPUnit\Framework\TestCase; use Sabre\CalDAV; use Sabre\DAV; @@ -87,7 +86,7 @@ public function testUpdateCalendarAndFetch() { $backend = new PDO($this->pdo); - //Creating a new calendar + // Creating a new calendar $newId = $backend->createCalendar('principals/user2', 'somerandomid', []); $propPatch = new PropPatch([ @@ -133,7 +132,7 @@ public function testUpdateCalendarBadId() $this->expectException('InvalidArgumentException'); $backend = new PDO($this->pdo); - //Creating a new calendar + // Creating a new calendar $newId = $backend->createCalendar('principals/user2', 'somerandomid', []); $propPatch = new PropPatch([ @@ -152,7 +151,7 @@ public function testUpdateCalendarUnknownProperty() { $backend = new PDO($this->pdo); - //Creating a new calendar + // Creating a new calendar $newId = $backend->createCalendar('principals/user2', 'somerandomid', []); $propPatch = new PropPatch([ @@ -211,7 +210,7 @@ public function testCreateCalendarIncorrectComponentSet() $this->expectException('Sabre\DAV\Exception'); $backend = new PDO($this->pdo); - //Creating a new calendar + // Creating a new calendar $newId = $backend->createCalendar('principals/user2', 'somerandomid', [ '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set' => 'blabla', ]); @@ -769,8 +768,8 @@ public function testCalendarQueryTimeRange() 'prop-filters' => [], 'is-not-defined' => false, 'time-range' => [ - 'start' => new DateTime('20120103'), - 'end' => new DateTime('20120104'), + 'start' => new \DateTime('20120103'), + 'end' => new \DateTime('20120104'), ], ], ], @@ -800,7 +799,7 @@ public function testCalendarQueryTimeRangeEndNull() 'prop-filters' => [], 'is-not-defined' => false, 'time-range' => [ - 'start' => new DateTime('20120102'), + 'start' => new \DateTime('20120102'), 'end' => null, ], ], @@ -831,7 +830,7 @@ public function testCalendarQueryTimeRangeNoEnd() 'prop-filters' => [], 'is-not-defined' => false, 'time-range' => [ - 'start' => new DateTime('20120102'), + 'start' => new \DateTime('20120102'), ], ], ], @@ -861,7 +860,7 @@ public function testCalendarQueryTimeRangeNoStart() 'prop-filters' => [], 'is-not-defined' => false, 'time-range' => [ - 'end' => new DateTime('20120102'), + 'end' => new \DateTime('20120102'), ], ], ], @@ -1000,7 +999,7 @@ public function testCreateSubscriptions() '{http://apple.com/ns/ical/}refreshrate' => 'P1W', '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF', '{http://calendarserver.org/ns/}subscribed-strip-todos' => true, - //'{http://calendarserver.org/ns/}subscribed-strip-alarms' => true, + // '{http://calendarserver.org/ns/}subscribed-strip-alarms' => true, '{http://calendarserver.org/ns/}subscribed-strip-attachments' => true, ]; @@ -1041,7 +1040,7 @@ public function testUpdateSubscriptions() '{http://apple.com/ns/ical/}refreshrate' => 'P1W', '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF', '{http://calendarserver.org/ns/}subscribed-strip-todos' => true, - //'{http://calendarserver.org/ns/}subscribed-strip-alarms' => true, + // '{http://calendarserver.org/ns/}subscribed-strip-alarms' => true, '{http://calendarserver.org/ns/}subscribed-strip-attachments' => true, ]; @@ -1083,7 +1082,7 @@ public function testUpdateSubscriptionsFail() '{http://apple.com/ns/ical/}refreshrate' => 'P1W', '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF', '{http://calendarserver.org/ns/}subscribed-strip-todos' => true, - //'{http://calendarserver.org/ns/}subscribed-strip-alarms' => true, + // '{http://calendarserver.org/ns/}subscribed-strip-alarms' => true, '{http://calendarserver.org/ns/}subscribed-strip-attachments' => true, ]; @@ -1114,7 +1113,7 @@ public function testDeleteSubscriptions() '{http://apple.com/ns/ical/}refreshrate' => 'P1W', '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF', '{http://calendarserver.org/ns/}subscribed-strip-todos' => true, - //'{http://calendarserver.org/ns/}subscribed-strip-alarms' => true, + // '{http://calendarserver.org/ns/}subscribed-strip-alarms' => true, '{http://calendarserver.org/ns/}subscribed-strip-attachments' => true, ]; diff --git a/tests/Sabre/CalDAV/Backend/Mock.php b/tests/Sabre/CalDAV/Backend/Mock.php index e20769f232..d46407a223 100644 --- a/tests/Sabre/CalDAV/Backend/Mock.php +++ b/tests/Sabre/CalDAV/Backend/Mock.php @@ -93,8 +93,6 @@ public function createCalendar($principalUri, $calendarUri, array $properties) * promise I can handle updating this property". * * Read the PropPatch documentation for more info and examples. - * - * @param mixed $calendarId */ public function updateCalendar($calendarId, PropPatch $propPatch) { @@ -181,7 +179,6 @@ public function getCalendarObjects($calendarId) * * This method must return null if the object did not exist. * - * @param mixed $calendarId * @param string $objectUri * * @return array|null diff --git a/tests/Sabre/CalDAV/Backend/MockScheduling.php b/tests/Sabre/CalDAV/Backend/MockScheduling.php index 40901c5cab..79d67cfe03 100644 --- a/tests/Sabre/CalDAV/Backend/MockScheduling.php +++ b/tests/Sabre/CalDAV/Backend/MockScheduling.php @@ -71,9 +71,8 @@ public function deleteSchedulingObject($principalUri, $objectUri) /** * Creates a new scheduling object. This should land in a users' inbox. * - * @param string $principalUri - * @param string $objectUri - * @param string|resource $objectData; + * @param string $principalUri + * @param string $objectUri */ public function createSchedulingObject($principalUri, $objectUri, $objectData) { diff --git a/tests/Sabre/CalDAV/Backend/MockSharing.php b/tests/Sabre/CalDAV/Backend/MockSharing.php index 1526e6e500..81ba247da6 100644 --- a/tests/Sabre/CalDAV/Backend/MockSharing.php +++ b/tests/Sabre/CalDAV/Backend/MockSharing.php @@ -92,7 +92,6 @@ public function deleteNotification($principalUri, NotificationInterface $notific /** * Updates the list of shares. * - * @param mixed $calendarId * @param \Sabre\DAV\Xml\Element\Sharee[] $sharees */ public function updateInvites($calendarId, array $sharees) @@ -140,8 +139,6 @@ public function updateInvites($calendarId, array $sharees) * and optionally: * $properties * - * @param mixed $calendarId - * * @return \Sabre\DAV\Xml\Element\Sharee[] */ public function getInvites($calendarId) @@ -173,8 +170,7 @@ public function shareReply($href, $status, $calendarUri, $inReplyTo, $summary = /** * Publishes a calendar. * - * @param mixed $calendarId - * @param bool $value + * @param bool $value */ public function setPublishStatus($calendarId, $value) { diff --git a/tests/Sabre/CalDAV/Backend/MockSubscriptionSupport.php b/tests/Sabre/CalDAV/Backend/MockSubscriptionSupport.php index 803cfbf007..ebe72013cc 100644 --- a/tests/Sabre/CalDAV/Backend/MockSubscriptionSupport.php +++ b/tests/Sabre/CalDAV/Backend/MockSubscriptionSupport.php @@ -71,8 +71,6 @@ public function getSubscriptionsForUser($principalUri) * * @param string $principalUri * @param string $uri - * - * @return mixed */ public function createSubscription($principalUri, $uri, array $properties) { @@ -107,7 +105,6 @@ public function createSubscription($principalUri, $uri, array $properties) * * Read the PropPatch documentation for more info and examples. * - * @param mixed $subscriptionId * @param \Sabre\DAV\PropPatch $propPatch */ public function updateSubscription($subscriptionId, DAV\PropPatch $propPatch) @@ -135,8 +132,6 @@ public function updateSubscription($subscriptionId, DAV\PropPatch $propPatch) /** * Deletes a subscription. - * - * @param mixed $subscriptionId */ public function deleteSubscription($subscriptionId) { diff --git a/tests/Sabre/CalDAV/Backend/SimplePDOTest.php b/tests/Sabre/CalDAV/Backend/SimplePDOTest.php index cb1bd8efec..5f6d238981 100644 --- a/tests/Sabre/CalDAV/Backend/SimplePDOTest.php +++ b/tests/Sabre/CalDAV/Backend/SimplePDOTest.php @@ -90,7 +90,7 @@ public function testUpdateCalendarAndFetch() { $backend = new SimplePDO($this->pdo); - //Creating a new calendar + // Creating a new calendar $newId = $backend->createCalendar('principals/user2', 'somerandomid', []); $propPatch = new PropPatch([ diff --git a/tests/Sabre/CalDAV/CalendarQueryValidatorTest.php b/tests/Sabre/CalDAV/CalendarQueryValidatorTest.php index edd9495adf..3827cb63b9 100644 --- a/tests/Sabre/CalDAV/CalendarQueryValidatorTest.php +++ b/tests/Sabre/CalDAV/CalendarQueryValidatorTest.php @@ -25,6 +25,7 @@ public function testTopLevelFail() * @param string $icalObject * @param array $filters * @param int $outcome + * * @dataProvider provider */ public function testValid($icalObject, $filters, $outcome) @@ -814,7 +815,7 @@ public function provider() [$blob32, $filter20, 0], // Bug reported on mailing list, related to all-day events (87) - //array($blob33, $filter38, 1), + // array($blob33, $filter38, 1), // Event in timerange, but filtered alarm is in the far future (88). [$blob34, $filter39, 0], diff --git a/tests/Sabre/CalDAV/PluginTest.php b/tests/Sabre/CalDAV/PluginTest.php index 127ad42c5d..ad07c764d8 100644 --- a/tests/Sabre/CalDAV/PluginTest.php +++ b/tests/Sabre/CalDAV/PluginTest.php @@ -4,8 +4,6 @@ namespace Sabre\CalDAV; -use DateTime; -use DateTimeZone; use Sabre\DAV; use Sabre\DAVACL; use Sabre\HTTP; @@ -612,8 +610,8 @@ public function testCalendarMultiGetReportExpand() $expectedIcal = TestUtil::getTestCalendarData(); $expectedIcal = \Sabre\VObject\Reader::read($expectedIcal); $expectedIcal = $expectedIcal->expand( - new DateTime('2011-01-01 00:00:00', new DateTimeZone('UTC')), - new DateTime('2011-12-31 23:59:59', new DateTimeZone('UTC')) + new \DateTime('2011-01-01 00:00:00', new \DateTimeZone('UTC')), + new \DateTime('2011-12-31 23:59:59', new \DateTimeZone('UTC')) ); $expectedIcal = str_replace("\r\n", " \n", $expectedIcal->serialize()); @@ -670,8 +668,8 @@ public function testCalendarQueryReport() $expectedIcal = TestUtil::getTestCalendarData(); $expectedIcal = \Sabre\VObject\Reader::read($expectedIcal); $expectedIcal = $expectedIcal->expand( - new DateTime('2000-01-01 00:00:00', new DateTimeZone('UTC')), - new DateTime('2010-12-31 23:59:59', new DateTimeZone('UTC')) + new \DateTime('2000-01-01 00:00:00', new \DateTimeZone('UTC')), + new \DateTime('2010-12-31 23:59:59', new \DateTimeZone('UTC')) ); $expectedIcal = str_replace("\r\n", " \n", $expectedIcal->serialize()); @@ -732,8 +730,8 @@ public function testCalendarQueryReportWindowsPhone() $expectedIcal = TestUtil::getTestCalendarData(); $expectedIcal = \Sabre\VObject\Reader::read($expectedIcal); $expectedIcal = $expectedIcal->expand( - new DateTime('2000-01-01 00:00:00', new DateTimeZone('UTC')), - new DateTime('2010-12-31 23:59:59', new DateTimeZone('UTC')) + new \DateTime('2000-01-01 00:00:00', new \DateTimeZone('UTC')), + new \DateTime('2010-12-31 23:59:59', new \DateTimeZone('UTC')) ); $expectedIcal = str_replace("\r\n", " \n", $expectedIcal->serialize()); @@ -893,8 +891,8 @@ public function testCalendarQueryReport1Object() $expectedIcal = TestUtil::getTestCalendarData(); $expectedIcal = \Sabre\VObject\Reader::read($expectedIcal); $expectedIcal = $expectedIcal->expand( - new DateTime('2000-01-01 00:00:00', new DateTimeZone('UTC')), - new DateTime('2010-12-31 23:59:59', new DateTimeZone('UTC')) + new \DateTime('2000-01-01 00:00:00', new \DateTimeZone('UTC')), + new \DateTime('2010-12-31 23:59:59', new \DateTimeZone('UTC')) ); $expectedIcal = str_replace("\r\n", " \n", $expectedIcal->serialize()); diff --git a/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php b/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php index 10d6153739..1bc2332c74 100644 --- a/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php +++ b/tests/Sabre/CalDAV/Schedule/DeliverNewEventTest.php @@ -55,7 +55,7 @@ public function testDelivery() END:VEVENT END:VCALENDAR ICS - ); + ); $messages = []; $this->server->on('schedule', function ($message) use (&$messages) { diff --git a/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php b/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php index 8652339519..5b3ee09306 100644 --- a/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php +++ b/tests/Sabre/CalDAV/Schedule/ScheduleDeliverTest.php @@ -633,7 +633,7 @@ public function putPath($path, $data) $childNode->put($data); } else {*/ $parentNode->createFile($base, $data); - //} + // } } public function assertItemsInInbox($user, $count) diff --git a/tests/Sabre/CalDAV/SharingPluginTest.php b/tests/Sabre/CalDAV/SharingPluginTest.php index 7a58656abd..7cdb287303 100644 --- a/tests/Sabre/CalDAV/SharingPluginTest.php +++ b/tests/Sabre/CalDAV/SharingPluginTest.php @@ -87,7 +87,7 @@ public function testBeforeGetSharedCalendar() ]); self::assertInstanceOf('Sabre\\CalDAV\\Xml\\Property\\Invite', $props['{'.Plugin::NS_CALENDARSERVER.'}invite']); - //self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $props['{' . Plugin::NS_CALENDARSERVER . '}shared-url']); + // self::assertInstanceOf('Sabre\\DAV\\Xml\\Property\\Href', $props['{' . Plugin::NS_CALENDARSERVER . '}shared-url']); } public function testUpdateResourceType() diff --git a/tests/Sabre/CalDAV/TestUtil.php b/tests/Sabre/CalDAV/TestUtil.php index 5de11a31ae..1af6b63b26 100644 --- a/tests/Sabre/CalDAV/TestUtil.php +++ b/tests/Sabre/CalDAV/TestUtil.php @@ -86,7 +86,7 @@ public static function getTestCalendarData($type = 1) $calendarData .= "\nDTSTART;VALUE=DATETIME:20100223T060000\n"; break; - // No DTSTART, so intentionally broken + // No DTSTART, so intentionally broken case 'X': $calendarData .= "\n"; break; diff --git a/tests/Sabre/CalDAV/Xml/Notification/InviteReplyTest.php b/tests/Sabre/CalDAV/Xml/Notification/InviteReplyTest.php index 68a599313f..19dfd697fb 100644 --- a/tests/Sabre/CalDAV/Xml/Notification/InviteReplyTest.php +++ b/tests/Sabre/CalDAV/Xml/Notification/InviteReplyTest.php @@ -12,6 +12,7 @@ class InviteReplyTest extends \PHPUnit\Framework\TestCase /** * @param array $notification * @param string $expected + * * @dataProvider dataProvider */ public function testSerializers($notification, $expected) diff --git a/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php b/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php index 5399de709f..7933d8f4e7 100644 --- a/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php +++ b/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php @@ -12,6 +12,7 @@ class InviteTest extends DAV\Xml\AbstractXmlTestCase /** * @param array $notification * @param string $expected + * * @dataProvider dataProvider */ public function testSerializers($notification, $expected) diff --git a/tests/Sabre/CalDAV/Xml/Notification/SystemStatusTest.php b/tests/Sabre/CalDAV/Xml/Notification/SystemStatusTest.php index 21eb2358f0..7754e0d5a7 100644 --- a/tests/Sabre/CalDAV/Xml/Notification/SystemStatusTest.php +++ b/tests/Sabre/CalDAV/Xml/Notification/SystemStatusTest.php @@ -12,6 +12,7 @@ class SystemStatusTest extends \PHPUnit\Framework\TestCase * @param array $notification * @param string $expected1 * @param string $expected2 + * * @dataProvider dataProvider */ public function testSerializers($notification, $expected1, $expected2) diff --git a/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php b/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php index 77d8851277..a2526c5f29 100644 --- a/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/AllowedSharingModesTest.php @@ -27,7 +27,7 @@ public function testSerialize() $xml = $this->write(['{DAV:}root' => $property]); self::assertXmlStringEqualsXmlString( -' + ' diff --git a/tests/Sabre/CalDAV/Xml/Property/EmailAddressSetTest.php b/tests/Sabre/CalDAV/Xml/Property/EmailAddressSetTest.php index 7fab3e6472..561c871938 100644 --- a/tests/Sabre/CalDAV/Xml/Property/EmailAddressSetTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/EmailAddressSetTest.php @@ -31,7 +31,7 @@ public function testSerialize() ]); self::assertXmlStringEqualsXmlString( -' + ' foo@example.org ', $xml); diff --git a/tests/Sabre/CalDAV/Xml/Property/InviteTest.php b/tests/Sabre/CalDAV/Xml/Property/InviteTest.php index 309b28291c..bd34d19e2e 100644 --- a/tests/Sabre/CalDAV/Xml/Property/InviteTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/InviteTest.php @@ -65,7 +65,7 @@ public function testSerialize() $xml = $this->write(['{DAV:}root' => $property]); self::assertXmlStringEqualsXmlString( -' + ' mailto:thedoctor@example.org diff --git a/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php b/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php index c2f76b8ae3..937972416e 100644 --- a/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/ScheduleCalendarTranspTest.php @@ -39,7 +39,7 @@ public function testSerializeOpaque() $xml = $this->write(['{DAV:}root' => $property]); self::assertXmlStringEqualsXmlString( -' + ' @@ -55,7 +55,7 @@ public function testSerializeTransparent() $xml = $this->write(['{DAV:}root' => $property]); self::assertXmlStringEqualsXmlString( -' + ' diff --git a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php index 9f60c40dd8..8d9a4c3503 100644 --- a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarComponentSetTest.php @@ -43,7 +43,7 @@ public function testSerialize() $xml = $this->write(['{DAV:}root' => $property]); self::assertXmlStringEqualsXmlString( -' + ' diff --git a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php index 51f558e178..6b40094742 100644 --- a/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/SupportedCalendarDataTest.php @@ -26,7 +26,7 @@ public function testSerialize() $xml = $this->write(['{DAV:}root' => $property]); self::assertXmlStringEqualsXmlString( -' + ' diff --git a/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php b/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php index a1f18342ec..c158b3f502 100644 --- a/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php +++ b/tests/Sabre/CalDAV/Xml/Property/SupportedCollationSetTest.php @@ -26,7 +26,7 @@ public function testSerialize() $xml = $this->write(['{DAV:}root' => $property]); self::assertXmlStringEqualsXmlString( -' + ' i;ascii-casemap i;octet diff --git a/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php b/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php index 8172c906fe..d959f4fa31 100644 --- a/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php +++ b/tests/Sabre/CalDAV/Xml/Request/CalendarQueryReportTest.php @@ -4,8 +4,6 @@ namespace Sabre\CalDAV\Xml\Request; -use DateTimeImmutable; -use DateTimeZone; use Sabre\DAV\Xml\AbstractXmlTestCase; class CalendarQueryReportTest extends AbstractXmlTestCase @@ -114,8 +112,8 @@ public function testDeserializeComplex() '{urn:ietf:params:xml:ns:caldav}calendar-data', ]; $calendarQueryReport->expand = [ - 'start' => new DateTimeImmutable('2015-01-01 00:00:00', new DateTimeZone('UTC')), - 'end' => new DateTimeImmutable('2016-01-01 00:00:00', new DateTimeZone('UTC')), + 'start' => new \DateTimeImmutable('2015-01-01 00:00:00', new \DateTimeZone('UTC')), + 'end' => new \DateTimeImmutable('2016-01-01 00:00:00', new \DateTimeZone('UTC')), ]; $calendarQueryReport->filters = [ 'name' => 'VCALENDAR', @@ -179,8 +177,8 @@ public function testDeserializeComplex() 'name' => 'X-PROP3', 'is-not-defined' => false, 'time-range' => [ - 'start' => new DateTimeImmutable('2015-01-01 00:00:00', new DateTimeZone('UTC')), - 'end' => new DateTimeImmutable('2016-01-01 00:00:00', new DateTimeZone('UTC')), + 'start' => new \DateTimeImmutable('2015-01-01 00:00:00', new \DateTimeZone('UTC')), + 'end' => new \DateTimeImmutable('2016-01-01 00:00:00', new \DateTimeZone('UTC')), ], 'text-match' => null, 'param-filters' => [], @@ -198,8 +196,8 @@ public function testDeserializeComplex() ], ], 'time-range' => [ - 'start' => new DateTimeImmutable('2015-01-01 00:00:00', new DateTimeZone('UTC')), - 'end' => new DateTimeImmutable('2016-01-01 00:00:00', new DateTimeZone('UTC')), + 'start' => new \DateTimeImmutable('2015-01-01 00:00:00', new \DateTimeZone('UTC')), + 'end' => new \DateTimeImmutable('2016-01-01 00:00:00', new \DateTimeZone('UTC')), ], ], ], diff --git a/tests/Sabre/CardDAV/AddressBookQueryTest.php b/tests/Sabre/CardDAV/AddressBookQueryTest.php index 3e048ba46a..ec7a92ca2d 100644 --- a/tests/Sabre/CardDAV/AddressBookQueryTest.php +++ b/tests/Sabre/CardDAV/AddressBookQueryTest.php @@ -18,7 +18,7 @@ public function testQuery() ); $request->setBody( -' + ' @@ -27,7 +27,7 @@ public function testQuery() ' - ); + ); $response = new HTTP\ResponseMock(); @@ -67,7 +67,7 @@ public function testQueryDepth0() ); $request->setBody( -' + ' @@ -76,7 +76,7 @@ public function testQueryDepth0() ' - ); + ); $response = new HTTP\ResponseMock(); @@ -111,7 +111,7 @@ public function testQueryNoMatch() ); $request->setBody( -' + ' @@ -120,7 +120,7 @@ public function testQueryNoMatch() ' - ); + ); $response = new HTTP\ResponseMock(); @@ -149,7 +149,7 @@ public function testQueryLimit() ]); $request->setBody( -' + ' @@ -159,7 +159,7 @@ public function testQueryLimit() 1 ' - ); + ); $response = new HTTP\ResponseMock(); @@ -194,14 +194,14 @@ public function testJson() ); $request->setBody( -' + ' ' - ); + ); $response = new HTTP\ResponseMock(); @@ -239,14 +239,14 @@ public function testVCard4() ); $request->setBody( -' + ' ' - ); + ); $response = new HTTP\ResponseMock(); diff --git a/tests/Sabre/CardDAV/Backend/Mock.php b/tests/Sabre/CardDAV/Backend/Mock.php index 6a570b1524..d176c656f5 100644 --- a/tests/Sabre/CardDAV/Backend/Mock.php +++ b/tests/Sabre/CardDAV/Backend/Mock.php @@ -123,8 +123,6 @@ public function deleteAddressBook($addressBookId) * calculating them. If they are specified, you can also ommit carddata. * This may speed up certain requests, especially with large cards. * - * @param mixed $addressBookId - * * @return array */ public function getCards($addressBookId) @@ -157,7 +155,6 @@ public function getCards($addressBookId) * * If the card does not exist, you must return false. * - * @param mixed $addressBookId * @param string $cardUri * * @return array @@ -198,7 +195,6 @@ public function getCard($addressBookId, $cardUri) * * If you don't return an ETag, you can just return null. * - * @param mixed $addressBookId * @param string $cardUri * @param string $cardData * @@ -234,7 +230,6 @@ public function createCard($addressBookId, $cardUri, $cardData) * * If you don't return an ETag, you can just return null. * - * @param mixed $addressBookId * @param string $cardUri * @param string $cardData * diff --git a/tests/Sabre/CardDAV/MultiGetTest.php b/tests/Sabre/CardDAV/MultiGetTest.php index 3557ddaeaa..c44b0513b7 100644 --- a/tests/Sabre/CardDAV/MultiGetTest.php +++ b/tests/Sabre/CardDAV/MultiGetTest.php @@ -17,7 +17,7 @@ public function testMultiGet() ]); $request->setBody( -' + ' @@ -25,7 +25,7 @@ public function testMultiGet() /addressbooks/user1/book1/card1 ' - ); + ); $response = new HTTP\ResponseMock(); @@ -60,7 +60,7 @@ public function testMultiGetVCard4() ]); $request->setBody( -' + ' @@ -68,7 +68,7 @@ public function testMultiGetVCard4() /addressbooks/user1/book1/card1 ' - ); + ); $response = new HTTP\ResponseMock(); diff --git a/tests/Sabre/CardDAV/PluginTest.php b/tests/Sabre/CardDAV/PluginTest.php index 6d7d01fcaf..46b6c61493 100644 --- a/tests/Sabre/CardDAV/PluginTest.php +++ b/tests/Sabre/CardDAV/PluginTest.php @@ -50,7 +50,7 @@ public function testDirectoryGateway() public function testReportPassThrough() { - self::assertNull($this->plugin->report('{DAV:}foo', new \DomDocument(), '')); + self::assertNull($this->plugin->report('{DAV:}foo', new \DOMDocument(), '')); } public function testHTMLActionsPanel() diff --git a/tests/Sabre/CardDAV/ValidateFilterTest.php b/tests/Sabre/CardDAV/ValidateFilterTest.php index b325d8459c..3d98397a19 100644 --- a/tests/Sabre/CardDAV/ValidateFilterTest.php +++ b/tests/Sabre/CardDAV/ValidateFilterTest.php @@ -12,6 +12,7 @@ class ValidateFilterTest extends AbstractPluginTestCase * @param string $test * @param bool $result * @param string|null $message + * * @dataProvider data */ public function testFilter($input, $filters, $test, $result, $message = '') diff --git a/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php b/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php index ed8c99ad0b..4c3cc1d10a 100644 --- a/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php +++ b/tests/Sabre/CardDAV/Xml/Property/SupportedAddressDataTest.php @@ -26,12 +26,12 @@ public function testSerialize() $xml = $this->write(['{DAV:}root' => $property]); self::assertXmlStringEqualsXmlString( -' + ' '. -''. -''. -''. -' + ''. + ''. + ''. + ' ', $xml); } } diff --git a/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php b/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php index e4f58139d5..7c6a769ae9 100644 --- a/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php +++ b/tests/Sabre/CardDAV/Xml/Property/SupportedCollationSetTest.php @@ -26,12 +26,12 @@ public function testSerialize() $xml = $this->write(['{DAV:}root' => $property]); self::assertXmlStringEqualsXmlString( -' + ' '. -'i;ascii-casemap'. -'i;octet'. -'i;unicode-casemap'. -' + 'i;ascii-casemap'. + 'i;octet'. + 'i;unicode-casemap'. + ' ', $xml); } } diff --git a/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php b/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php index d1d612329c..f5db245295 100644 --- a/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php +++ b/tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetReportTest.php @@ -12,8 +12,6 @@ class AddressBookMultiGetReportTest extends AbstractXmlTestCase /** * @dataProvider providesAddressDataXml - * - * @param $xml */ public function testDeserialize($xml, $expectedProps, $expectedVersion = '3.0') { diff --git a/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php b/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php index 68193ce6d0..c1278f0632 100644 --- a/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php +++ b/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php @@ -24,7 +24,7 @@ public function testCollectionGet() $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody(''); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals(207, $this->response->status, 'Incorrect status response received. Full response body: '.$this->response->getBodyAsString()); @@ -35,6 +35,6 @@ public function testCollectionGet() 'Vary' => ['Brief,Prefer'], ], $this->response->getHeaders() - ); + ); } } diff --git a/tests/Sabre/DAV/Browser/PluginTest.php b/tests/Sabre/DAV/Browser/PluginTest.php index 6efb00b081..2d4e787654 100644 --- a/tests/Sabre/DAV/Browser/PluginTest.php +++ b/tests/Sabre/DAV/Browser/PluginTest.php @@ -67,7 +67,7 @@ public function testCollectionGetIfNoneMatch() public function testCollectionGetRoot() { $request = new HTTP\Request('GET', '/'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals(200, $this->response->status, 'Incorrect status received. Full response body: '.$this->response->getBodyAsString()); diff --git a/tests/Sabre/DAV/DbTestHelperTrait.php b/tests/Sabre/DAV/DbTestHelperTrait.php index 6fee5e2f94..f0a0efd27c 100644 --- a/tests/Sabre/DAV/DbTestHelperTrait.php +++ b/tests/Sabre/DAV/DbTestHelperTrait.php @@ -5,7 +5,6 @@ namespace Sabre\DAV; use PDO; -use PDOException; use Sabre\TestUtil; class DbCache @@ -18,12 +17,12 @@ trait DbTestHelperTrait /** * Should be "mysql", "pgsql", "sqlite". */ - public $driver = null; + public $driver; /** * Returns a fully configured PDO object. * - * @return PDO + * @return \PDO */ public function getDb() { @@ -48,13 +47,13 @@ public function getDb() $dsn = getenv('SABRE_MYSQLDSN'); $user = getenv('SABRE_MYSQLUSER'); $pass = getenv('SABRE_MYSQLPASS'); - $pdo = new PDO($dsn, $user, $pass); + $pdo = new \PDO($dsn, $user, $pass); break; case 'sqlite': - $pdo = new PDO('sqlite:'.TestUtil::SABRE_TEMPDIR.'/testdb'); + $pdo = new \PDO('sqlite:'.TestUtil::SABRE_TEMPDIR.'/testdb'); break; case 'pgsql': - $pdo = new PDO(getenv('SABRE_PGSQLDSN')); + $pdo = new \PDO(getenv('SABRE_PGSQLDSN')); $version = $pdo->query('SELECT VERSION()')->fetchColumn(); preg_match('|([0-9\.]){5,}|', $version, $matches); $version = $matches[0]; @@ -69,8 +68,8 @@ public function getDb() $this->markTestSkipped($this->driver.' was not recognised'); } - $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - } catch (PDOException $e) { + $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + } catch (\PDOException $e) { $this->markTestSkipped($this->driver.' was not enabled or not correctly configured. Error message: '.$e->getMessage()); } @@ -82,7 +81,7 @@ public function getDb() /** * Alias for getDb. * - * @return PDO + * @return \PDO */ public function getPDO() { diff --git a/tests/Sabre/DAV/Exception/LockedTest.php b/tests/Sabre/DAV/Exception/LockedTest.php index acb33ced7a..7a747153b6 100644 --- a/tests/Sabre/DAV/Exception/LockedTest.php +++ b/tests/Sabre/DAV/Exception/LockedTest.php @@ -4,14 +4,13 @@ namespace Sabre\DAV\Exception; -use DOMDocument; use Sabre\DAV; class LockedTest extends \PHPUnit\Framework\TestCase { public function testSerialize() { - $dom = new DOMDocument('1.0'); + $dom = new \DOMDocument('1.0'); $dom->formatOutput = true; $root = $dom->createElement('d:root'); @@ -39,7 +38,7 @@ public function testSerialize() public function testSerializeAmpersand() { - $dom = new DOMDocument('1.0'); + $dom = new \DOMDocument('1.0'); $dom->formatOutput = true; $root = $dom->createElement('d:root'); diff --git a/tests/Sabre/DAV/Exception/TooManyMatchesTest.php b/tests/Sabre/DAV/Exception/TooManyMatchesTest.php index 8968a4b517..d6c0c5014f 100644 --- a/tests/Sabre/DAV/Exception/TooManyMatchesTest.php +++ b/tests/Sabre/DAV/Exception/TooManyMatchesTest.php @@ -4,14 +4,13 @@ namespace Sabre\DAV\Exception; -use DOMDocument; use Sabre\DAV; class TooManyMatchesTest extends \PHPUnit\Framework\TestCase { public function testSerialize() { - $dom = new DOMDocument('1.0'); + $dom = new \DOMDocument('1.0'); $dom->formatOutput = true; $root = $dom->createElement('d:root'); diff --git a/tests/Sabre/DAV/FSExt/ServerTest.php b/tests/Sabre/DAV/FSExt/ServerTest.php index 3f2277400e..ecefbd9a17 100644 --- a/tests/Sabre/DAV/FSExt/ServerTest.php +++ b/tests/Sabre/DAV/FSExt/ServerTest.php @@ -30,7 +30,7 @@ public function testGet() 'ETag' => ['"'.sha1(fileinode($filename).filesize($filename).filemtime($filename)).'"'], ], $this->response->getHeaders() - ); + ); self::assertEquals('Test contents', $this->response->getBodyAsString()); } @@ -39,7 +39,7 @@ public function testHEAD() { $request = new HTTP\Request('HEAD', '/test.txt'); $filename = $this->tempDir.'/test.txt'; - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -50,7 +50,7 @@ public function testHEAD() 'ETag' => ['"'.sha1(fileinode($filename).filesize($filename).filemtime($filename)).'"'], ], $this->response->getHeaders() - ); + ); self::assertEquals(200, $this->response->status); self::assertEquals('', $this->response->getBodyAsString()); @@ -61,7 +61,7 @@ public function testPut() $request = new HTTP\Request('PUT', '/testput.txt'); $filename = $this->tempDir.'/testput.txt'; $request->setBody('Testing new file'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -79,7 +79,7 @@ public function testPutAlreadyExists() { $request = new HTTP\Request('PUT', '/test.txt', ['If-None-Match' => '*']); $request->setBody('Testing new file'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -94,7 +94,7 @@ public function testPutAlreadyExists() public function testMkcol() { $request = new HTTP\Request('MKCOL', '/testcol'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -111,7 +111,7 @@ public function testPutUpdate() { $request = new HTTP\Request('PUT', '/test.txt'); $request->setBody('Testing updated file'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals('0', $this->response->getHeader('Content-Length')); @@ -124,7 +124,7 @@ public function testPutUpdate() public function testDelete() { $request = new HTTP\Request('DELETE', '/test.txt'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -143,7 +143,7 @@ public function testDeleteDirectory() file_put_contents($this->tempDir.'/testcol/test.txt', 'Hi! I\'m a file with a short lifespan'); $request = new HTTP\Request('DELETE', '/testcol'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -158,7 +158,7 @@ public function testDeleteDirectory() public function testOptions() { $request = new HTTP\Request('OPTIONS', '/'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -179,7 +179,7 @@ public function testMove() mkdir($this->tempDir.'/testcol'); $request = new HTTP\Request('MOVE', '/test.txt', ['Destination' => '/testcol/test2.txt']); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals(201, $this->response->status); @@ -214,7 +214,7 @@ public function testMoveOtherObject() $this->server->tree = $tree; $request = new HTTP\Request('MOVE', '/tree1', ['Destination' => '/tree2/tree1']); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals(201, $this->response->status); @@ -235,7 +235,7 @@ public function testCopy() mkdir($this->tempDir.'/testcol'); $request = new HTTP\Request('COPY', '/test.txt', ['Destination' => '/testcol/test2.txt']); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals(201, $this->response->status); diff --git a/tests/Sabre/DAV/Locks/Backend/AbstractTestCase.php b/tests/Sabre/DAV/Locks/Backend/AbstractTestCase.php index 73425e6b8f..2a6da0d710 100644 --- a/tests/Sabre/DAV/Locks/Backend/AbstractTestCase.php +++ b/tests/Sabre/DAV/Locks/Backend/AbstractTestCase.php @@ -10,8 +10,6 @@ abstract class AbstractTestCase extends TestCase { /** - * @abstract - * * @return AbstractBackend */ abstract public function getBackend(); diff --git a/tests/Sabre/DAV/Locks/Backend/Mock.php b/tests/Sabre/DAV/Locks/Backend/Mock.php index adc416bc26..5878dfdf29 100644 --- a/tests/Sabre/DAV/Locks/Backend/Mock.php +++ b/tests/Sabre/DAV/Locks/Backend/Mock.php @@ -38,12 +38,12 @@ public function getLocks($uri, $returnChildLocks) $locks = $this->getData(); foreach ($locks as $lock) { - if ($lock->uri === $uri || - //deep locks on parents - (0 != $lock->depth && 0 === strpos($uri, $lock->uri.'/')) || + if ($lock->uri === $uri + // deep locks on parents + || (0 != $lock->depth && 0 === strpos($uri, $lock->uri.'/')) // locks on children - ($returnChildLocks && (0 === strpos($lock->uri, $uri.'/')))) { + || ($returnChildLocks && (0 === strpos($lock->uri, $uri.'/')))) { $newLocks[] = $lock; } } @@ -76,8 +76,8 @@ public function lock($uri, LockInfo $lockInfo) foreach ($locks as $k => $lock) { if ( - ($lock->token == $lockInfo->token) || - (time() > $lock->timeout + $lock->created) + ($lock->token == $lockInfo->token) + || (time() > $lock->timeout + $lock->created) ) { unset($locks[$k]); } diff --git a/tests/Sabre/DAV/Locks/MSWordTest.php b/tests/Sabre/DAV/Locks/MSWordTest.php index 2fb9aeb2e7..ae6355348a 100644 --- a/tests/Sabre/DAV/Locks/MSWordTest.php +++ b/tests/Sabre/DAV/Locks/MSWordTest.php @@ -36,7 +36,7 @@ public function testLockEtc() self::assertTrue((bool) $server->httpResponse->getHeaders('Lock-Token')); $lockToken = $server->httpResponse->getHeader('Lock-Token'); - //sleep(10); + // sleep(10); $response2 = new HTTP\ResponseMock(); @@ -47,7 +47,7 @@ public function testLockEtc() self::assertEquals(201, $server->httpResponse->status); self::assertTrue((bool) $server->httpResponse->getHeaders('Lock-Token')); - //sleep(10); + // sleep(10); $response3 = new HTTP\ResponseMock(); $server->httpRequest = $this->getPutRequest($lockToken); diff --git a/tests/Sabre/DAV/Locks/PluginTest.php b/tests/Sabre/DAV/Locks/PluginTest.php index 66f16abd81..48a0edcfb6 100644 --- a/tests/Sabre/DAV/Locks/PluginTest.php +++ b/tests/Sabre/DAV/Locks/PluginTest.php @@ -52,7 +52,7 @@ public function testLockNoBody() 'Content-Type' => ['application/xml; charset=utf-8'], ], $this->response->getHeaders() - ); + ); self::assertEquals(400, $this->response->status); } @@ -268,7 +268,7 @@ public function testUnlockNoToken() 'Content-Type' => ['application/xml; charset=utf-8'], ], $this->response->getHeaders() - ); + ); self::assertEquals(400, $this->response->status); } @@ -287,7 +287,7 @@ public function testUnlockBadToken() 'Content-Type' => ['application/xml; charset=utf-8'], ], $this->response->getHeaders() - ); + ); self::assertEquals(409, $this->response->status, 'Got an incorrect status code. Full response body: '.$this->response->getBodyAsString()); } @@ -357,7 +357,7 @@ public function testUnlock() 'Content-Length' => ['0'], ], $this->server->httpResponse->getHeaders() - ); + ); } /** @@ -394,7 +394,7 @@ public function testUnlockWindowsBug() 'Content-Length' => ['0'], ], $this->server->httpResponse->getHeaders() - ); + ); } /** diff --git a/tests/Sabre/DAV/Mock/Collection.php b/tests/Sabre/DAV/Mock/Collection.php index 3ffb342ddd..4671955997 100644 --- a/tests/Sabre/DAV/Mock/Collection.php +++ b/tests/Sabre/DAV/Mock/Collection.php @@ -31,8 +31,7 @@ class Collection extends DAV\Collection /** * Creates the object. * - * @param string $name - * @param Collection $parent + * @param string $name */ public function __construct($name, array $children = [], Collection $parent = null) { diff --git a/tests/Sabre/DAV/Mock/File.php b/tests/Sabre/DAV/Mock/File.php index d48ddaa922..620cf49797 100644 --- a/tests/Sabre/DAV/Mock/File.php +++ b/tests/Sabre/DAV/Mock/File.php @@ -25,10 +25,9 @@ class File extends DAV\File /** * Creates the object. * - * @param string $name - * @param resource $contents - * @param Collection $parent - * @param int $lastModified + * @param string $name + * @param resource $contents + * @param int $lastModified */ public function __construct($name, $contents, Collection $parent = null, $lastModified = -1) { @@ -100,8 +99,6 @@ public function put($data) * Returns the data. * * This method may either return a string or a readable stream resource - * - * @return mixed */ public function get() { diff --git a/tests/Sabre/DAV/Mock/PropertiesCollection.php b/tests/Sabre/DAV/Mock/PropertiesCollection.php index 42468f995d..5e1c06f731 100644 --- a/tests/Sabre/DAV/Mock/PropertiesCollection.php +++ b/tests/Sabre/DAV/Mock/PropertiesCollection.php @@ -53,7 +53,7 @@ public function propPatch(PropPatch $proppatch) return $r; case 'updatepropsobj': - return new \STDClass(); + return new \stdClass(); } }); } diff --git a/tests/Sabre/DAV/Mock/StreamingFile.php b/tests/Sabre/DAV/Mock/StreamingFile.php index 951327e334..ec23d81b0c 100644 --- a/tests/Sabre/DAV/Mock/StreamingFile.php +++ b/tests/Sabre/DAV/Mock/StreamingFile.php @@ -54,8 +54,6 @@ public function put($data) * Returns the data. * * This method may either return a string or a readable stream resource - * - * @return mixed */ public function get() { diff --git a/tests/Sabre/DAV/MockLogger.php b/tests/Sabre/DAV/MockLogger.php index 17e2f1dd9d..54867b03c7 100644 --- a/tests/Sabre/DAV/MockLogger.php +++ b/tests/Sabre/DAV/MockLogger.php @@ -21,7 +21,6 @@ class MockLogger extends AbstractLogger /** * Logs with an arbitrary level. * - * @param mixed $level * @param string $message */ public function log($level, $message, array $context = []) diff --git a/tests/Sabre/DAV/Mount/PluginTest.php b/tests/Sabre/DAV/Mount/PluginTest.php index e630d561f8..01a4dc504f 100644 --- a/tests/Sabre/DAV/Mount/PluginTest.php +++ b/tests/Sabre/DAV/Mount/PluginTest.php @@ -23,7 +23,7 @@ public function testPassThrough() ]; $request = HTTP\Sapi::createFromServerArray($serverVars); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals(501, $this->response->status, 'We expected GET to not be implemented for Directories. Response body: '.$this->response->getBodyAsString()); @@ -39,7 +39,7 @@ public function testMountResponse() ]; $request = HTTP\Sapi::createFromServerArray($serverVars); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals(200, $this->response->status); diff --git a/tests/Sabre/DAV/ServerMKCOLTest.php b/tests/Sabre/DAV/ServerMKCOLTest.php index 9e9dfb88bc..505d2a5906 100644 --- a/tests/Sabre/DAV/ServerMKCOLTest.php +++ b/tests/Sabre/DAV/ServerMKCOLTest.php @@ -17,7 +17,7 @@ public function testMkcol() $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody(''); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -42,7 +42,7 @@ public function testMKCOLUnknownBody() $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody('Hello'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -66,7 +66,7 @@ public function testMKCOLBrokenXML() $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody('Hello'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -90,7 +90,7 @@ public function testMKCOLUnknownXML() $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody(''); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -121,7 +121,7 @@ public function testMKCOLNoResourceType() '); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -152,7 +152,7 @@ public function testMKCOLIncorrectResourceType() '); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -183,7 +183,7 @@ public function testMKCOLSuccess() '); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -216,7 +216,7 @@ public function testMKCOLWhiteSpaceResourceType() '); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -240,7 +240,7 @@ public function testMKCOLNoParent() $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody(''); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -264,7 +264,7 @@ public function testMKCOLParentIsNoCollection() $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody(''); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -288,7 +288,7 @@ public function testMKCOLAlreadyExists() $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody(''); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -320,7 +320,7 @@ public function testMKCOLAndProps() '); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); $bodyAsString = $this->response->getBodyAsString(); diff --git a/tests/Sabre/DAV/ServerPluginTest.php b/tests/Sabre/DAV/ServerPluginTest.php index 19d99b9953..7d5933ad3e 100644 --- a/tests/Sabre/DAV/ServerPluginTest.php +++ b/tests/Sabre/DAV/ServerPluginTest.php @@ -44,7 +44,7 @@ public function testOptions() ]; $request = HTTP\Sapi::createFromServerArray($serverVars); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ diff --git a/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php b/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php index c60e3899ba..f5bc0339a0 100644 --- a/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php +++ b/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php @@ -58,7 +58,7 @@ public function testPropFindEmptyBody() 'Vary' => ['Brief,Prefer'], ], $this->response->getHeaders() - ); + ); $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $bodyAsString); $xml = simplexml_load_string($body); diff --git a/tests/Sabre/DAV/ServerPropsTest.php b/tests/Sabre/DAV/ServerPropsTest.php index 398f04f53c..bf2f18e9d6 100644 --- a/tests/Sabre/DAV/ServerPropsTest.php +++ b/tests/Sabre/DAV/ServerPropsTest.php @@ -53,7 +53,7 @@ public function testPropFindEmptyBody() 'Vary' => ['Brief,Prefer'], ], $this->response->getHeaders() - ); + ); $xml = $this->getSanitizedBodyAsXml(); $xml->registerXPathNamespace('d', 'urn:DAV'); @@ -82,7 +82,7 @@ public function testPropFindEmptyBodyDepth1Custom() 'Vary' => ['Brief,Prefer'], ], $this->response->getHeaders() - ); + ); $xml = $this->getSanitizedBodyAsXml(); $xml->registerXPathNamespace('d', 'urn:DAV'); @@ -107,7 +107,7 @@ public function testPropFindEmptyBodyFile() 'Vary' => ['Brief,Prefer'], ], $this->response->getHeaders() - ); + ); $xml = $this->getSanitizedBodyAsXml(); $xml->registerXPathNamespace('d', 'urn:DAV'); diff --git a/tests/Sabre/DAV/ServerRangeTest.php b/tests/Sabre/DAV/ServerRangeTest.php index 17ca773844..837868c8e8 100644 --- a/tests/Sabre/DAV/ServerRangeTest.php +++ b/tests/Sabre/DAV/ServerRangeTest.php @@ -4,7 +4,6 @@ namespace Sabre\DAV; -use DateTime; use Sabre\HTTP; /** @@ -29,14 +28,14 @@ public function setup(): void $this->server->createFile('files/test.txt', 'Test contents'); $this->lastModified = HTTP\toDate( - new DateTime('@'.$this->server->tree->getNodeForPath('files/test.txt')->getLastModified()) + new \DateTime('@'.$this->server->tree->getNodeForPath('files/test.txt')->getLastModified()) ); $stream = popen('echo "Test contents"', 'r'); $streamingFile = new Mock\StreamingFile( - 'no-seeking.txt', - $stream - ); + 'no-seeking.txt', + $stream + ); $streamingFile->setSize(12); $this->server->tree->getNodeForPath('files')->addNode($streamingFile); } diff --git a/tests/Sabre/DAV/ServerSimpleTest.php b/tests/Sabre/DAV/ServerSimpleTest.php index 9f741879d9..2d0fb9f36c 100644 --- a/tests/Sabre/DAV/ServerSimpleTest.php +++ b/tests/Sabre/DAV/ServerSimpleTest.php @@ -71,7 +71,7 @@ public function testNonExistantMethod() ]; $request = HTTP\Sapi::createFromServerArray($serverVars); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -93,7 +93,7 @@ public function testBaseUri() $request = HTTP\Sapi::createFromServerArray($serverVars); $this->server->setBaseUri('/blabla/'); self::assertEquals('/blabla/', $this->server->getBaseUri()); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals([ @@ -104,7 +104,7 @@ public function testBaseUri() 'ETag' => ['"'.sha1(fileinode($filename).filesize($filename).filemtime($filename)).'"'], ], $this->response->getHeaders() - ); + ); self::assertEquals(200, $this->response->status); self::assertEquals('Test contents', stream_get_contents($this->response->body)); @@ -356,7 +356,7 @@ public function testReportNotFound() ]; $request = HTTP\Sapi::createFromServerArray($serverVars); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->httpRequest->setBody(''); $this->server->exec(); @@ -365,7 +365,7 @@ public function testReportNotFound() 'Content-Type' => ['application/xml; charset=utf-8'], ], $this->response->getHeaders() - ); + ); self::assertEquals(415, $this->response->status, 'We got an incorrect status back. Full response body follows: '.$this->response->getBodyAsString()); } @@ -378,7 +378,7 @@ public function testReportIntercepted() ]; $request = HTTP\Sapi::createFromServerArray($serverVars); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->httpRequest->setBody(''); $this->server->on('report', [$this, 'reportHandler']); $this->server->exec(); diff --git a/tests/Sabre/DAV/SimpleCollectionTest.php b/tests/Sabre/DAV/SimpleCollectionTest.php index ec321721b8..14f83a9dc6 100644 --- a/tests/Sabre/DAV/SimpleCollectionTest.php +++ b/tests/Sabre/DAV/SimpleCollectionTest.php @@ -29,7 +29,7 @@ public function testConstructNodeArray() public function testConstructBadParam() { $this->expectException('InvalidArgumentException'); - new SimpleCollection('foo', [new \StdClass()]); + new SimpleCollection('foo', [new \stdClass()]); } public function testGetChildren() diff --git a/tests/Sabre/DAV/Sync/MockSyncCollection.php b/tests/Sabre/DAV/Sync/MockSyncCollection.php index d24ba0af72..c702b393c2 100644 --- a/tests/Sabre/DAV/Sync/MockSyncCollection.php +++ b/tests/Sabre/DAV/Sync/MockSyncCollection.php @@ -20,7 +20,7 @@ class MockSyncCollection extends DAV\SimpleCollection implements ISyncCollection { public $changeLog = []; - public $token = null; + public $token; /** * This method returns the current sync-token for this collection. @@ -106,10 +106,10 @@ public function getChanges($syncToken, $syncLevel, $limit = null) if (is_null($syncToken)) { return [ 'added' => array_map( - function ($item) { - return $item->getName(); - }, $this->getChildren() - ), + function ($item) { + return $item->getName(); + }, $this->getChildren() + ), 'modified' => [], 'deleted' => [], 'syncToken' => $this->getSyncToken(), diff --git a/tests/Sabre/DAV/SyncTokenPropertyTest.php b/tests/Sabre/DAV/SyncTokenPropertyTest.php index 6603dbbf1d..cec7e6751b 100644 --- a/tests/Sabre/DAV/SyncTokenPropertyTest.php +++ b/tests/Sabre/DAV/SyncTokenPropertyTest.php @@ -12,7 +12,6 @@ class SyncTokenPropertyTest extends \Sabre\AbstractDAVServerTestCase * result. * * @param string $name - * @param mixed $value * * @dataProvider data */ @@ -35,7 +34,6 @@ public function testAlreadyThere1($name, $value) * fetch the items. * * @param string $name - * @param mixed $value * * @dataProvider data */ diff --git a/tests/Sabre/DAV/TemporaryFileFilterTest.php b/tests/Sabre/DAV/TemporaryFileFilterTest.php index 5082a0f73f..44e5be07e0 100644 --- a/tests/Sabre/DAV/TemporaryFileFilterTest.php +++ b/tests/Sabre/DAV/TemporaryFileFilterTest.php @@ -19,7 +19,7 @@ public function testPutNormal() { $request = new HTTP\Request('PUT', '/testput.txt', [], 'Testing new file'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals('', $this->response->getBodyAsString()); @@ -34,7 +34,7 @@ public function testPutTemp() // mimicking an OS/X resource fork $request = new HTTP\Request('PUT', '/._testput.txt', [], 'Testing new file'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals('', $this->response->getBodyAsString()); @@ -51,7 +51,7 @@ public function testPutTempIfNoneMatch() // mimicking an OS/X resource fork $request = new HTTP\Request('PUT', '/._testput.txt', ['If-None-Match' => '*'], 'Testing new file'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals('', $this->response->getBodyAsString()); @@ -75,7 +75,7 @@ public function testPutGet() { // mimicking an OS/X resource fork $request = new HTTP\Request('PUT', '/._testput.txt', [], 'Testing new file'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals('', $this->response->getBodyAsString()); @@ -128,7 +128,7 @@ public function testLockNonExistant() '); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); self::assertEquals(201, $this->response->status); @@ -181,7 +181,7 @@ public function testPutPropfind() $request = new HTTP\Request('PROPFIND', '/._testput.txt'); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); $bodyAsString = $this->response->getBodyAsString(); diff --git a/tests/Sabre/DAV/Xml/Element/PropTest.php b/tests/Sabre/DAV/Xml/Element/PropTest.php index 939addedae..5bbf9a08cc 100644 --- a/tests/Sabre/DAV/Xml/Element/PropTest.php +++ b/tests/Sabre/DAV/Xml/Element/PropTest.php @@ -131,7 +131,7 @@ public function testDeserializeCustomBadObj() $expected = []; $elementMap = [ - '{DAV:}foo' => new \StdClass(), + '{DAV:}foo' => new \stdClass(), ]; self::assertDecodeProp($input, $expected, $elementMap); diff --git a/tests/Sabre/DAV/Xml/Element/ResponseTest.php b/tests/Sabre/DAV/Xml/Element/ResponseTest.php index 9863475ccd..bda578d317 100644 --- a/tests/Sabre/DAV/Xml/Element/ResponseTest.php +++ b/tests/Sabre/DAV/Xml/Element/ResponseTest.php @@ -44,7 +44,7 @@ public function testSerialize() $xml = $this->write(['{DAV:}root' => ['{DAV:}response' => $property]]); self::assertXmlStringEqualsXmlString( -' + ' /uri @@ -83,7 +83,7 @@ public function testSerializeEmptyNamespace() $xml = $this->write(['{DAV:}root' => ['{DAV:}response' => $property]]); self::assertEquals( -' + ' /uri @@ -114,7 +114,7 @@ public function testSerializeCustomNamespace() $xml = $this->write(['{DAV:}root' => ['{DAV:}response' => $property]]); self::assertXmlStringEqualsXmlString( -' + ' /uri @@ -143,7 +143,7 @@ public function testSerializeComplexProperty() $xml = $this->write(['{DAV:}root' => ['{DAV:}response' => $property]]); self::assertXmlStringEqualsXmlString( -' + ' /uri @@ -166,7 +166,7 @@ public function testSerializeBreak() $this->expectException('InvalidArgumentException'); $innerProps = [ 200 => [ - '{DAV:}link' => new \STDClass(), + '{DAV:}link' => new \stdClass(), ], ]; @@ -222,7 +222,7 @@ public function testSerializeUrlencoding() $xml = $this->write(['{DAV:}root' => ['{DAV:}response' => $property]]); self::assertXmlStringEqualsXmlString( -' + ' /space%20here @@ -255,7 +255,7 @@ public function testSerializeNoProperties() $xml = $this->write(['{DAV:}root' => ['{DAV:}response' => $property]]); self::assertXmlStringEqualsXmlString( -' + ' /uri @@ -283,7 +283,7 @@ public function testSerializeNoPropertiesButStatus() $xml = $this->write(['{DAV:}root' => ['{DAV:}response' => $property]]); self::assertXmlStringEqualsXmlString( -' + ' /uri @@ -312,7 +312,7 @@ public function testSerializePropertiesAndStatus() $xml = $this->write(['{DAV:}root' => ['{DAV:}response' => $property]]); self::assertXmlStringEqualsXmlString( -' + ' /uri diff --git a/tests/Sabre/DAV/Xml/Property/HrefTest.php b/tests/Sabre/DAV/Xml/Property/HrefTest.php index dcc564b26b..0a7b6d296e 100644 --- a/tests/Sabre/DAV/Xml/Property/HrefTest.php +++ b/tests/Sabre/DAV/Xml/Property/HrefTest.php @@ -25,7 +25,7 @@ public function testSerialize() $xml = $this->write(['{DAV:}anything' => $href]); self::assertXmlStringEqualsXmlString( -' + ' /bla/path ', $xml); } @@ -76,7 +76,7 @@ public function testSerializeEntity() $xml = $this->write(['{DAV:}anything' => $href]); self::assertXmlStringEqualsXmlString( -' + ' http://example.org/?a&b ', $xml); } diff --git a/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php b/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php index ffce1366ce..6e65629265 100644 --- a/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php +++ b/tests/Sabre/DAV/Xml/Property/LastModifiedTest.php @@ -4,15 +4,13 @@ namespace Sabre\DAV\Xml\Property; -use DateTime; -use DateTimeZone; use Sabre\DAV\Xml\AbstractXmlTestCase; class LastModifiedTest extends AbstractXmlTestCase { public function testSerializeDateTime() { - $dt = new DateTime('2015-03-24 11:47:00', new DateTimeZone('America/Vancouver')); + $dt = new \DateTime('2015-03-24 11:47:00', new \DateTimeZone('America/Vancouver')); $val = ['{DAV:}getlastmodified' => new GetLastModified($dt)]; $result = $this->write($val); @@ -26,7 +24,7 @@ public function testSerializeDateTime() public function testSerializeTimeStamp() { - $dt = new DateTime('2015-03-24 11:47:00', new DateTimeZone('America/Vancouver')); + $dt = new \DateTime('2015-03-24 11:47:00', new \DateTimeZone('America/Vancouver')); $dt = $dt->getTimeStamp(); $val = ['{DAV:}getlastmodified' => new GetLastModified($dt)]; @@ -50,7 +48,7 @@ public function testDeserialize() $result = $this->parse($input, $elementMap); self::assertEquals( - new DateTime('2015-03-24 18:47:00', new DateTimeZone('UTC')), + new \DateTime('2015-03-24 18:47:00', new \DateTimeZone('UTC')), $result['value']->getTime() ); } diff --git a/tests/Sabre/DAV/Xml/Property/LocalHrefTest.php b/tests/Sabre/DAV/Xml/Property/LocalHrefTest.php index a03da08e0d..2730f73cdb 100644 --- a/tests/Sabre/DAV/Xml/Property/LocalHrefTest.php +++ b/tests/Sabre/DAV/Xml/Property/LocalHrefTest.php @@ -25,7 +25,7 @@ public function testSerialize() $xml = $this->write(['{DAV:}anything' => $href]); self::assertXmlStringEqualsXmlString( -' + ' /bla/path ', $xml); } @@ -40,7 +40,7 @@ public function testSerializeSpace() $xml = $this->write(['{DAV:}anything' => $href]); self::assertXmlStringEqualsXmlString( -' + ' /bla/path%20alsopath ', $xml); } diff --git a/tests/Sabre/DAV/Xml/Property/LockDiscoveryTest.php b/tests/Sabre/DAV/Xml/Property/LockDiscoveryTest.php index a68877206b..1b039f720a 100644 --- a/tests/Sabre/DAV/Xml/Property/LockDiscoveryTest.php +++ b/tests/Sabre/DAV/Xml/Property/LockDiscoveryTest.php @@ -25,7 +25,7 @@ public function testSerialize() $xml = $this->write(['{DAV:}root' => $prop]); self::assertXmlStringEqualsXmlString( -' + ' @@ -62,7 +62,7 @@ public function testSerializeShared() $xml = $this->write(['{DAV:}root' => $prop]); self::assertXmlStringEqualsXmlString( -' + ' diff --git a/tests/Sabre/DAV/Xml/Property/SupportedReportSetTest.php b/tests/Sabre/DAV/Xml/Property/SupportedReportSetTest.php index 113ab4e7d8..001a7a11ef 100644 --- a/tests/Sabre/DAV/Xml/Property/SupportedReportSetTest.php +++ b/tests/Sabre/DAV/Xml/Property/SupportedReportSetTest.php @@ -20,7 +20,7 @@ public function sendPROPFIND($body) $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody($body); - $this->server->httpRequest = ($request); + $this->server->httpRequest = $request; $this->server->exec(); } diff --git a/tests/Sabre/DAVACL/ACLMethodTest.php b/tests/Sabre/DAVACL/ACLMethodTest.php index 52bf4a86d1..41241da044 100644 --- a/tests/Sabre/DAVACL/ACLMethodTest.php +++ b/tests/Sabre/DAVACL/ACLMethodTest.php @@ -21,7 +21,7 @@ public function testCallback() } /** - /** + * /** */ public function testNotSupportedByNode() { diff --git a/tests/Sabre/DAVACL/PluginPropertiesTest.php b/tests/Sabre/DAVACL/PluginPropertiesTest.php index dca67974eb..67bfa52f17 100644 --- a/tests/Sabre/DAVACL/PluginPropertiesTest.php +++ b/tests/Sabre/DAVACL/PluginPropertiesTest.php @@ -19,7 +19,7 @@ public function testPrincipalCollectionSet() 'privilege' => '{DAV:}all', ], ]); - //Anyone can do anything + // Anyone can do anything $plugin->principalCollectionSet = [ 'principals1', 'principals2', @@ -237,8 +237,8 @@ public function testAlternateUriSet() ]; $fakeServer = new DAV\Server($tree); - //$plugin = new DAV\Auth\Plugin(new DAV\Auth\MockBackend()) - //$fakeServer->addPlugin($plugin); + // $plugin = new DAV\Auth\Plugin(new DAV\Auth\MockBackend()) + // $fakeServer->addPlugin($plugin); $plugin = new Plugin(); $plugin->allowUnauthenticatedAccess = false; $plugin->setDefaultACL([ @@ -271,8 +271,8 @@ public function testPrincipalURL() ]; $fakeServer = new DAV\Server($tree); - //$plugin = new DAV\Auth\Plugin(new DAV\Auth\MockBackend()); - //$fakeServer->addPlugin($plugin); + // $plugin = new DAV\Auth\Plugin(new DAV\Auth\MockBackend()); + // $fakeServer->addPlugin($plugin); $plugin = new Plugin(); $plugin->allowUnauthenticatedAccess = false; $plugin->setDefaultACL([ @@ -306,8 +306,8 @@ public function testGroupMemberSet() ]; $fakeServer = new DAV\Server($tree); - //$plugin = new DAV\Auth\Plugin(new DAV\Auth\MockBackend()); - //$fakeServer->addPlugin($plugin); + // $plugin = new DAV\Auth\Plugin(new DAV\Auth\MockBackend()); + // $fakeServer->addPlugin($plugin); $plugin = new Plugin(); $plugin->allowUnauthenticatedAccess = false; $plugin->setDefaultACL([ diff --git a/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php b/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php index c6615ab67f..a184bf6286 100644 --- a/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php +++ b/tests/Sabre/DAVACL/PluginUpdatePropertiesTest.php @@ -84,7 +84,7 @@ public function testSetBadValue() $server->addPlugin($plugin); $result = $server->updateProperties('foo', [ - '{DAV:}group-member-set' => new \StdClass(), + '{DAV:}group-member-set' => new \stdClass(), ]); } diff --git a/tests/Sabre/DAVACL/SimplePluginTest.php b/tests/Sabre/DAVACL/SimplePluginTest.php index bd0f58c94c..5ab1a932b1 100644 --- a/tests/Sabre/DAVACL/SimplePluginTest.php +++ b/tests/Sabre/DAVACL/SimplePluginTest.php @@ -145,7 +145,7 @@ public function testCurrentUserPrincipalsSimple() $auth = new DAV\Auth\Plugin(new DAV\Auth\Backend\Mock()); $server->addPlugin($auth); - //forcing login + // forcing login $auth->beforeMethod(new HTTP\Request('GET', '/'), new HTTP\Response()); self::assertEquals(['principals/admin'], $acl->getCurrentUserPrincipals()); @@ -170,7 +170,7 @@ public function testCurrentUserPrincipalsGroups() $auth = new DAV\Auth\Plugin(new DAV\Auth\Backend\Mock()); $server->addPlugin($auth); - //forcing login + // forcing login $auth->beforeMethod(new HTTP\Request('GET', '/'), new HTTP\Response()); $expected = [ @@ -244,7 +244,7 @@ public function testGetCurrentUserPrivilegeSet() $auth = new DAV\Auth\Plugin(new DAV\Auth\Backend\Mock()); $server->addPlugin($auth); - //forcing login + // forcing login $auth->beforeMethod(new HTTP\Request('GET', '/'), new HTTP\Response()); $expected = [ @@ -294,8 +294,8 @@ public function testCheckPrivileges() $auth = new DAV\Auth\Plugin(new DAV\Auth\Backend\Mock()); $server->addPlugin($auth); - //forcing login - //$auth->beforeMethod('GET','/'); + // forcing login + // $auth->beforeMethod('GET','/'); self::assertFalse($aclPlugin->checkPrivileges('foo', ['{DAV:}read'], Plugin::R_PARENT, false)); } diff --git a/tests/Sabre/DAVACL/Xml/Property/PrincipalTest.php b/tests/Sabre/DAVACL/Xml/Property/PrincipalTest.php index e437204390..ec6a6640a2 100644 --- a/tests/Sabre/DAVACL/Xml/Property/PrincipalTest.php +++ b/tests/Sabre/DAVACL/Xml/Property/PrincipalTest.php @@ -134,6 +134,7 @@ public function parse($xml) /** * @depends testSimple + * * @dataProvider htmlProvider */ public function testToHtml($principal, $output)