diff options
Diffstat (limited to 'apps')
208 files changed, 639 insertions, 638 deletions
diff --git a/apps/comments/lib/AppInfo/Application.php b/apps/comments/lib/AppInfo/Application.php index 9168948d7c8..cc8bf297b91 100644 --- a/apps/comments/lib/AppInfo/Application.php +++ b/apps/comments/lib/AppInfo/Application.php @@ -42,7 +42,7 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\Util; class Application extends App { - const APP_ID = 'comments'; + public const APP_ID = 'comments'; public function __construct(array $urlParams = []) { parent::__construct(self::APP_ID, $urlParams); diff --git a/apps/contactsinteraction/lib/AddressBook.php b/apps/contactsinteraction/lib/AddressBook.php index ac433c7ce73..e8479cb186a 100644 --- a/apps/contactsinteraction/lib/AddressBook.php +++ b/apps/contactsinteraction/lib/AddressBook.php @@ -73,7 +73,7 @@ class AddressBook extends ExternalAddressBook implements IACL { /** * @inheritDoc */ - function createFile($name, $data = null) { + public function createFile($name, $data = null) { throw new Exception("This addressbook is immutable"); } diff --git a/apps/contactsinteraction/lib/Card.php b/apps/contactsinteraction/lib/Card.php index 56dca77b011..6285025f1eb 100644 --- a/apps/contactsinteraction/lib/Card.php +++ b/apps/contactsinteraction/lib/Card.php @@ -52,84 +52,84 @@ class Card implements ICard, IACL { /** * @inheritDoc */ - function getOwner(): ?string { + public function getOwner(): ?string { $this->principal; } /** * @inheritDoc */ - function getACL(): array { + public function getACL(): array { return $this->acls; } /** * @inheritDoc */ - function setAcls(array $acls): void { + public function setAcls(array $acls): void { throw new NotImplemented(); } /** * @inheritDoc */ - function put($data): ?string { + public function put($data): ?string { throw new NotImplemented(); } /** * @inheritDoc */ - function get() { + public function get() { return $this->contact->getCard(); } /** * @inheritDoc */ - function getContentType(): ?string { + public function getContentType(): ?string { return 'text/vcard; charset=utf-8'; } /** * @inheritDoc */ - function getETag(): ?string { + public function getETag(): ?string { return null; } /** * @inheritDoc */ - function getSize(): int { + public function getSize(): int { throw new NotImplemented(); } /** * @inheritDoc */ - function delete(): void { + public function delete(): void { throw new NotImplemented(); } /** * @inheritDoc */ - function getName(): string { + public function getName(): string { return (string) $this->contact->getId(); } /** * @inheritDoc */ - function setName($name): void { + public function setName($name): void { throw new NotImplemented(); } /** * @inheritDoc */ - function getLastModified(): ?int { + public function getLastModified(): ?int { return $this->contact->getLastContact(); } } diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php index 7a80c9b2152..29c77cad07f 100644 --- a/apps/dav/lib/AppInfo/Application.php +++ b/apps/dav/lib/AppInfo/Application.php @@ -53,7 +53,7 @@ use OCP\IUser; use Symfony\Component\EventDispatcher\GenericEvent; class Application extends App { - const APP_ID = 'dav'; + public const APP_ID = 'dav'; /** * Application constructor. diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php index 42b70f0a928..ee0d6144c92 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php @@ -36,15 +36,15 @@ use OCP\IUserManager; use OCP\L10N\IFactory; class Calendar extends Base { - const SUBJECT_ADD = 'calendar_add'; - const SUBJECT_UPDATE = 'calendar_update'; - const SUBJECT_DELETE = 'calendar_delete'; - const SUBJECT_PUBLISH = 'calendar_publish'; - const SUBJECT_UNPUBLISH = 'calendar_unpublish'; - const SUBJECT_SHARE_USER = 'calendar_user_share'; - const SUBJECT_SHARE_GROUP = 'calendar_group_share'; - const SUBJECT_UNSHARE_USER = 'calendar_user_unshare'; - const SUBJECT_UNSHARE_GROUP = 'calendar_group_unshare'; + public const SUBJECT_ADD = 'calendar_add'; + public const SUBJECT_UPDATE = 'calendar_update'; + public const SUBJECT_DELETE = 'calendar_delete'; + public const SUBJECT_PUBLISH = 'calendar_publish'; + public const SUBJECT_UNPUBLISH = 'calendar_unpublish'; + public const SUBJECT_SHARE_USER = 'calendar_user_share'; + public const SUBJECT_SHARE_GROUP = 'calendar_group_share'; + public const SUBJECT_UNSHARE_USER = 'calendar_user_unshare'; + public const SUBJECT_UNSHARE_GROUP = 'calendar_group_unshare'; /** @var IFactory */ protected $languageFactory; diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Event.php b/apps/dav/lib/CalDAV/Activity/Provider/Event.php index f044c2f8208..9ca0727fab7 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Event.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Event.php @@ -34,9 +34,9 @@ use OCP\IUserManager; use OCP\L10N\IFactory; class Event extends Base { - const SUBJECT_OBJECT_ADD = 'object_add'; - const SUBJECT_OBJECT_UPDATE = 'object_update'; - const SUBJECT_OBJECT_DELETE = 'object_delete'; + public const SUBJECT_OBJECT_ADD = 'object_add'; + public const SUBJECT_OBJECT_UPDATE = 'object_update'; + public const SUBJECT_OBJECT_DELETE = 'object_delete'; /** @var IFactory */ protected $languageFactory; diff --git a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php index a1ebd409f0e..1c77b8d4272 100644 --- a/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php +++ b/apps/dav/lib/CalDAV/BirthdayCalendar/EnablePlugin.php @@ -39,7 +39,7 @@ use Sabre\HTTP\ResponseInterface; * @package OCA\DAV\CalDAV\BirthdayCalendar */ class EnablePlugin extends ServerPlugin { - const NS_Nextcloud = 'http://nextcloud.com/ns'; + public const NS_Nextcloud = 'http://nextcloud.com/ns'; /** * @var IConfig diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index 2969e5f3ead..ab70d6ceb43 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -49,7 +49,7 @@ use Sabre\VObject\Reader; * @package OCA\DAV\CalDAV */ class BirthdayService { - const BIRTHDAY_CALENDAR_URI = 'contact_birthdays'; + public const BIRTHDAY_CALENDAR_URI = 'contact_birthdays'; /** @var GroupPrincipalBackend */ private $principalBackend; diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index dd3cb048483..ddfb0a641e5 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -77,14 +77,14 @@ use Symfony\Component\EventDispatcher\GenericEvent; * @package OCA\DAV\CalDAV */ class CalDavBackend extends AbstractBackend implements SyncSupport, SubscriptionSupport, SchedulingSupport { - const CALENDAR_TYPE_CALENDAR = 0; - const CALENDAR_TYPE_SUBSCRIPTION = 1; + public const CALENDAR_TYPE_CALENDAR = 0; + public const CALENDAR_TYPE_SUBSCRIPTION = 1; - const PERSONAL_CALENDAR_URI = 'personal'; - const PERSONAL_CALENDAR_NAME = 'Personal'; + public const PERSONAL_CALENDAR_URI = 'personal'; + public const PERSONAL_CALENDAR_NAME = 'Personal'; - const RESOURCE_BOOKING_CALENDAR_URI = 'calendar'; - const RESOURCE_BOOKING_CALENDAR_NAME = 'Calendar'; + public const RESOURCE_BOOKING_CALENDAR_URI = 'calendar'; + public const RESOURCE_BOOKING_CALENDAR_NAME = 'Calendar'; /** * We need to specify a max date, because we need to stop *somewhere* @@ -94,12 +94,12 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * 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'; - const ACCESS_PUBLIC = 4; - const CLASSIFICATION_PUBLIC = 0; - const CLASSIFICATION_PRIVATE = 1; - const CLASSIFICATION_CONFIDENTIAL = 2; + public const ACCESS_PUBLIC = 4; + public const CLASSIFICATION_PUBLIC = 0; + public const CLASSIFICATION_PRIVATE = 1; + public const CLASSIFICATION_CONFIDENTIAL = 2; /** * List of CalDAV properties, and how they map to database field names @@ -253,7 +253,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param string $principalUri * @return array */ - function getCalendarsForUser($principalUri) { + public function getCalendarsForUser($principalUri) { $principalUriOriginal = $principalUri; $principalUri = $this->convertPrincipal($principalUri, true); $fields = array_values($this->propertyMap); @@ -722,7 +722,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @return int * @suppress SqlInjectionChecker */ - function createCalendar($principalUri, $calendarUri, array $properties) { + public function createCalendar($principalUri, $calendarUri, array $properties) { $values = [ 'principaluri' => $this->convertPrincipal($principalUri, true), 'uri' => $calendarUri, @@ -790,7 +790,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param PropPatch $propPatch * @return void */ - function updateCalendar($calendarId, PropPatch $propPatch) { + public function updateCalendar($calendarId, PropPatch $propPatch) { $supportedProperties = array_keys($this->propertyMap); $supportedProperties[] = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp'; @@ -840,7 +840,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param mixed $calendarId * @return void */ - function deleteCalendar($calendarId) { + public function deleteCalendar($calendarId) { $this->dispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::deleteCalendar', new GenericEvent( '\OCA\DAV\CalDAV\CalDavBackend::deleteCalendar', [ @@ -873,7 +873,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param string $principaluri * @return void */ - function deleteAllSharesByUser($principaluri) { + public function deleteAllSharesByUser($principaluri) { $this->calendarSharingBackend->deleteAllSharesByUser($principaluri); } @@ -1048,7 +1048,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param int $calendarType * @return string */ - function createCalendarObject($calendarId, $objectUri, $calendarData, $calendarType=self::CALENDAR_TYPE_CALENDAR) { + public function createCalendarObject($calendarId, $objectUri, $calendarData, $calendarType=self::CALENDAR_TYPE_CALENDAR) { $extraData = $this->getDenormalizedData($calendarData); $q = $this->db->getQueryBuilder(); @@ -1131,7 +1131,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param int $calendarType * @return string */ - function updateCalendarObject($calendarId, $objectUri, $calendarData, $calendarType=self::CALENDAR_TYPE_CALENDAR) { + public function updateCalendarObject($calendarId, $objectUri, $calendarData, $calendarType=self::CALENDAR_TYPE_CALENDAR) { $extraData = $this->getDenormalizedData($calendarData); $query = $this->db->getQueryBuilder(); $query->update('calendarobjects') @@ -1207,7 +1207,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param int $calendarType * @return void */ - function deleteCalendarObject($calendarId, $objectUri, $calendarType=self::CALENDAR_TYPE_CALENDAR) { + public function deleteCalendarObject($calendarId, $objectUri, $calendarType=self::CALENDAR_TYPE_CALENDAR) { $data = $this->getCalendarObject($calendarId, $objectUri, $calendarType); if (is_array($data)) { if ($calendarType === self::CALENDAR_TYPE_CALENDAR) { @@ -1688,7 +1688,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param string $uid * @return string|null */ - function getCalendarObjectByUID($principalUri, $uid) { + public function getCalendarObjectByUID($principalUri, $uid) { $query = $this->db->getQueryBuilder(); $query->selectAlias('c.uri', 'calendaruri')->selectAlias('co.uri', 'objecturi') ->from('calendarobjects', 'co') @@ -1763,7 +1763,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param int $calendarType * @return array */ - function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null, $calendarType=self::CALENDAR_TYPE_CALENDAR) { + public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null, $calendarType=self::CALENDAR_TYPE_CALENDAR) { // Current synctoken $stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*calendars` WHERE `id` = ?'); $stmt->execute([ $calendarId ]); @@ -1854,7 +1854,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param string $principalUri * @return array */ - function getSubscriptionsForUser($principalUri) { + public function getSubscriptionsForUser($principalUri) { $fields = array_values($this->subscriptionPropertyMap); $fields[] = 'id'; $fields[] = 'uri'; @@ -1906,7 +1906,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param array $properties * @return mixed */ - function createSubscription($principalUri, $uri, array $properties) { + public function createSubscription($principalUri, $uri, array $properties) { if (!isset($properties['{http://calendarserver.org/ns/}source'])) { throw new Forbidden('The {http://calendarserver.org/ns/}source property is required when creating subscriptions'); } @@ -1969,7 +1969,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param PropPatch $propPatch * @return void */ - function updateSubscription($subscriptionId, PropPatch $propPatch) { + public function updateSubscription($subscriptionId, PropPatch $propPatch) { $supportedProperties = array_keys($this->subscriptionPropertyMap); $supportedProperties[] = '{http://calendarserver.org/ns/}source'; @@ -2015,7 +2015,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param mixed $subscriptionId * @return void */ - function deleteSubscription($subscriptionId) { + public function deleteSubscription($subscriptionId) { $this->dispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::deleteSubscription', new GenericEvent( '\OCA\DAV\CalDAV\CalDavBackend::deleteSubscription', [ @@ -2061,7 +2061,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param string $objectUri * @return array */ - function getSchedulingObject($principalUri, $objectUri) { + public function getSchedulingObject($principalUri, $objectUri) { $query = $this->db->getQueryBuilder(); $stmt = $query->select(['uri', 'calendardata', 'lastmodified', 'etag', 'size']) ->from('schedulingobjects') @@ -2095,7 +2095,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param string $principalUri * @return array */ - function getSchedulingObjects($principalUri) { + public function getSchedulingObjects($principalUri) { $query = $this->db->getQueryBuilder(); $stmt = $query->select(['uri', 'calendardata', 'lastmodified', 'etag', 'size']) ->from('schedulingobjects') @@ -2123,7 +2123,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param string $objectUri * @return void */ - function deleteSchedulingObject($principalUri, $objectUri) { + public function deleteSchedulingObject($principalUri, $objectUri) { $query = $this->db->getQueryBuilder(); $query->delete('schedulingobjects') ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))) @@ -2139,7 +2139,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param string $objectData * @return void */ - function createSchedulingObject($principalUri, $objectUri, $objectData) { + public function createSchedulingObject($principalUri, $objectUri, $objectData) { $query = $this->db->getQueryBuilder(); $query->insert('schedulingobjects') ->values([ diff --git a/apps/dav/lib/CalDAV/CalendarHome.php b/apps/dav/lib/CalDAV/CalendarHome.php index ce29ed12db6..adc016192ac 100644 --- a/apps/dav/lib/CalDAV/CalendarHome.php +++ b/apps/dav/lib/CalDAV/CalendarHome.php @@ -73,7 +73,7 @@ class CalendarHome extends \Sabre\CalDAV\CalendarHome { /** * @inheritdoc */ - function createExtendedCollection($name, MkCol $mkCol) { + public function createExtendedCollection($name, MkCol $mkCol) { $reservedNames = [BirthdayService::BIRTHDAY_CALENDAR_URI]; if (\in_array($name, $reservedNames, true) || ExternalCalendar::doesViolateReservedName($name)) { @@ -86,7 +86,7 @@ class CalendarHome extends \Sabre\CalDAV\CalendarHome { /** * @inheritdoc */ - function getChildren() { + public function getChildren() { $calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']); $objects = []; foreach ($calendars as $calendar) { @@ -128,7 +128,7 @@ class CalendarHome extends \Sabre\CalDAV\CalendarHome { /** * @inheritdoc */ - function getChild($name) { + public function getChild($name) { // Special nodes if ($name === 'inbox' && $this->caldavBackend instanceof SchedulingSupport) { return new Inbox($this->caldavBackend, $this->principalInfo['uri']); @@ -182,7 +182,7 @@ class CalendarHome extends \Sabre\CalDAV\CalendarHome { * @param integer|null $limit * @param integer|null $offset */ - function calendarSearch(array $filters, $limit=null, $offset=null) { + public function calendarSearch(array $filters, $limit=null, $offset=null) { $principalUri = $this->principalInfo['uri']; return $this->caldavBackend->calendarSearch($principalUri, $filters, $limit, $offset); } diff --git a/apps/dav/lib/CalDAV/CalendarObject.php b/apps/dav/lib/CalDAV/CalendarObject.php index 8bdde256628..df77a2b6498 100644 --- a/apps/dav/lib/CalDAV/CalendarObject.php +++ b/apps/dav/lib/CalDAV/CalendarObject.php @@ -59,7 +59,7 @@ class CalendarObject extends \Sabre\CalDAV\CalendarObject { /** * @inheritdoc */ - function get() { + public function get() { $data = parent::get(); if (!$this->isShared()) { diff --git a/apps/dav/lib/CalDAV/CalendarRoot.php b/apps/dav/lib/CalDAV/CalendarRoot.php index ace8482d9c7..4dd3e9986f0 100644 --- a/apps/dav/lib/CalDAV/CalendarRoot.php +++ b/apps/dav/lib/CalDAV/CalendarRoot.php @@ -26,11 +26,11 @@ namespace OCA\DAV\CalDAV; class CalendarRoot extends \Sabre\CalDAV\CalendarRoot { - function getChildForPrincipal(array $principal) { + public function getChildForPrincipal(array $principal) { return new CalendarHome($this->caldavBackend, $principal); } - function getName() { + public function getName() { if ($this->principalPrefix === 'principals/calendar-resources' || $this->principalPrefix === 'principals/calendar-rooms') { $parts = explode('/', $this->principalPrefix); diff --git a/apps/dav/lib/CalDAV/Outbox.php b/apps/dav/lib/CalDAV/Outbox.php index 87af86d06dd..468a6e54268 100644 --- a/apps/dav/lib/CalDAV/Outbox.php +++ b/apps/dav/lib/CalDAV/Outbox.php @@ -63,7 +63,7 @@ class Outbox extends \Sabre\CalDAV\Schedule\Outbox { * * @return array */ - function getACL() { + public function getACL() { // getACL is called so frequently that we cache the config result if ($this->disableFreeBusy === null) { $this->disableFreeBusy = ($this->config->getAppValue('dav', 'disableFreeBusy', 'no') === 'yes'); diff --git a/apps/dav/lib/CalDAV/Plugin.php b/apps/dav/lib/CalDAV/Plugin.php index 6d88244bbf1..4c865ba2ae7 100644 --- a/apps/dav/lib/CalDAV/Plugin.php +++ b/apps/dav/lib/CalDAV/Plugin.php @@ -25,7 +25,7 @@ namespace OCA\DAV\CalDAV; class Plugin extends \Sabre\CalDAV\Plugin { - const SYSTEM_CALENDAR_ROOT = 'system-calendars'; + public const SYSTEM_CALENDAR_ROOT = 'system-calendars'; /** * Returns the path to a principal's calendar home. @@ -37,7 +37,7 @@ class Plugin extends \Sabre\CalDAV\Plugin { * @param string $principalUrl * @return string|null */ - function getCalendarHomeForPrincipal($principalUrl) { + public function getCalendarHomeForPrincipal($principalUrl) { if (strrpos($principalUrl, 'principals/users', -strlen($principalUrl)) !== false) { list(, $principalId) = \Sabre\Uri\split($principalUrl); return self::CALENDAR_ROOT . '/' . $principalId; diff --git a/apps/dav/lib/CalDAV/Principal/Collection.php b/apps/dav/lib/CalDAV/Principal/Collection.php index 6e7e20223c8..23868172ddf 100644 --- a/apps/dav/lib/CalDAV/Principal/Collection.php +++ b/apps/dav/lib/CalDAV/Principal/Collection.php @@ -36,7 +36,7 @@ class Collection extends \Sabre\CalDAV\Principal\Collection { * @param array $principalInfo * @return User */ - function getChildForPrincipal(array $principalInfo) { + public function getChildForPrincipal(array $principalInfo) { return new User($this->principalBackend, $principalInfo); } } diff --git a/apps/dav/lib/CalDAV/Principal/User.php b/apps/dav/lib/CalDAV/Principal/User.php index f10773769ca..3507ca63829 100644 --- a/apps/dav/lib/CalDAV/Principal/User.php +++ b/apps/dav/lib/CalDAV/Principal/User.php @@ -42,7 +42,7 @@ class User extends \Sabre\CalDAV\Principal\User { * * @return array */ - function getACL() { + public function getACL() { $acl = parent::getACL(); $acl[] = [ 'privilege' => '{DAV:}read', diff --git a/apps/dav/lib/CalDAV/Proxy/ProxyMapper.php b/apps/dav/lib/CalDAV/Proxy/ProxyMapper.php index bc13efc1e5a..689a6f0efc8 100644 --- a/apps/dav/lib/CalDAV/Proxy/ProxyMapper.php +++ b/apps/dav/lib/CalDAV/Proxy/ProxyMapper.php @@ -36,8 +36,8 @@ use OCP\IDBConnection; * @package OCA\DAV\CalDAV\Proxy */ class ProxyMapper extends QBMapper { - const PERMISSION_READ = 1; - const PERMISSION_WRITE = 2; + public const PERMISSION_READ = 1; + public const PERMISSION_WRITE = 2; /** * ProxyMapper constructor. diff --git a/apps/dav/lib/CalDAV/PublicCalendarRoot.php b/apps/dav/lib/CalDAV/PublicCalendarRoot.php index a79fffa598a..3dd7cfcc7ca 100644 --- a/apps/dav/lib/CalDAV/PublicCalendarRoot.php +++ b/apps/dav/lib/CalDAV/PublicCalendarRoot.php @@ -48,7 +48,7 @@ class PublicCalendarRoot extends Collection { * @param IL10N $l10n * @param IConfig $config */ - function __construct(CalDavBackend $caldavBackend, IL10N $l10n, + public function __construct(CalDavBackend $caldavBackend, IL10N $l10n, IConfig $config) { $this->caldavBackend = $caldavBackend; $this->l10n = $l10n; @@ -58,14 +58,14 @@ class PublicCalendarRoot extends Collection { /** * @inheritdoc */ - function getName() { + public function getName() { return 'public-calendars'; } /** * @inheritdoc */ - function getChild($name) { + public function getChild($name) { $calendar = $this->caldavBackend->getPublicCalendar($name); return new PublicCalendar($this->caldavBackend, $calendar, $this->l10n, $this->config); } @@ -73,7 +73,7 @@ class PublicCalendarRoot extends Collection { /** * @inheritdoc */ - function getChildren() { + public function getChildren() { return []; } } diff --git a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php index 214fb79464e..e3561527ce0 100644 --- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php +++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php @@ -40,7 +40,7 @@ use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; class PublishPlugin extends ServerPlugin { - const NS_CALENDARSERVER = 'http://calendarserver.org/ns/'; + public const NS_CALENDARSERVER = 'http://calendarserver.org/ns/'; /** * Reference to SabreDAV server object. diff --git a/apps/dav/lib/CalDAV/Publishing/Xml/Publisher.php b/apps/dav/lib/CalDAV/Publishing/Xml/Publisher.php index 2a750c5a32b..4314e0dcdd1 100644 --- a/apps/dav/lib/CalDAV/Publishing/Xml/Publisher.php +++ b/apps/dav/lib/CalDAV/Publishing/Xml/Publisher.php @@ -43,7 +43,7 @@ class Publisher implements XmlSerializable { * @param string $publishUrl * @param boolean $isPublished */ - function __construct($publishUrl, $isPublished) { + public function __construct($publishUrl, $isPublished) { $this->publishUrl = $publishUrl; $this->isPublished = $isPublished; } @@ -51,7 +51,7 @@ class Publisher implements XmlSerializable { /** * @return string */ - function getValue() { + public function getValue() { return $this->publishUrl; } @@ -74,7 +74,7 @@ class Publisher implements XmlSerializable { * @param Writer $writer * @return void */ - function xmlSerialize(Writer $writer) { + public function xmlSerialize(Writer $writer) { if (!$this->isPublished) { // for pre-publish-url $writer->write($this->publishUrl); diff --git a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php index 2a28c9fc02c..a460c731387 100644 --- a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php +++ b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php @@ -229,7 +229,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { * @param PropPatch $propPatch * @return int */ - function updatePrincipal($path, PropPatch $propPatch) { + public function updatePrincipal($path, PropPatch $propPatch) { return 0; } @@ -239,7 +239,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { * @param string $test * @return array */ - function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') { + public function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') { $results = []; if (\count($searchProperties) === 0) { return []; @@ -370,7 +370,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface { * @param string $principalPrefix * @return null|string */ - function findByUri($uri, $principalPrefix) { + public function findByUri($uri, $principalPrefix) { $user = $this->userSession->getUser(); if (!$user) { return null; diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php index 15228f9bc3d..2bbc6498dba 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -102,11 +102,11 @@ class IMipPlugin extends SabreIMipPlugin { /** @var IUserManager */ private $userManager; - const MAX_DATE = '2038-01-01'; + public const MAX_DATE = '2038-01-01'; - const METHOD_REQUEST = 'request'; - const METHOD_REPLY = 'reply'; - const METHOD_CANCEL = 'cancel'; + public const METHOD_REQUEST = 'request'; + public const METHOD_REPLY = 'reply'; + public const METHOD_CANCEL = 'cancel'; /** * @param IConfig $config diff --git a/apps/dav/lib/CalDAV/Schedule/Plugin.php b/apps/dav/lib/CalDAV/Schedule/Plugin.php index 7ad4a3904ed..3b2f0374b46 100644 --- a/apps/dav/lib/CalDAV/Schedule/Plugin.php +++ b/apps/dav/lib/CalDAV/Schedule/Plugin.php @@ -62,7 +62,7 @@ class Plugin extends \Sabre\CalDAV\Schedule\Plugin { * @param Server $server * @return void */ - function initialize(Server $server) { + public function initialize(Server $server) { parent::initialize($server); $server->on('propFind', [$this, 'propFindDefaultCalendarUrl'], 90); $server->on('afterWriteContent', [$this, 'dispatchSchedulingResponses']); @@ -78,7 +78,7 @@ class Plugin extends \Sabre\CalDAV\Schedule\Plugin { * @param INode $node * @return void */ - function propFind(PropFind $propFind, INode $node) { + public function propFind(PropFind $propFind, INode $node) { if ($node instanceof IPrincipal) { // overwrite Sabre/Dav's implementation $propFind->handle('{' . self::NS_CALDAV . '}calendar-user-type', function () use ($node) { @@ -259,7 +259,7 @@ EOF; * @param INode $node * @return void */ - function propFindDefaultCalendarUrl(PropFind $propFind, INode $node) { + public function propFindDefaultCalendarUrl(PropFind $propFind, INode $node) { if ($node instanceof IPrincipal) { $propFind->handle('{' . self::NS_CALDAV . '}schedule-default-calendar-URL', function () use ($node) { /** @var \OCA\DAV\CalDAV\Plugin $caldavPlugin */ diff --git a/apps/dav/lib/CalDAV/Search/SearchPlugin.php b/apps/dav/lib/CalDAV/Search/SearchPlugin.php index dc3cbdf06ba..0776e8838b8 100644 --- a/apps/dav/lib/CalDAV/Search/SearchPlugin.php +++ b/apps/dav/lib/CalDAV/Search/SearchPlugin.php @@ -32,7 +32,7 @@ use Sabre\DAV\Server; use Sabre\DAV\ServerPlugin; class SearchPlugin extends ServerPlugin { - const NS_Nextcloud = 'http://nextcloud.com/ns'; + public const NS_Nextcloud = 'http://nextcloud.com/ns'; /** * Reference to SabreDAV server object. diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/CompFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/CompFilter.php index c1adb1a5b86..f9d05f09c68 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/CompFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/CompFilter.php @@ -36,7 +36,7 @@ class CompFilter implements XmlDeserializable { * @throws BadRequest * @return string */ - static function xmlDeserialize(Reader $reader) { + public static function xmlDeserialize(Reader $reader) { $att = $reader->parseAttributes(); $componentName = $att['name']; diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php index 765f3377feb..2dc0ee8b7a1 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php @@ -37,7 +37,7 @@ class LimitFilter implements XmlDeserializable { * @throws BadRequest * @return int */ - static function xmlDeserialize(Reader $reader) { + public static function xmlDeserialize(Reader $reader) { $value = $reader->parseInnerTree(); if (!is_int($value) && !is_string($value)) { throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}limit has illegal value'); diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php index ac282a0ca60..335ea0d7756 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php @@ -37,7 +37,7 @@ class OffsetFilter implements XmlDeserializable { * @throws BadRequest * @return int */ - static function xmlDeserialize(Reader $reader) { + public static function xmlDeserialize(Reader $reader) { $value = $reader->parseInnerTree(); if (!is_int($value) && !is_string($value)) { throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value'); diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php index 10b065fc426..51d55c98b13 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/ParamFilter.php @@ -36,7 +36,7 @@ class ParamFilter implements XmlDeserializable { * @throws BadRequest * @return string */ - static function xmlDeserialize(Reader $reader) { + public static function xmlDeserialize(Reader $reader) { $att = $reader->parseAttributes(); $property = $att['property']; $parameter = $att['name']; diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/PropFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/PropFilter.php index fb3bf139bbf..4a0455e47f8 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/PropFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/PropFilter.php @@ -36,7 +36,7 @@ class PropFilter implements XmlDeserializable { * @throws BadRequest * @return string */ - static function xmlDeserialize(Reader $reader) { + public static function xmlDeserialize(Reader $reader) { $att = $reader->parseAttributes(); $componentName = $att['name']; diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php index 71a4e85c21f..0b7bbcf3a22 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php @@ -36,7 +36,7 @@ class SearchTermFilter implements XmlDeserializable { * @throws BadRequest * @return string */ - static function xmlDeserialize(Reader $reader) { + public static function xmlDeserialize(Reader $reader) { $value = $reader->parseInnerTree(); if (!is_string($value)) { throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}search-term has illegal value'); diff --git a/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php b/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php index f63366e2e19..2b23da5a38c 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php @@ -84,7 +84,7 @@ class CalendarSearchReport implements XmlDeserializable { * @param Reader $reader * @return mixed */ - static function xmlDeserialize(Reader $reader) { + public static function xmlDeserialize(Reader $reader) { $elems = $reader->parseInnerTree([ '{http://nextcloud.com/ns}comp-filter' => 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter', '{http://nextcloud.com/ns}prop-filter' => 'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter', diff --git a/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php b/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php index 2cfeb1108f1..8cfbb38b6e0 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php @@ -43,7 +43,7 @@ class Plugin extends ServerPlugin { * * @var string[] */ - const ENABLE_FOR_CLIENTS = []; + public const ENABLE_FOR_CLIENTS = []; /** * @var bool diff --git a/apps/dav/lib/CardDAV/AddressBookRoot.php b/apps/dav/lib/CardDAV/AddressBookRoot.php index 771e44b7d32..57fc6b71010 100644 --- a/apps/dav/lib/CardDAV/AddressBookRoot.php +++ b/apps/dav/lib/CardDAV/AddressBookRoot.php @@ -56,11 +56,11 @@ class AddressBookRoot extends \Sabre\CardDAV\AddressBookRoot { * * @return \Sabre\DAV\INode */ - function getChildForPrincipal(array $principal) { + public function getChildForPrincipal(array $principal) { return new UserAddressBooks($this->carddavBackend, $principal['uri'], $this->pluginManager); } - function getName() { + public function getName() { if ($this->principalPrefix === 'principals') { return parent::getName(); } diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 47551c8f170..71b7e846f3d 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -55,8 +55,8 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; class CardDavBackend implements BackendInterface, SyncSupport { - const PERSONAL_ADDRESSBOOK_URI = 'contacts'; - const PERSONAL_ADDRESSBOOK_NAME = 'Contacts'; + public const PERSONAL_ADDRESSBOOK_URI = 'contacts'; + public const PERSONAL_ADDRESSBOOK_NAME = 'Contacts'; /** @var Principal */ private $principalBackend; @@ -143,7 +143,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param string $principalUri * @return array */ - function getAddressBooksForUser($principalUri) { + public function getAddressBooksForUser($principalUri) { $principalUriOriginal = $principalUri; $principalUri = $this->convertPrincipal($principalUri, true); $query = $this->db->getQueryBuilder(); @@ -353,7 +353,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param \Sabre\DAV\PropPatch $propPatch * @return void */ - function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatch) { + public function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatch) { $supportedProperties = [ '{DAV:}displayname', '{' . Plugin::NS_CARDDAV . '}addressbook-description', @@ -398,7 +398,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @return int * @throws BadRequest */ - function createAddressBook($principalUri, $url, array $properties) { + public function createAddressBook($principalUri, $url, array $properties) { $values = [ 'displayname' => null, 'description' => null, @@ -447,7 +447,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param mixed $addressBookId * @return void */ - function deleteAddressBook($addressBookId) { + public function deleteAddressBook($addressBookId) { $query = $this->db->getQueryBuilder(); $query->delete('cards') ->where($query->expr()->eq('addressbookid', $query->createParameter('addressbookid'))) @@ -490,7 +490,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param mixed $addressBookId * @return array */ - function getCards($addressBookId) { + public function getCards($addressBookId) { $query = $this->db->getQueryBuilder(); $query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid']) ->from('cards') @@ -521,7 +521,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param string $cardUri * @return array */ - function getCard($addressBookId, $cardUri) { + public function getCard($addressBookId, $cardUri) { $query = $this->db->getQueryBuilder(); $query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid']) ->from('cards') @@ -552,7 +552,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param string[] $uris * @return array */ - function getMultipleCards($addressBookId, array $uris) { + public function getMultipleCards($addressBookId, array $uris) { if (empty($uris)) { return []; } @@ -605,7 +605,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param string $cardData * @return string */ - function createCard($addressBookId, $cardUri, $cardData) { + public function createCard($addressBookId, $cardUri, $cardData) { $etag = md5($cardData); $uid = $this->getUID($cardData); @@ -672,7 +672,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param string $cardData * @return string */ - function updateCard($addressBookId, $cardUri, $cardData) { + public function updateCard($addressBookId, $cardUri, $cardData) { $uid = $this->getUID($cardData); $etag = md5($cardData); $query = $this->db->getQueryBuilder(); @@ -705,7 +705,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param string $cardUri * @return bool */ - function deleteCard($addressBookId, $cardUri) { + public function deleteCard($addressBookId, $cardUri) { try { $cardId = $this->getCardId($addressBookId, $cardUri); } catch (\InvalidArgumentException $e) { @@ -790,7 +790,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param int $limit * @return array */ - function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) { + public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) { // Current synctoken $stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*addressbooks` WHERE `id` = ?'); $stmt->execute([ $addressBookId ]); diff --git a/apps/dav/lib/CardDAV/HasPhotoPlugin.php b/apps/dav/lib/CardDAV/HasPhotoPlugin.php index 3cf9e0f9a61..bb847e74a37 100644 --- a/apps/dav/lib/CardDAV/HasPhotoPlugin.php +++ b/apps/dav/lib/CardDAV/HasPhotoPlugin.php @@ -45,7 +45,7 @@ class HasPhotoPlugin extends ServerPlugin { * @param Server $server * @return void */ - function initialize(Server $server) { + public function initialize(Server $server) { $server->on('propFind', [$this, 'propFind']); } @@ -56,7 +56,7 @@ class HasPhotoPlugin extends ServerPlugin { * @param INode $node * @return void */ - function propFind(PropFind $propFind, INode $node) { + public function propFind(PropFind $propFind, INode $node) { $ns = '{http://nextcloud.com/ns}'; if ($node instanceof Card) { diff --git a/apps/dav/lib/CardDAV/Plugin.php b/apps/dav/lib/CardDAV/Plugin.php index 430fda4578d..1a89bf58f9b 100644 --- a/apps/dav/lib/CardDAV/Plugin.php +++ b/apps/dav/lib/CardDAV/Plugin.php @@ -30,7 +30,7 @@ use Sabre\DAV\PropFind; use Sabre\DAV\Server; class Plugin extends \Sabre\CardDAV\Plugin { - function initialize(Server $server) { + public function initialize(Server $server) { $server->on('propFind', [$this, 'propFind']); parent::initialize($server); } @@ -63,7 +63,7 @@ class Plugin extends \Sabre\CardDAV\Plugin { * @param INode $node * @return void */ - function propFind(PropFind $propFind, INode $node) { + public function propFind(PropFind $propFind, INode $node) { $ns = '{http://owncloud.org/ns}'; if ($node instanceof AddressBook) { diff --git a/apps/dav/lib/CardDAV/UserAddressBooks.php b/apps/dav/lib/CardDAV/UserAddressBooks.php index 18fc286fdd9..ce03ce43548 100644 --- a/apps/dav/lib/CardDAV/UserAddressBooks.php +++ b/apps/dav/lib/CardDAV/UserAddressBooks.php @@ -62,7 +62,7 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome { * * @return IAddressBook[] */ - function getChildren() { + public function getChildren() { if ($this->l10n === null) { $this->l10n = \OC::$server->getL10N('dav'); } @@ -107,7 +107,7 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome { * * @return array */ - function getACL() { + public function getACL() { $acl = parent::getACL(); if ($this->principalUri === 'principals/system/system') { $acl[] = [ diff --git a/apps/dav/lib/CardDAV/Xml/Groups.php b/apps/dav/lib/CardDAV/Xml/Groups.php index 0e001835c38..ea195ca3e21 100644 --- a/apps/dav/lib/CardDAV/Xml/Groups.php +++ b/apps/dav/lib/CardDAV/Xml/Groups.php @@ -27,7 +27,7 @@ use Sabre\Xml\Writer; use Sabre\Xml\XmlSerializable; class Groups implements XmlSerializable { - const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; /** @var string[] of TYPE:CHECKSUM */ private $groups; @@ -39,7 +39,7 @@ class Groups implements XmlSerializable { $this->groups = $groups; } - function xmlSerialize(Writer $writer) { + public function xmlSerialize(Writer $writer) { foreach ($this->groups as $group) { $writer->writeElement('{' . self::NS_OWNCLOUD . '}group', $group); } diff --git a/apps/dav/lib/Command/CreateAddressBook.php b/apps/dav/lib/Command/CreateAddressBook.php index 5756c4b37b5..ac91e727953 100644 --- a/apps/dav/lib/Command/CreateAddressBook.php +++ b/apps/dav/lib/Command/CreateAddressBook.php @@ -43,7 +43,7 @@ class CreateAddressBook extends Command { * @param IUserManager $userManager * @param CardDavBackend $cardDavBackend */ - function __construct(IUserManager $userManager, + public function __construct(IUserManager $userManager, CardDavBackend $cardDavBackend ) { parent::__construct(); diff --git a/apps/dav/lib/Command/CreateCalendar.php b/apps/dav/lib/Command/CreateCalendar.php index d2e19ef99d9..d7597b8b1f6 100644 --- a/apps/dav/lib/Command/CreateCalendar.php +++ b/apps/dav/lib/Command/CreateCalendar.php @@ -53,7 +53,7 @@ class CreateCalendar extends Command { * @param IGroupManager $groupManager * @param IDBConnection $dbConnection */ - function __construct(IUserManager $userManager, IGroupManager $groupManager, IDBConnection $dbConnection) { + public function __construct(IUserManager $userManager, IGroupManager $groupManager, IDBConnection $dbConnection) { parent::__construct(); $this->userManager = $userManager; $this->groupManager = $groupManager; diff --git a/apps/dav/lib/Command/ListCalendars.php b/apps/dav/lib/Command/ListCalendars.php index e63fbd2066e..8687207ef31 100644 --- a/apps/dav/lib/Command/ListCalendars.php +++ b/apps/dav/lib/Command/ListCalendars.php @@ -46,7 +46,7 @@ class ListCalendars extends Command { * @param IUserManager $userManager * @param CalDavBackend $caldav */ - function __construct(IUserManager $userManager, CalDavBackend $caldav) { + public function __construct(IUserManager $userManager, CalDavBackend $caldav) { parent::__construct(); $this->userManager = $userManager; $this->caldav = $caldav; diff --git a/apps/dav/lib/Command/MoveCalendar.php b/apps/dav/lib/Command/MoveCalendar.php index 845e8970698..10fa69b70ca 100644 --- a/apps/dav/lib/Command/MoveCalendar.php +++ b/apps/dav/lib/Command/MoveCalendar.php @@ -62,7 +62,7 @@ class MoveCalendar extends Command { /** @var CalDavBackend */ private $calDav; - const URI_USERS = 'principals/users/'; + public const URI_USERS = 'principals/users/'; /** * @param IUserManager $userManager @@ -72,7 +72,7 @@ class MoveCalendar extends Command { * @param IL10N $l10n * @param CalDavBackend $calDav */ - function __construct( + public function __construct( IUserManager $userManager, IGroupManager $groupManager, IShareManager $shareManager, diff --git a/apps/dav/lib/Command/SyncBirthdayCalendar.php b/apps/dav/lib/Command/SyncBirthdayCalendar.php index 211df745e41..14e77e08d73 100644 --- a/apps/dav/lib/Command/SyncBirthdayCalendar.php +++ b/apps/dav/lib/Command/SyncBirthdayCalendar.php @@ -52,7 +52,7 @@ class SyncBirthdayCalendar extends Command { * @param IConfig $config * @param BirthdayService $birthdayService */ - function __construct(IUserManager $userManager, IConfig $config, + public function __construct(IUserManager $userManager, IConfig $config, BirthdayService $birthdayService) { parent::__construct(); $this->birthdayService = $birthdayService; diff --git a/apps/dav/lib/Command/SyncSystemAddressBook.php b/apps/dav/lib/Command/SyncSystemAddressBook.php index f707e733add..1f139de236a 100644 --- a/apps/dav/lib/Command/SyncSystemAddressBook.php +++ b/apps/dav/lib/Command/SyncSystemAddressBook.php @@ -37,7 +37,7 @@ class SyncSystemAddressBook extends Command { /** * @param SyncService $syncService */ - function __construct(SyncService $syncService) { + public function __construct(SyncService $syncService) { parent::__construct(); $this->syncService = $syncService; } diff --git a/apps/dav/lib/Comments/CommentNode.php b/apps/dav/lib/Comments/CommentNode.php index e02eef1cd51..03bc432ccb9 100644 --- a/apps/dav/lib/Comments/CommentNode.php +++ b/apps/dav/lib/Comments/CommentNode.php @@ -35,16 +35,16 @@ use Sabre\DAV\Exception\MethodNotAllowed; use Sabre\DAV\PropPatch; class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { - const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; - const PROPERTY_NAME_UNREAD = '{http://owncloud.org/ns}isUnread'; - const PROPERTY_NAME_MESSAGE = '{http://owncloud.org/ns}message'; - const PROPERTY_NAME_ACTOR_DISPLAYNAME = '{http://owncloud.org/ns}actorDisplayName'; - const PROPERTY_NAME_MENTIONS = '{http://owncloud.org/ns}mentions'; - const PROPERTY_NAME_MENTION = '{http://owncloud.org/ns}mention'; - const PROPERTY_NAME_MENTION_TYPE = '{http://owncloud.org/ns}mentionType'; - const PROPERTY_NAME_MENTION_ID = '{http://owncloud.org/ns}mentionId'; - const PROPERTY_NAME_MENTION_DISPLAYNAME = '{http://owncloud.org/ns}mentionDisplayName'; + public const PROPERTY_NAME_UNREAD = '{http://owncloud.org/ns}isUnread'; + public const PROPERTY_NAME_MESSAGE = '{http://owncloud.org/ns}message'; + public const PROPERTY_NAME_ACTOR_DISPLAYNAME = '{http://owncloud.org/ns}actorDisplayName'; + public const PROPERTY_NAME_MENTIONS = '{http://owncloud.org/ns}mentions'; + public const PROPERTY_NAME_MENTION = '{http://owncloud.org/ns}mention'; + public const PROPERTY_NAME_MENTION_TYPE = '{http://owncloud.org/ns}mentionType'; + public const PROPERTY_NAME_MENTION_ID = '{http://owncloud.org/ns}mentionId'; + public const PROPERTY_NAME_MENTION_DISPLAYNAME = '{http://owncloud.org/ns}mentionDisplayName'; /** @var IComment */ public $comment; @@ -104,7 +104,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { * * @return array */ - static public function getPropertyNames() { + public static function getPropertyNames() { return [ '{http://owncloud.org/ns}id', '{http://owncloud.org/ns}parentId', @@ -144,7 +144,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { * * @return void */ - function delete() { + public function delete() { $this->checkWriteAccessOnComment(); $this->commentsManager->delete($this->comment->getId()); } @@ -156,7 +156,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { * * @return string */ - function getName() { + public function getName() { return $this->comment->getId(); } @@ -166,7 +166,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { * @param string $name The new name * @throws MethodNotAllowed */ - function setName($name) { + public function setName($name) { throw new MethodNotAllowed(); } @@ -175,7 +175,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { * * @return int */ - function getLastModified() { + public function getLastModified() { return null; } @@ -215,7 +215,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { * @param PropPatch $propPatch * @return void */ - function propPatch(PropPatch $propPatch) { + public function propPatch(PropPatch $propPatch) { // other properties than 'message' are read only $propPatch->handle(self::PROPERTY_NAME_MESSAGE, [$this, 'updateComment']); } @@ -235,7 +235,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { * @param array $properties * @return array */ - function getProperties($properties) { + public function getProperties($properties) { $properties = array_keys($this->properties); $result = []; diff --git a/apps/dav/lib/Comments/CommentsPlugin.php b/apps/dav/lib/Comments/CommentsPlugin.php index ebdf3fde318..8c73f6695b9 100644 --- a/apps/dav/lib/Comments/CommentsPlugin.php +++ b/apps/dav/lib/Comments/CommentsPlugin.php @@ -45,12 +45,12 @@ use Sabre\Xml\Writer; */ class CommentsPlugin extends ServerPlugin { // namespace - const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; - const REPORT_NAME = '{http://owncloud.org/ns}filter-comments'; - const REPORT_PARAM_LIMIT = '{http://owncloud.org/ns}limit'; - const REPORT_PARAM_OFFSET = '{http://owncloud.org/ns}offset'; - const REPORT_PARAM_TIMESTAMP = '{http://owncloud.org/ns}datetime'; + public const REPORT_NAME = '{http://owncloud.org/ns}filter-comments'; + public const REPORT_PARAM_LIMIT = '{http://owncloud.org/ns}limit'; + public const REPORT_PARAM_OFFSET = '{http://owncloud.org/ns}offset'; + public const REPORT_PARAM_TIMESTAMP = '{http://owncloud.org/ns}datetime'; /** @var ICommentsManager */ protected $commentsManager; @@ -83,7 +83,7 @@ class CommentsPlugin extends ServerPlugin { * @param Server $server * @return void */ - function initialize(Server $server) { + public function initialize(Server $server) { $this->server = $server; if (strpos($this->server->getRequestUri(), 'comments/') !== 0) { return; diff --git a/apps/dav/lib/Comments/EntityCollection.php b/apps/dav/lib/Comments/EntityCollection.php index 94ee3d2a250..683cbd62529 100644 --- a/apps/dav/lib/Comments/EntityCollection.php +++ b/apps/dav/lib/Comments/EntityCollection.php @@ -41,7 +41,7 @@ use Sabre\DAV\PropPatch; * @package OCA\DAV\Comments */ class EntityCollection extends RootCollection implements IProperties { - const PROPERTY_NAME_READ_MARKER = '{http://owncloud.org/ns}readMarker'; + public const PROPERTY_NAME_READ_MARKER = '{http://owncloud.org/ns}readMarker'; /** @var string */ protected $id; @@ -98,7 +98,7 @@ class EntityCollection extends RootCollection implements IProperties { * @return \Sabre\DAV\INode * @throws NotFound */ - function getChild($name) { + public function getChild($name) { try { $comment = $this->commentsManager->get($name); return new CommentNode( @@ -118,7 +118,7 @@ class EntityCollection extends RootCollection implements IProperties { * * @return \Sabre\DAV\INode[] */ - function getChildren() { + public function getChildren() { return $this->findChildren(); } @@ -131,7 +131,7 @@ class EntityCollection extends RootCollection implements IProperties { * @param \DateTime|null $datetime * @return CommentNode[] */ - function findChildren($limit = 0, $offset = 0, \DateTime $datetime = null) { + public function findChildren($limit = 0, $offset = 0, \DateTime $datetime = null) { $comments = $this->commentsManager->getForObject($this->name, $this->id, $limit, $offset, $datetime); $result = []; foreach ($comments as $comment) { @@ -152,7 +152,7 @@ class EntityCollection extends RootCollection implements IProperties { * @param string $name * @return bool */ - function childExists($name) { + public function childExists($name) { try { $this->commentsManager->get($name); return true; @@ -177,14 +177,14 @@ class EntityCollection extends RootCollection implements IProperties { /** * @inheritdoc */ - function propPatch(PropPatch $propPatch) { + public function propPatch(PropPatch $propPatch) { $propPatch->handle(self::PROPERTY_NAME_READ_MARKER, [$this, 'setReadMarker']); } /** * @inheritdoc */ - function getProperties($properties) { + public function getProperties($properties) { $marker = null; $user = $this->userSession->getUser(); if (!is_null($user)) { diff --git a/apps/dav/lib/Comments/EntityTypeCollection.php b/apps/dav/lib/Comments/EntityTypeCollection.php index 275b41c87e0..59f7cf4748d 100644 --- a/apps/dav/lib/Comments/EntityTypeCollection.php +++ b/apps/dav/lib/Comments/EntityTypeCollection.php @@ -90,7 +90,7 @@ class EntityTypeCollection extends RootCollection { * @return \Sabre\DAV\INode * @throws NotFound */ - function getChild($name) { + public function getChild($name) { if (!$this->childExists($name)) { throw new NotFound('Entity does not exist or is not available'); } @@ -110,7 +110,7 @@ class EntityTypeCollection extends RootCollection { * @return \Sabre\DAV\INode[] * @throws MethodNotAllowed */ - function getChildren() { + public function getChildren() { throw new MethodNotAllowed('No permission to list folder contents'); } @@ -120,7 +120,7 @@ class EntityTypeCollection extends RootCollection { * @param string $name * @return bool */ - function childExists($name) { + public function childExists($name) { return call_user_func($this->childExistsFunction, $name); } } diff --git a/apps/dav/lib/Comments/RootCollection.php b/apps/dav/lib/Comments/RootCollection.php index b6703a13a11..560d0105de9 100644 --- a/apps/dav/lib/Comments/RootCollection.php +++ b/apps/dav/lib/Comments/RootCollection.php @@ -118,7 +118,7 @@ class RootCollection implements ICollection { * @return null|string * @throws Forbidden */ - function createFile($name, $data = null) { + public function createFile($name, $data = null) { throw new Forbidden('Cannot create comments by id'); } @@ -128,7 +128,7 @@ class RootCollection implements ICollection { * @param string $name * @throws Forbidden */ - function createDirectory($name) { + public function createDirectory($name) { throw new Forbidden('Permission denied to create collections'); } @@ -142,7 +142,7 @@ class RootCollection implements ICollection { * @return \Sabre\DAV\INode * @throws NotFound */ - function getChild($name) { + public function getChild($name) { $this->initCollections(); if (isset($this->entityTypeCollections[$name])) { return $this->entityTypeCollections[$name]; @@ -155,7 +155,7 @@ class RootCollection implements ICollection { * * @return \Sabre\DAV\INode[] */ - function getChildren() { + public function getChildren() { $this->initCollections(); return $this->entityTypeCollections; } @@ -166,7 +166,7 @@ class RootCollection implements ICollection { * @param string $name * @return bool */ - function childExists($name) { + public function childExists($name) { $this->initCollections(); return isset($this->entityTypeCollections[$name]); } @@ -176,7 +176,7 @@ class RootCollection implements ICollection { * * @throws Forbidden */ - function delete() { + public function delete() { throw new Forbidden('Permission denied to delete this collection'); } @@ -187,7 +187,7 @@ class RootCollection implements ICollection { * * @return string */ - function getName() { + public function getName() { return $this->name; } @@ -197,7 +197,7 @@ class RootCollection implements ICollection { * @param string $name The new name * @throws Forbidden */ - function setName($name) { + public function setName($name) { throw new Forbidden('Permission denied to rename this collection'); } @@ -206,7 +206,7 @@ class RootCollection implements ICollection { * * @return int */ - function getLastModified() { + public function getLastModified() { return null; } } diff --git a/apps/dav/lib/Connector/Sabre/Auth.php b/apps/dav/lib/Connector/Sabre/Auth.php index 8457670be6b..ad042cd96ce 100644 --- a/apps/dav/lib/Connector/Sabre/Auth.php +++ b/apps/dav/lib/Connector/Sabre/Auth.php @@ -50,7 +50,7 @@ use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; class Auth extends AbstractBasic { - const DAV_AUTHENTICATED = 'AUTHENTICATED_TO_DAV_BACKEND'; + public const DAV_AUTHENTICATED = 'AUTHENTICATED_TO_DAV_BACKEND'; /** @var ISession */ private $session; @@ -151,7 +151,7 @@ class Auth extends AbstractBasic { * @throws NotAuthenticated * @throws ServiceUnavailable */ - function check(RequestInterface $request, ResponseInterface $response) { + public function check(RequestInterface $request, ResponseInterface $response) { try { return $this->auth($request, $response); } catch (NotAuthenticated $e) { diff --git a/apps/dav/lib/Connector/Sabre/ChecksumList.php b/apps/dav/lib/Connector/Sabre/ChecksumList.php index f5c0a3d9b01..d0b83cff1fa 100644 --- a/apps/dav/lib/Connector/Sabre/ChecksumList.php +++ b/apps/dav/lib/Connector/Sabre/ChecksumList.php @@ -32,7 +32,7 @@ use Sabre\Xml\XmlSerializable; * checksum name. */ class ChecksumList implements XmlSerializable { - const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; /** @var string[] of TYPE:CHECKSUM */ private $checksums; @@ -63,7 +63,7 @@ class ChecksumList implements XmlSerializable { * @param Writer $writer * @return void */ - function xmlSerialize(Writer $writer) { + public function xmlSerialize(Writer $writer) { foreach ($this->checksums as $checksum) { $writer->writeElement('{' . self::NS_OWNCLOUD . '}checksum', $checksum); } diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php index 31ea282308e..22e418ee561 100644 --- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php @@ -32,9 +32,9 @@ use Sabre\DAV\PropFind; use Sabre\DAV\ServerPlugin; class CommentPropertiesPlugin extends ServerPlugin { - const PROPERTY_NAME_HREF = '{http://owncloud.org/ns}comments-href'; - const PROPERTY_NAME_COUNT = '{http://owncloud.org/ns}comments-count'; - const PROPERTY_NAME_UNREAD = '{http://owncloud.org/ns}comments-unread'; + public const PROPERTY_NAME_HREF = '{http://owncloud.org/ns}comments-href'; + public const PROPERTY_NAME_COUNT = '{http://owncloud.org/ns}comments-count'; + public const PROPERTY_NAME_UNREAD = '{http://owncloud.org/ns}comments-unread'; /** @var \Sabre\DAV\Server */ protected $server; @@ -65,7 +65,7 @@ class CommentPropertiesPlugin extends ServerPlugin { * @param \Sabre\DAV\Server $server * @return void */ - function initialize(\Sabre\DAV\Server $server) { + public function initialize(\Sabre\DAV\Server $server) { $this->server = $server; $this->server->on('propFind', [$this, 'handleGetProperties']); } diff --git a/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php b/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php index 6462359aaff..5c1951cf7d8 100644 --- a/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CopyEtagHeaderPlugin.php @@ -72,7 +72,7 @@ class CopyEtagHeaderPlugin extends \Sabre\DAV\ServerPlugin { * @param string $destination * @return void */ - function afterMove($source, $destination) { + public function afterMove($source, $destination) { $node = $this->server->tree->getNodeForPath($destination); if ($node instanceof File) { $eTag = $node->getETag(); diff --git a/apps/dav/lib/Connector/Sabre/DavAclPlugin.php b/apps/dav/lib/Connector/Sabre/DavAclPlugin.php index 67be788eb04..f0dc8619ace 100644 --- a/apps/dav/lib/Connector/Sabre/DavAclPlugin.php +++ b/apps/dav/lib/Connector/Sabre/DavAclPlugin.php @@ -48,7 +48,7 @@ class DavAclPlugin extends \Sabre\DAVACL\Plugin { $this->allowUnauthenticatedAccess = false; } - function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) { + public function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) { $access = parent::checkPrivileges($uri, $privileges, $recursion, false); if ($access === false && $throwExceptions) { /** @var INode $node */ @@ -90,7 +90,7 @@ class DavAclPlugin extends \Sabre\DAVACL\Plugin { return parent::propFind($propFind, $node); } - function beforeMethod(RequestInterface $request, ResponseInterface $response) { + public function beforeMethod(RequestInterface $request, ResponseInterface $response) { $path = $request->getPath(); // prevent the plugin from causing an unneeded overhead for file requests diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index 0e4ddd1f232..a7c319b4eee 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -50,8 +50,7 @@ use Sabre\DAV\Exception\ServiceUnavailable; use Sabre\DAV\IFile; use Sabre\DAV\INode; -class Directory extends \OCA\DAV\Connector\Sabre\Node - implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuota, \Sabre\DAV\IMoveTarget { +class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuota, \Sabre\DAV\IMoveTarget { /** * Cached directory content diff --git a/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php b/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php index 9c68b065dbb..71098aac1d0 100644 --- a/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php +++ b/apps/dav/lib/Connector/Sabre/DummyGetResponsePlugin.php @@ -50,7 +50,7 @@ class DummyGetResponsePlugin extends \Sabre\DAV\ServerPlugin { * @param \Sabre\DAV\Server $server * @return void */ - function initialize(\Sabre\DAV\Server $server) { + public function initialize(\Sabre\DAV\Server $server) { $this->server = $server; $this->server->on('method:GET', [$this, 'httpGet'], 200); } @@ -60,7 +60,7 @@ class DummyGetResponsePlugin extends \Sabre\DAV\ServerPlugin { * @param ResponseInterface $response * @return false */ - function httpGet(RequestInterface $request, ResponseInterface $response) { + public function httpGet(RequestInterface $request, ResponseInterface $response) { $string = 'This is the WebDAV interface. It can only be accessed by ' . 'WebDAV clients such as the Nextcloud desktop sync client.'; $stream = fopen('php://memory','r+'); diff --git a/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php b/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php index 46659737e87..a9c07a0369c 100644 --- a/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php +++ b/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php @@ -23,7 +23,7 @@ namespace OCA\DAV\Connector\Sabre\Exception; class Forbidden extends \Sabre\DAV\Exception\Forbidden { - const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; /** * @var bool diff --git a/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php b/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php index 2871fd83e09..25fa3205b5c 100644 --- a/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php +++ b/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php @@ -26,7 +26,7 @@ namespace OCA\DAV\Connector\Sabre\Exception; use Sabre\DAV\Exception; class InvalidPath extends Exception { - const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; /** * @var bool diff --git a/apps/dav/lib/Connector/Sabre/Exception/PasswordLoginForbidden.php b/apps/dav/lib/Connector/Sabre/Exception/PasswordLoginForbidden.php index c3e417b20ad..aac9b735839 100644 --- a/apps/dav/lib/Connector/Sabre/Exception/PasswordLoginForbidden.php +++ b/apps/dav/lib/Connector/Sabre/Exception/PasswordLoginForbidden.php @@ -29,7 +29,7 @@ use Sabre\DAV\Exception\NotAuthenticated; use Sabre\DAV\Server; class PasswordLoginForbidden extends NotAuthenticated { - const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; public function getHTTPCode() { return 401; diff --git a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php index bca15e15688..1ab4f3d385a 100644 --- a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php @@ -77,7 +77,7 @@ class FakeLockerPlugin extends ServerPlugin { * * @return integer[] */ - function getFeatures() { + public function getFeatures() { return [2]; } @@ -88,7 +88,7 @@ class FakeLockerPlugin extends ServerPlugin { * @param INode $node * @return void */ - function propFind(PropFind $propFind, INode $node) { + public function propFind(PropFind $propFind, INode $node) { $propFind->handle('{DAV:}supportedlock', function () { return new SupportedLock(true); }); diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 5f2bbdd12e3..076e5b6483b 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -54,28 +54,28 @@ use Sabre\HTTP\ResponseInterface; class FilesPlugin extends ServerPlugin { // namespace - const NS_OWNCLOUD = 'http://owncloud.org/ns'; - const NS_NEXTCLOUD = 'http://nextcloud.org/ns'; - const FILEID_PROPERTYNAME = '{http://owncloud.org/ns}id'; - const INTERNAL_FILEID_PROPERTYNAME = '{http://owncloud.org/ns}fileid'; - const PERMISSIONS_PROPERTYNAME = '{http://owncloud.org/ns}permissions'; - const SHARE_PERMISSIONS_PROPERTYNAME = '{http://open-collaboration-services.org/ns}share-permissions'; - const OCM_SHARE_PERMISSIONS_PROPERTYNAME = '{http://open-cloud-mesh.org/ns}share-permissions'; - const DOWNLOADURL_PROPERTYNAME = '{http://owncloud.org/ns}downloadURL'; - const SIZE_PROPERTYNAME = '{http://owncloud.org/ns}size'; - const GETETAG_PROPERTYNAME = '{DAV:}getetag'; - const LASTMODIFIED_PROPERTYNAME = '{DAV:}lastmodified'; - const OWNER_ID_PROPERTYNAME = '{http://owncloud.org/ns}owner-id'; - const OWNER_DISPLAY_NAME_PROPERTYNAME = '{http://owncloud.org/ns}owner-display-name'; - const CHECKSUMS_PROPERTYNAME = '{http://owncloud.org/ns}checksums'; - const DATA_FINGERPRINT_PROPERTYNAME = '{http://owncloud.org/ns}data-fingerprint'; - const HAS_PREVIEW_PROPERTYNAME = '{http://nextcloud.org/ns}has-preview'; - const MOUNT_TYPE_PROPERTYNAME = '{http://nextcloud.org/ns}mount-type'; - const IS_ENCRYPTED_PROPERTYNAME = '{http://nextcloud.org/ns}is-encrypted'; - const METADATA_ETAG_PROPERTYNAME = '{http://nextcloud.org/ns}metadata_etag'; - const UPLOAD_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}upload_time'; - const CREATION_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}creation_time'; - const SHARE_NOTE = '{http://nextcloud.org/ns}note'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_NEXTCLOUD = 'http://nextcloud.org/ns'; + public const FILEID_PROPERTYNAME = '{http://owncloud.org/ns}id'; + public const INTERNAL_FILEID_PROPERTYNAME = '{http://owncloud.org/ns}fileid'; + public const PERMISSIONS_PROPERTYNAME = '{http://owncloud.org/ns}permissions'; + public const SHARE_PERMISSIONS_PROPERTYNAME = '{http://open-collaboration-services.org/ns}share-permissions'; + public const OCM_SHARE_PERMISSIONS_PROPERTYNAME = '{http://open-cloud-mesh.org/ns}share-permissions'; + public const DOWNLOADURL_PROPERTYNAME = '{http://owncloud.org/ns}downloadURL'; + public const SIZE_PROPERTYNAME = '{http://owncloud.org/ns}size'; + public const GETETAG_PROPERTYNAME = '{DAV:}getetag'; + public const LASTMODIFIED_PROPERTYNAME = '{DAV:}lastmodified'; + public const OWNER_ID_PROPERTYNAME = '{http://owncloud.org/ns}owner-id'; + public const OWNER_DISPLAY_NAME_PROPERTYNAME = '{http://owncloud.org/ns}owner-display-name'; + public const CHECKSUMS_PROPERTYNAME = '{http://owncloud.org/ns}checksums'; + public const DATA_FINGERPRINT_PROPERTYNAME = '{http://owncloud.org/ns}data-fingerprint'; + public const HAS_PREVIEW_PROPERTYNAME = '{http://nextcloud.org/ns}has-preview'; + public const MOUNT_TYPE_PROPERTYNAME = '{http://nextcloud.org/ns}mount-type'; + public const IS_ENCRYPTED_PROPERTYNAME = '{http://nextcloud.org/ns}is-encrypted'; + public const METADATA_ETAG_PROPERTYNAME = '{http://nextcloud.org/ns}metadata_etag'; + public const UPLOAD_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}upload_time'; + public const CREATION_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}creation_time'; + public const SHARE_NOTE = '{http://nextcloud.org/ns}note'; /** * Reference to main server object @@ -197,7 +197,7 @@ class FilesPlugin extends ServerPlugin { * @throws Forbidden * @throws NotFound */ - function checkMove($source, $destination) { + public function checkMove($source, $destination) { $sourceNode = $this->tree->getNodeForPath($source); if (!$sourceNode instanceof Node) { return; @@ -225,7 +225,7 @@ class FilesPlugin extends ServerPlugin { * @param RequestInterface $request * @param ResponseInterface $response */ - function handleDownloadToken(RequestInterface $request, ResponseInterface $response) { + public function handleDownloadToken(RequestInterface $request, ResponseInterface $response) { $queryParams = $request->getQueryParameters(); /** @@ -249,7 +249,7 @@ class FilesPlugin extends ServerPlugin { * @param RequestInterface $request * @param ResponseInterface $response */ - function httpGet(RequestInterface $request, ResponseInterface $response) { + public function httpGet(RequestInterface $request, ResponseInterface $response) { // Only handle valid files $node = $this->tree->getNodeForPath($request->getPath()); if (!($node instanceof IFile)) { diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php index 617847626cc..0e7db3f57ce 100644 --- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php @@ -48,10 +48,10 @@ use Sabre\DAV\Xml\Response\MultiStatus; class FilesReportPlugin extends ServerPlugin { // namespace - const NS_OWNCLOUD = 'http://owncloud.org/ns'; - const REPORT_NAME = '{http://owncloud.org/ns}filter-files'; - const SYSTEMTAG_PROPERTYNAME = '{http://owncloud.org/ns}systemtag'; - const CIRCLE_PROPERTYNAME = '{http://owncloud.org/ns}circle'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const REPORT_NAME = '{http://owncloud.org/ns}filter-files'; + public const SYSTEMTAG_PROPERTYNAME = '{http://owncloud.org/ns}systemtag'; + public const CIRCLE_PROPERTYNAME = '{http://owncloud.org/ns}circle'; /** * Reference to main server object diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php index b6a96053cb3..673b8c237e9 100644 --- a/apps/dav/lib/Connector/Sabre/Principal.php +++ b/apps/dav/lib/Connector/Sabre/Principal.php @@ -224,7 +224,7 @@ class Principal implements BackendInterface { * @param PropPatch $propPatch * @return int */ - function updatePrincipal($path, PropPatch $propPatch) { + public function updatePrincipal($path, PropPatch $propPatch) { return 0; } @@ -371,7 +371,7 @@ class Principal implements BackendInterface { * @param string $test * @return array */ - function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') { + public function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') { if (count($searchProperties) === 0) { return []; } @@ -390,7 +390,7 @@ class Principal implements BackendInterface { * @param string $principalPrefix * @return string */ - function findByUri($uri, $principalPrefix) { + public function findByUri($uri, $principalPrefix) { // If sharing is disabled, return the empty array $shareAPIEnabled = $this->shareManager->shareApiEnabled(); if (!$shareAPIEnabled) { diff --git a/apps/dav/lib/Connector/Sabre/ShareTypeList.php b/apps/dav/lib/Connector/Sabre/ShareTypeList.php index ab85c80aa55..5a4a1f5635f 100644 --- a/apps/dav/lib/Connector/Sabre/ShareTypeList.php +++ b/apps/dav/lib/Connector/Sabre/ShareTypeList.php @@ -32,7 +32,7 @@ use Sabre\Xml\Writer; * This property contains multiple "share-type" elements, each containing a share type. */ class ShareTypeList implements Element { - const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; /** * Share types @@ -63,7 +63,7 @@ class ShareTypeList implements Element { * @param Reader $reader * @return mixed */ - static function xmlDeserialize(Reader $reader) { + public static function xmlDeserialize(Reader $reader) { $shareTypes = []; $tree = $reader->parseInnerTree(); @@ -84,7 +84,7 @@ class ShareTypeList implements Element { * @param Writer $writer * @return void */ - function xmlSerialize(Writer $writer) { + public function xmlSerialize(Writer $writer) { foreach ($this->shareTypes as $shareType) { $writer->writeElement('{' . self::NS_OWNCLOUD . '}share-type', $shareType); } diff --git a/apps/dav/lib/Connector/Sabre/ShareeList.php b/apps/dav/lib/Connector/Sabre/ShareeList.php index 67b42aad919..235ae9cd823 100644 --- a/apps/dav/lib/Connector/Sabre/ShareeList.php +++ b/apps/dav/lib/Connector/Sabre/ShareeList.php @@ -35,7 +35,7 @@ use Sabre\Xml\XmlSerializable; * This property contains multiple "sharee" elements, each containing a share sharee */ class ShareeList implements XmlSerializable { - const NS_NEXTCLOUD = 'http://nextcloud.org/ns'; + public const NS_NEXTCLOUD = 'http://nextcloud.org/ns'; /** @var IShare[] */ private $shares; @@ -50,7 +50,7 @@ class ShareeList implements XmlSerializable { * @param Writer $writer * @return void */ - function xmlSerialize(Writer $writer) { + public function xmlSerialize(Writer $writer) { foreach ($this->shares as $share) { $writer->startElement('{' . self::NS_NEXTCLOUD . '}sharee'); $writer->writeElement('{' . self::NS_NEXTCLOUD . '}id', $share->getSharedWith()); diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php index ee4246011bf..63c204fda4e 100644 --- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php @@ -35,10 +35,10 @@ use Sabre\DAV\PropFind; * Sabre Plugin to provide share-related properties */ class SharesPlugin extends \Sabre\DAV\ServerPlugin { - const NS_OWNCLOUD = 'http://owncloud.org/ns'; - const NS_NEXTCLOUD = 'http://nextcloud.org/ns'; - const SHARETYPES_PROPERTYNAME = '{http://owncloud.org/ns}share-types'; - const SHAREES_PROPERTYNAME = '{http://nextcloud.org/ns}sharees'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_NEXTCLOUD = 'http://nextcloud.org/ns'; + public const SHARETYPES_PROPERTYNAME = '{http://owncloud.org/ns}share-types'; + public const SHAREES_PROPERTYNAME = '{http://nextcloud.org/ns}sharees'; /** * Reference to main server object diff --git a/apps/dav/lib/Connector/Sabre/TagList.php b/apps/dav/lib/Connector/Sabre/TagList.php index 72c3fb31b07..603087fd5fa 100644 --- a/apps/dav/lib/Connector/Sabre/TagList.php +++ b/apps/dav/lib/Connector/Sabre/TagList.php @@ -34,7 +34,7 @@ use Sabre\Xml\Writer; * This property contains multiple "tag" elements, each containing a tag name. */ class TagList implements Element { - const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; /** * tags @@ -80,7 +80,7 @@ class TagList implements Element { * @param Reader $reader * @return mixed */ - static function xmlDeserialize(Reader $reader) { + public static function xmlDeserialize(Reader $reader) { $tags = []; $tree = $reader->parseInnerTree(); @@ -114,7 +114,7 @@ class TagList implements Element { * @param Writer $writer * @return void */ - function xmlSerialize(Writer $writer) { + public function xmlSerialize(Writer $writer) { foreach ($this->tags as $tag) { $writer->writeElement('{' . self::NS_OWNCLOUD . '}tag', $tag); } diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php index 33698810cfb..ad3e0611270 100644 --- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php +++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php @@ -55,10 +55,10 @@ use Sabre\DAV\PropPatch; class TagsPlugin extends \Sabre\DAV\ServerPlugin { // namespace - const NS_OWNCLOUD = 'http://owncloud.org/ns'; - const TAGS_PROPERTYNAME = '{http://owncloud.org/ns}tags'; - const FAVORITE_PROPERTYNAME = '{http://owncloud.org/ns}favorite'; - const TAG_FAVORITE = '_$!<Favorite>!$_'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const TAGS_PROPERTYNAME = '{http://owncloud.org/ns}tags'; + public const FAVORITE_PROPERTYNAME = '{http://owncloud.org/ns}favorite'; + public const TAG_FAVORITE = '_$!<Favorite>!$_'; /** * Reference to main server object diff --git a/apps/dav/lib/DAV/GroupPrincipalBackend.php b/apps/dav/lib/DAV/GroupPrincipalBackend.php index f03c7cc2bdd..15e95a9bd29 100644 --- a/apps/dav/lib/DAV/GroupPrincipalBackend.php +++ b/apps/dav/lib/DAV/GroupPrincipalBackend.php @@ -36,7 +36,7 @@ use Sabre\DAV\PropPatch; use Sabre\DAVACL\PrincipalBackend\BackendInterface; class GroupPrincipalBackend implements BackendInterface { - const PRINCIPAL_PREFIX = 'principals/groups'; + public const PRINCIPAL_PREFIX = 'principals/groups'; /** @var IGroupManager */ private $groupManager; @@ -167,7 +167,7 @@ class GroupPrincipalBackend implements BackendInterface { * @param PropPatch $propPatch * @return int */ - function updatePrincipal($path, PropPatch $propPatch) { + public function updatePrincipal($path, PropPatch $propPatch) { return 0; } @@ -177,7 +177,7 @@ class GroupPrincipalBackend implements BackendInterface { * @param string $test * @return array */ - function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') { + public function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') { $results = []; if (\count($searchProperties) === 0) { @@ -257,7 +257,7 @@ class GroupPrincipalBackend implements BackendInterface { * @param string $principalPrefix * @return string */ - function findByUri($uri, $principalPrefix) { + public function findByUri($uri, $principalPrefix) { // If sharing is disabled, return the empty array $shareAPIEnabled = $this->shareManager->shareApiEnabled(); if (!$shareAPIEnabled) { diff --git a/apps/dav/lib/DAV/PublicAuth.php b/apps/dav/lib/DAV/PublicAuth.php index 407f1a2853f..d37c2dd46f6 100644 --- a/apps/dav/lib/DAV/PublicAuth.php +++ b/apps/dav/lib/DAV/PublicAuth.php @@ -67,7 +67,7 @@ class PublicAuth implements BackendInterface { * @param ResponseInterface $response * @return array */ - function check(RequestInterface $request, ResponseInterface $response) { + public function check(RequestInterface $request, ResponseInterface $response) { if ($this->isRequestPublic($request)) { return [true, "principals/system/public"]; } @@ -77,7 +77,7 @@ class PublicAuth implements BackendInterface { /** * @inheritdoc */ - function challenge(RequestInterface $request, ResponseInterface $response) { + public function challenge(RequestInterface $request, ResponseInterface $response) { } /** diff --git a/apps/dav/lib/DAV/Sharing/Backend.php b/apps/dav/lib/DAV/Sharing/Backend.php index ae69e33387c..6c88fa4d15e 100644 --- a/apps/dav/lib/DAV/Sharing/Backend.php +++ b/apps/dav/lib/DAV/Sharing/Backend.php @@ -45,9 +45,9 @@ class Backend { /** @var string */ private $resourceType; - const ACCESS_OWNER = 1; - const ACCESS_READ_WRITE = 2; - const ACCESS_READ = 3; + public const ACCESS_OWNER = 1; + public const ACCESS_READ_WRITE = 2; + public const ACCESS_READ = 3; /** * @param IDBConnection $db diff --git a/apps/dav/lib/DAV/Sharing/IShareable.php b/apps/dav/lib/DAV/Sharing/IShareable.php index 1293721040a..ffe9e3691dc 100644 --- a/apps/dav/lib/DAV/Sharing/IShareable.php +++ b/apps/dav/lib/DAV/Sharing/IShareable.php @@ -49,7 +49,7 @@ interface IShareable extends INode { * @param array $remove * @return void */ - function updateShares(array $add, array $remove); + public function updateShares(array $add, array $remove); /** * Returns the list of people whom this resource is shared with. @@ -63,7 +63,7 @@ interface IShareable extends INode { * * @return array */ - function getShares(); + public function getShares(); /** * @return int diff --git a/apps/dav/lib/DAV/Sharing/Plugin.php b/apps/dav/lib/DAV/Sharing/Plugin.php index 67eed9c9b4a..e33d879fa0e 100644 --- a/apps/dav/lib/DAV/Sharing/Plugin.php +++ b/apps/dav/lib/DAV/Sharing/Plugin.php @@ -37,8 +37,8 @@ use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; class Plugin extends ServerPlugin { - const NS_OWNCLOUD = 'http://owncloud.org/ns'; - const NS_NEXTCLOUD = 'http://nextcloud.com/ns'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const NS_NEXTCLOUD = 'http://nextcloud.com/ns'; /** @var Auth */ private $auth; @@ -72,7 +72,7 @@ class Plugin extends ServerPlugin { * * @return string[] */ - function getFeatures() { + public function getFeatures() { return ['oc-resource-sharing']; } @@ -84,7 +84,7 @@ class Plugin extends ServerPlugin { * * @return string */ - function getPluginName() { + public function getPluginName() { return 'oc-resource-sharing'; } @@ -99,7 +99,7 @@ class Plugin extends ServerPlugin { * @param Server $server * @return void */ - function initialize(Server $server) { + public function initialize(Server $server) { $this->server = $server; $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}share'] = ShareRequest::class; $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}invite'] = Invite::class; @@ -115,7 +115,7 @@ class Plugin extends ServerPlugin { * @param ResponseInterface $response * @return null|false */ - function httpPost(RequestInterface $request, ResponseInterface $response) { + public function httpPost(RequestInterface $request, ResponseInterface $response) { $path = $request->getPath(); // Only handling xml @@ -188,7 +188,7 @@ class Plugin extends ServerPlugin { * @param INode $node * @return void */ - function propFind(PropFind $propFind, INode $node) { + public function propFind(PropFind $propFind, INode $node) { if ($node instanceof IShareable) { $propFind->handle('{' . Plugin::NS_OWNCLOUD . '}invite', function () use ($node) { return new Invite( diff --git a/apps/dav/lib/DAV/Sharing/Xml/Invite.php b/apps/dav/lib/DAV/Sharing/Xml/Invite.php index 68aab171ab7..315ede2ce9c 100644 --- a/apps/dav/lib/DAV/Sharing/Xml/Invite.php +++ b/apps/dav/lib/DAV/Sharing/Xml/Invite.php @@ -84,7 +84,7 @@ class Invite implements XmlSerializable { * * @param array $users */ - function __construct(array $users, array $organizer = null) { + public function __construct(array $users, array $organizer = null) { $this->users = $users; $this->organizer = $organizer; } @@ -94,7 +94,7 @@ class Invite implements XmlSerializable { * * @return array */ - function getValue() { + public function getValue() { return $this->users; } @@ -117,7 +117,7 @@ class Invite implements XmlSerializable { * @param Writer $writer * @return void */ - function xmlSerialize(Writer $writer) { + public function xmlSerialize(Writer $writer) { $cs = '{' . Plugin::NS_OWNCLOUD . '}'; if (!is_null($this->organizer)) { diff --git a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php index d76e65aa232..c973908f5a8 100644 --- a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php +++ b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php @@ -38,12 +38,12 @@ class ShareRequest implements XmlDeserializable { * @param array $set * @param array $remove */ - function __construct(array $set, array $remove) { + public function __construct(array $set, array $remove) { $this->set = $set; $this->remove = $remove; } - static function xmlDeserialize(Reader $reader) { + public static function xmlDeserialize(Reader $reader) { $elements = $reader->parseInnerTree([ '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', diff --git a/apps/dav/lib/DAV/SystemPrincipalBackend.php b/apps/dav/lib/DAV/SystemPrincipalBackend.php index c369f4da375..ebe1d61db4a 100644 --- a/apps/dav/lib/DAV/SystemPrincipalBackend.php +++ b/apps/dav/lib/DAV/SystemPrincipalBackend.php @@ -43,7 +43,7 @@ class SystemPrincipalBackend extends AbstractBackend { * @param string $prefixPath * @return array */ - function getPrincipalsByPrefix($prefixPath) { + public function getPrincipalsByPrefix($prefixPath) { $principals = []; if ($prefixPath === 'principals/system') { @@ -68,7 +68,7 @@ class SystemPrincipalBackend extends AbstractBackend { * @param string $path * @return array */ - function getPrincipalByPath($path) { + public function getPrincipalByPath($path) { if ($path === 'principals/system/system') { $principal = [ 'uri' => 'principals/system/system', @@ -103,7 +103,7 @@ class SystemPrincipalBackend extends AbstractBackend { * @param \Sabre\DAV\PropPatch $propPatch * @return void */ - function updatePrincipal($path, \Sabre\DAV\PropPatch $propPatch) { + public function updatePrincipal($path, \Sabre\DAV\PropPatch $propPatch) { } /** @@ -135,7 +135,7 @@ class SystemPrincipalBackend extends AbstractBackend { * @param string $test * @return array */ - function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') { + public function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') { return []; } @@ -145,7 +145,7 @@ class SystemPrincipalBackend extends AbstractBackend { * @param string $principal * @return array */ - function getGroupMemberSet($principal) { + public function getGroupMemberSet($principal) { // TODO: for now the group principal has only one member, the user itself $principal = $this->getPrincipalByPath($principal); if (!$principal) { @@ -161,7 +161,7 @@ class SystemPrincipalBackend extends AbstractBackend { * @param string $principal * @return array */ - function getGroupMembership($principal) { + public function getGroupMembership($principal) { list($prefix, ) = \Sabre\Uri\split($principal); if ($prefix === 'principals/system') { @@ -184,7 +184,7 @@ class SystemPrincipalBackend extends AbstractBackend { * @param array $members * @return void */ - function setGroupMemberSet($principal, array $members) { + public function setGroupMemberSet($principal, array $members) { throw new \Sabre\DAV\Exception('Setting members of the group is not supported yet'); } } diff --git a/apps/dav/lib/Files/BrowserErrorPagePlugin.php b/apps/dav/lib/Files/BrowserErrorPagePlugin.php index 47de5020d56..5f9c5916d89 100644 --- a/apps/dav/lib/Files/BrowserErrorPagePlugin.php +++ b/apps/dav/lib/Files/BrowserErrorPagePlugin.php @@ -48,7 +48,7 @@ class BrowserErrorPagePlugin extends ServerPlugin { * @param Server $server * @return void */ - function initialize(Server $server) { + public function initialize(Server $server) { $this->server = $server; $server->on('exception', [$this, 'logException'], 1000); } diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php index fd951961623..a69236ffd51 100644 --- a/apps/dav/lib/Files/FileSearchBackend.php +++ b/apps/dav/lib/Files/FileSearchBackend.php @@ -428,6 +428,7 @@ class FileSearchBackend implements ISearchBackend { } else { return null; } + // no break default: return null; } diff --git a/apps/dav/lib/Files/FilesHome.php b/apps/dav/lib/Files/FilesHome.php index c0f243b34fe..71c663b2e2b 100644 --- a/apps/dav/lib/Files/FilesHome.php +++ b/apps/dav/lib/Files/FilesHome.php @@ -49,16 +49,16 @@ class FilesHome extends Directory { parent::__construct($view, $userFolder); } - function delete() { + public function delete() { throw new Forbidden('Permission denied to delete home folder'); } - function getName() { + public function getName() { list(,$name) = \Sabre\Uri\split($this->principalInfo['uri']); return $name; } - function setName($name) { + public function setName($name) { throw new Forbidden('Permission denied to rename this folder'); } } diff --git a/apps/dav/lib/Files/RootCollection.php b/apps/dav/lib/Files/RootCollection.php index 22142b46e1c..b83e944edcc 100644 --- a/apps/dav/lib/Files/RootCollection.php +++ b/apps/dav/lib/Files/RootCollection.php @@ -42,7 +42,7 @@ class RootCollection extends AbstractPrincipalCollection { * @param array $principalInfo * @return INode */ - function getChildForPrincipal(array $principalInfo) { + public function getChildForPrincipal(array $principalInfo) { list(,$name) = \Sabre\Uri\split($principalInfo['uri']); $user = \OC::$server->getUserSession()->getUser(); if (is_null($user) || $name !== $user->getUID()) { @@ -58,7 +58,7 @@ class RootCollection extends AbstractPrincipalCollection { return new FilesHome($principalInfo, $userFolder); } - function getName() { + public function getName() { return 'files'; } } diff --git a/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php b/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php index 98c9ce0b6e1..e2e192eda85 100644 --- a/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php +++ b/apps/dav/lib/Provisioning/Apple/AppleProvisioningNode.php @@ -30,7 +30,7 @@ use Sabre\DAV\IProperties; use Sabre\DAV\PropPatch; class AppleProvisioningNode implements INode, IProperties { - const FILENAME = 'apple-provisioning.mobileconfig'; + public const FILENAME = 'apple-provisioning.mobileconfig'; protected $timeFactory; diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php index b05ba07ead2..c83fd3f0487 100644 --- a/apps/dav/lib/SystemTag/SystemTagPlugin.php +++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php @@ -50,13 +50,13 @@ use Sabre\HTTP\ResponseInterface; class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { // namespace - const NS_OWNCLOUD = 'http://owncloud.org/ns'; - const ID_PROPERTYNAME = '{http://owncloud.org/ns}id'; - const DISPLAYNAME_PROPERTYNAME = '{http://owncloud.org/ns}display-name'; - const USERVISIBLE_PROPERTYNAME = '{http://owncloud.org/ns}user-visible'; - const USERASSIGNABLE_PROPERTYNAME = '{http://owncloud.org/ns}user-assignable'; - const GROUPS_PROPERTYNAME = '{http://owncloud.org/ns}groups'; - const CANASSIGN_PROPERTYNAME = '{http://owncloud.org/ns}can-assign'; + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; + public const ID_PROPERTYNAME = '{http://owncloud.org/ns}id'; + public const DISPLAYNAME_PROPERTYNAME = '{http://owncloud.org/ns}display-name'; + public const USERVISIBLE_PROPERTYNAME = '{http://owncloud.org/ns}user-visible'; + public const USERASSIGNABLE_PROPERTYNAME = '{http://owncloud.org/ns}user-assignable'; + public const GROUPS_PROPERTYNAME = '{http://owncloud.org/ns}groups'; + public const CANASSIGN_PROPERTYNAME = '{http://owncloud.org/ns}can-assign'; /** * @var \Sabre\DAV\Server $server diff --git a/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php b/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php index e44150aaabe..c50fb03dd40 100644 --- a/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsByIdCollection.php @@ -86,21 +86,21 @@ class SystemTagsByIdCollection implements ICollection { * @param resource|string $data Initial payload * @throws Forbidden */ - function createFile($name, $data = null) { + public function createFile($name, $data = null) { throw new Forbidden('Cannot create tags by id'); } /** * @param string $name */ - function createDirectory($name) { + public function createDirectory($name) { throw new Forbidden('Permission denied to create collections'); } /** * @param string $name */ - function getChild($name) { + public function getChild($name) { try { $tag = $this->tagManager->getTagsByIds([$name]); $tag = current($tag); @@ -115,7 +115,7 @@ class SystemTagsByIdCollection implements ICollection { } } - function getChildren() { + public function getChildren() { $visibilityFilter = true; if ($this->isAdmin()) { $visibilityFilter = null; @@ -130,7 +130,7 @@ class SystemTagsByIdCollection implements ICollection { /** * @param string $name */ - function childExists($name) { + public function childExists($name) { try { $tag = $this->tagManager->getTagsByIds([$name]); $tag = current($tag); @@ -145,15 +145,15 @@ class SystemTagsByIdCollection implements ICollection { } } - function delete() { + public function delete() { throw new Forbidden('Permission denied to delete this collection'); } - function getName() { + public function getName() { return 'systemtags'; } - function setName($name) { + public function setName($name) { throw new Forbidden('Permission denied to rename this collection'); } @@ -162,7 +162,7 @@ class SystemTagsByIdCollection implements ICollection { * * @return int */ - function getLastModified() { + public function getLastModified() { return null; } diff --git a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php index bb74884419a..03cab4c9dc1 100644 --- a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php @@ -92,7 +92,7 @@ class SystemTagsObjectMappingCollection implements ICollection { $this->user = $user; } - function createFile($tagId, $data = null) { + public function createFile($tagId, $data = null) { try { $tags = $this->tagManager->getTagsByIds([$tagId]); $tag = current($tags); @@ -109,11 +109,11 @@ class SystemTagsObjectMappingCollection implements ICollection { } } - function createDirectory($name) { + public function createDirectory($name) { throw new Forbidden('Permission denied to create collections'); } - function getChild($tagId) { + public function getChild($tagId) { try { if ($this->tagMapper->haveTag([$this->objectId], $this->objectType, $tagId, true)) { $tag = $this->tagManager->getTagsByIds([$tagId]); @@ -130,7 +130,7 @@ class SystemTagsObjectMappingCollection implements ICollection { } } - function getChildren() { + public function getChildren() { $tagIds = current($this->tagMapper->getTagIdsForObjects([$this->objectId], $this->objectType)); if (empty($tagIds)) { return []; @@ -147,7 +147,7 @@ class SystemTagsObjectMappingCollection implements ICollection { }, $tags)); } - function childExists($tagId) { + public function childExists($tagId) { try { $result = $this->tagMapper->haveTag([$this->objectId], $this->objectType, $tagId, true); @@ -167,15 +167,15 @@ class SystemTagsObjectMappingCollection implements ICollection { } } - function delete() { + public function delete() { throw new Forbidden('Permission denied to delete this collection'); } - function getName() { + public function getName() { return $this->objectId; } - function setName($name) { + public function setName($name) { throw new Forbidden('Permission denied to rename this collection'); } @@ -184,7 +184,7 @@ class SystemTagsObjectMappingCollection implements ICollection { * * @return int */ - function getLastModified() { + public function getLastModified() { return null; } diff --git a/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php b/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php index 80741342991..0e3560ab330 100644 --- a/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php @@ -101,7 +101,7 @@ class SystemTagsObjectTypeCollection implements ICollection { * @return null|string * @throws Forbidden */ - function createFile($name, $data = null) { + public function createFile($name, $data = null) { throw new Forbidden('Permission denied to create nodes'); } @@ -109,7 +109,7 @@ class SystemTagsObjectTypeCollection implements ICollection { * @param string $name * @throws Forbidden */ - function createDirectory($name) { + public function createDirectory($name) { throw new Forbidden('Permission denied to create collections'); } @@ -118,7 +118,7 @@ class SystemTagsObjectTypeCollection implements ICollection { * @return SystemTagsObjectMappingCollection * @throws NotFound */ - function getChild($objectId) { + public function getChild($objectId) { // make sure the object exists and is reachable if (!$this->childExists($objectId)) { throw new NotFound('Entity does not exist or is not available'); @@ -132,7 +132,7 @@ class SystemTagsObjectTypeCollection implements ICollection { ); } - function getChildren() { + public function getChildren() { // do not list object ids throw new MethodNotAllowed(); } @@ -143,15 +143,15 @@ class SystemTagsObjectTypeCollection implements ICollection { * @param string $name * @return bool */ - function childExists($name) { + public function childExists($name) { return call_user_func($this->childExistsFunction, $name); } - function delete() { + public function delete() { throw new Forbidden('Permission denied to delete this collection'); } - function getName() { + public function getName() { return $this->objectType; } @@ -159,7 +159,7 @@ class SystemTagsObjectTypeCollection implements ICollection { * @param string $name * @throws Forbidden */ - function setName($name) { + public function setName($name) { throw new Forbidden('Permission denied to rename this collection'); } @@ -168,7 +168,7 @@ class SystemTagsObjectTypeCollection implements ICollection { * * @return int */ - function getLastModified() { + public function getLastModified() { return null; } } diff --git a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php index bc4e6a8c4c4..b4d81a8e053 100644 --- a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php @@ -84,11 +84,11 @@ class SystemTagsRelationsCollection extends SimpleCollection { parent::__construct('root', $children); } - function getName() { + public function getName() { return 'systemtags-relations'; } - function setName($name) { + public function setName($name) { throw new Forbidden('Permission denied to rename this collection'); } } diff --git a/apps/dav/lib/Upload/ChunkingPlugin.php b/apps/dav/lib/Upload/ChunkingPlugin.php index 704cbf8f578..35487f61429 100644 --- a/apps/dav/lib/Upload/ChunkingPlugin.php +++ b/apps/dav/lib/Upload/ChunkingPlugin.php @@ -37,7 +37,7 @@ class ChunkingPlugin extends ServerPlugin { /** * @inheritdoc */ - function initialize(Server $server) { + public function initialize(Server $server) { $server->on('beforeMove', [$this, 'beforeMove']); $this->server = $server; } @@ -46,7 +46,7 @@ class ChunkingPlugin extends ServerPlugin { * @param string $sourcePath source path * @param string $destination destination path */ - function beforeMove($sourcePath, $destination) { + public function beforeMove($sourcePath, $destination) { $this->sourceNode = $this->server->tree->getNodeForPath($sourcePath); if (!$this->sourceNode instanceof FutureFile) { // skip handling as the source is not a chunked FutureFile diff --git a/apps/dav/lib/Upload/FutureFile.php b/apps/dav/lib/Upload/FutureFile.php index 34a5981bda2..335696f0e30 100644 --- a/apps/dav/lib/Upload/FutureFile.php +++ b/apps/dav/lib/Upload/FutureFile.php @@ -47,7 +47,7 @@ class FutureFile implements \Sabre\DAV\IFile { * @param Directory $root * @param string $name */ - function __construct(Directory $root, $name) { + public function __construct(Directory $root, $name) { $this->root = $root; $this->name = $name; } @@ -55,14 +55,14 @@ class FutureFile implements \Sabre\DAV\IFile { /** * @inheritdoc */ - function put($data) { + public function put($data) { throw new Forbidden('Permission denied to put into this file'); } /** * @inheritdoc */ - function get() { + public function get() { $nodes = $this->root->getChildren(); return AssemblyStream::wrap($nodes); } @@ -70,21 +70,21 @@ class FutureFile implements \Sabre\DAV\IFile { /** * @inheritdoc */ - function getContentType() { + public function getContentType() { return 'application/octet-stream'; } /** * @inheritdoc */ - function getETag() { + public function getETag() { return $this->root->getETag(); } /** * @inheritdoc */ - function getSize() { + public function getSize() { $children = $this->root->getChildren(); $sizes = array_map(function ($node) { /** @var IFile $node */ @@ -97,28 +97,28 @@ class FutureFile implements \Sabre\DAV\IFile { /** * @inheritdoc */ - function delete() { + public function delete() { $this->root->delete(); } /** * @inheritdoc */ - function getName() { + public function getName() { return $this->name; } /** * @inheritdoc */ - function setName($name) { + public function setName($name) { throw new Forbidden('Permission denied to rename this file'); } /** * @inheritdoc */ - function getLastModified() { + public function getLastModified() { return $this->root->getLastModified(); } } diff --git a/apps/dav/lib/Upload/UploadFolder.php b/apps/dav/lib/Upload/UploadFolder.php index 6778a30b8a2..d74154c6ac9 100644 --- a/apps/dav/lib/Upload/UploadFolder.php +++ b/apps/dav/lib/Upload/UploadFolder.php @@ -35,56 +35,56 @@ class UploadFolder implements ICollection { /** @var CleanupService */ private $cleanupService; - function __construct(Directory $node, CleanupService $cleanupService) { + public function __construct(Directory $node, CleanupService $cleanupService) { $this->node = $node; $this->cleanupService = $cleanupService; } - function createFile($name, $data = null) { + public function createFile($name, $data = null) { // TODO: verify name - should be a simple number $this->node->createFile($name, $data); } - function createDirectory($name) { + public function createDirectory($name) { throw new Forbidden('Permission denied to create file (filename ' . $name . ')'); } - function getChild($name) { + public function getChild($name) { if ($name === '.file') { return new FutureFile($this->node, '.file'); } return $this->node->getChild($name); } - function getChildren() { + public function getChildren() { $children = $this->node->getChildren(); $children[] = new FutureFile($this->node, '.file'); return $children; } - function childExists($name) { + public function childExists($name) { if ($name === '.file') { return true; } return $this->node->childExists($name); } - function delete() { + public function delete() { $this->node->delete(); // Background cleanup job is not needed anymore $this->cleanupService->removeJob($this->getName()); } - function getName() { + public function getName() { return $this->node->getName(); } - function setName($name) { + public function setName($name) { throw new Forbidden('Permission denied to rename this folder'); } - function getLastModified() { + public function getLastModified() { return $this->node->getLastModified(); } } diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php index ff62bdaa6d2..131339ee40e 100644 --- a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php +++ b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php @@ -68,10 +68,10 @@ abstract class AbstractCalDavBackend extends TestCase { /** @var ILogger */ private $logger; - const UNIT_TEST_USER = 'principals/users/caldav-unit-test'; - const UNIT_TEST_USER1 = 'principals/users/caldav-unit-test1'; - const UNIT_TEST_GROUP = 'principals/groups/caldav-unit-test-group'; - const UNIT_TEST_GROUP2 = 'principals/groups/caldav-unit-test-group2'; + public const UNIT_TEST_USER = 'principals/users/caldav-unit-test'; + public const UNIT_TEST_USER1 = 'principals/users/caldav-unit-test1'; + public const UNIT_TEST_GROUP = 'principals/groups/caldav-unit-test-group'; + public const UNIT_TEST_GROUP2 = 'principals/groups/caldav-unit-test-group2'; protected function setUp(): void { parent::setUp(); diff --git a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php index 0e58c36b39d..8ea6e5257f0 100644 --- a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php +++ b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php @@ -52,7 +52,7 @@ use Test\TestCase; * @package OCA\DAV\Tests\unit\CalDAV */ class PublicCalendarRootTest extends TestCase { - const UNIT_TEST_USER = ''; + public const UNIT_TEST_USER = ''; /** @var CalDavBackend */ private $backend; /** @var PublicCalendarRoot */ diff --git a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php index 7a555220d85..d4abf61af1a 100644 --- a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php +++ b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php @@ -31,7 +31,7 @@ use Sabre\Xml\Writer; use Test\TestCase; class PublisherTest extends TestCase { - const NS_CALENDARSERVER = 'http://calendarserver.org/ns/'; + public const NS_CALENDARSERVER = 'http://calendarserver.org/ns/'; public function testSerializePublished() { $publish = new Publisher('urltopublish', true); diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php index cd111c44ae4..9a22f63c1be 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php @@ -43,7 +43,7 @@ use OCP\Mail\IMessage; use Sabre\VObject\Component\VCalendar; class EmailProviderTest extends AbstractNotificationProviderTest { - const USER_EMAIL = 'frodo@hobb.it'; + public const USER_EMAIL = 'frodo@hobb.it'; /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */ protected $logger; diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php index e7d2197a6ee..1768acb39e0 100644 --- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php +++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php @@ -86,9 +86,9 @@ class CardDavBackendTest extends TestCase { /** @var string */ private $dbCardsPropertiesTable = 'cards_properties'; - const UNIT_TEST_USER = 'principals/users/carddav-unit-test'; - const UNIT_TEST_USER1 = 'principals/users/carddav-unit-test1'; - const UNIT_TEST_GROUP = 'principals/groups/carddav-unit-test-group'; + public const UNIT_TEST_USER = 'principals/users/carddav-unit-test'; + public const UNIT_TEST_USER1 = 'principals/users/carddav-unit-test1'; + public const UNIT_TEST_GROUP = 'principals/groups/carddav-unit-test-group'; private $vcardTest0 = 'BEGIN:VCARD'.PHP_EOL. 'VERSION:3.0'.PHP_EOL. diff --git a/apps/dav/tests/unit/CardDAV/ConverterTest.php b/apps/dav/tests/unit/CardDAV/ConverterTest.php index da2255a7172..d502783ba41 100644 --- a/apps/dav/tests/unit/CardDAV/ConverterTest.php +++ b/apps/dav/tests/unit/CardDAV/ConverterTest.php @@ -34,7 +34,7 @@ use OCP\IUser; use PHPUnit_Framework_MockObject_MockObject; use Test\TestCase; -class ConverterTest extends TestCase { +class ConverterTest extends TestCase { /** @var AccountManager | PHPUnit_Framework_MockObject_MockObject */ private $accountManager; diff --git a/apps/dav/tests/unit/Command/ListCalendarsTest.php b/apps/dav/tests/unit/Command/ListCalendarsTest.php index 8960a9d7721..ab3721e80b9 100644 --- a/apps/dav/tests/unit/Command/ListCalendarsTest.php +++ b/apps/dav/tests/unit/Command/ListCalendarsTest.php @@ -48,7 +48,7 @@ class ListCalendarsTest extends TestCase { /** @var ListCalendars */ private $command; - const USERNAME = 'username'; + public const USERNAME = 'username'; protected function setUp(): void { parent::setUp(); diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php index 2b8d145059f..9ce2837332f 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php @@ -56,17 +56,17 @@ use Test\TestCase; * See the COPYING-README file. */ class FilesPluginTest extends TestCase { - const GETETAG_PROPERTYNAME = FilesPlugin::GETETAG_PROPERTYNAME; - const FILEID_PROPERTYNAME = FilesPlugin::FILEID_PROPERTYNAME; - const INTERNAL_FILEID_PROPERTYNAME = FilesPlugin::INTERNAL_FILEID_PROPERTYNAME; - const SIZE_PROPERTYNAME = FilesPlugin::SIZE_PROPERTYNAME; - const PERMISSIONS_PROPERTYNAME = FilesPlugin::PERMISSIONS_PROPERTYNAME; - const LASTMODIFIED_PROPERTYNAME = FilesPlugin::LASTMODIFIED_PROPERTYNAME; - const DOWNLOADURL_PROPERTYNAME = FilesPlugin::DOWNLOADURL_PROPERTYNAME; - const OWNER_ID_PROPERTYNAME = FilesPlugin::OWNER_ID_PROPERTYNAME; - const OWNER_DISPLAY_NAME_PROPERTYNAME = FilesPlugin::OWNER_DISPLAY_NAME_PROPERTYNAME; - const DATA_FINGERPRINT_PROPERTYNAME = FilesPlugin::DATA_FINGERPRINT_PROPERTYNAME; - const HAS_PREVIEW_PROPERTYNAME = FilesPlugin::HAS_PREVIEW_PROPERTYNAME; + public const GETETAG_PROPERTYNAME = FilesPlugin::GETETAG_PROPERTYNAME; + public const FILEID_PROPERTYNAME = FilesPlugin::FILEID_PROPERTYNAME; + public const INTERNAL_FILEID_PROPERTYNAME = FilesPlugin::INTERNAL_FILEID_PROPERTYNAME; + public const SIZE_PROPERTYNAME = FilesPlugin::SIZE_PROPERTYNAME; + public const PERMISSIONS_PROPERTYNAME = FilesPlugin::PERMISSIONS_PROPERTYNAME; + public const LASTMODIFIED_PROPERTYNAME = FilesPlugin::LASTMODIFIED_PROPERTYNAME; + public const DOWNLOADURL_PROPERTYNAME = FilesPlugin::DOWNLOADURL_PROPERTYNAME; + public const OWNER_ID_PROPERTYNAME = FilesPlugin::OWNER_ID_PROPERTYNAME; + public const OWNER_DISPLAY_NAME_PROPERTYNAME = FilesPlugin::OWNER_DISPLAY_NAME_PROPERTYNAME; + public const DATA_FINGERPRINT_PROPERTYNAME = FilesPlugin::DATA_FINGERPRINT_PROPERTYNAME; + public const HAS_PREVIEW_PROPERTYNAME = FilesPlugin::HAS_PREVIEW_PROPERTYNAME; /** * @var \Sabre\DAV\Server | \PHPUnit_Framework_MockObject_MockObject diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php index c6d0a6a340f..188a39c89af 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php @@ -198,7 +198,7 @@ class ObjectTreeTest extends \Test\TestCase { unset($_SERVER['HTTP_OC_CHUNKED']); } - function nodeForPathProvider() { + public function nodeForPathProvider() { return [ // regular file [ diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php index 8dd73e98bd7..a703b417e32 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php @@ -78,7 +78,7 @@ class Auth implements BackendInterface { * @param ResponseInterface $response * @return array */ - function check(RequestInterface $request, ResponseInterface $response) { + public function check(RequestInterface $request, ResponseInterface $response) { $userSession = \OC::$server->getUserSession(); $result = $userSession->login($this->user, $this->password); if ($result) { @@ -113,7 +113,7 @@ class Auth implements BackendInterface { * @param ResponseInterface $response * @return void */ - function challenge(RequestInterface $request, ResponseInterface $response) { + public function challenge(RequestInterface $request, ResponseInterface $response) { // TODO: Implement challenge() method. } } diff --git a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php index dd1cc70046d..153bc0cd93b 100644 --- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php @@ -40,7 +40,7 @@ use OCP\Share\IShare; use Sabre\DAV\Tree; class SharesPluginTest extends \Test\TestCase { - const SHARETYPES_PROPERTYNAME = \OCA\DAV\Connector\Sabre\SharesPlugin::SHARETYPES_PROPERTYNAME; + public const SHARETYPES_PROPERTYNAME = \OCA\DAV\Connector\Sabre\SharesPlugin::SHARETYPES_PROPERTYNAME; /** * @var \Sabre\DAV\Server @@ -267,7 +267,7 @@ class SharesPluginTest extends \Test\TestCase { $this->assertEquals($shareTypes, $result[200][self::SHARETYPES_PROPERTYNAME]->getShareTypes()); } - function sharesGetPropertiesDataProvider() { + public function sharesGetPropertiesDataProvider() { return [ [[]], [[\OCP\Share::SHARE_TYPE_USER]], diff --git a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php index 0cfa9c5229c..210e732438c 100644 --- a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php @@ -41,9 +41,9 @@ use Sabre\DAV\Tree; * See the COPYING-README file. */ class TagsPluginTest extends \Test\TestCase { - const TAGS_PROPERTYNAME = \OCA\DAV\Connector\Sabre\TagsPlugin::TAGS_PROPERTYNAME; - const FAVORITE_PROPERTYNAME = \OCA\DAV\Connector\Sabre\TagsPlugin::FAVORITE_PROPERTYNAME; - const TAG_FAVORITE = \OCA\DAV\Connector\Sabre\TagsPlugin::TAG_FAVORITE; + public const TAGS_PROPERTYNAME = \OCA\DAV\Connector\Sabre\TagsPlugin::TAGS_PROPERTYNAME; + public const FAVORITE_PROPERTYNAME = \OCA\DAV\Connector\Sabre\TagsPlugin::FAVORITE_PROPERTYNAME; + public const TAG_FAVORITE = \OCA\DAV\Connector\Sabre\TagsPlugin::TAG_FAVORITE; /** * @var \Sabre\DAV\Server @@ -211,7 +211,7 @@ class TagsPluginTest extends \Test\TestCase { $this->assertEquals($expectedProperties, $result); } - function tagsGetPropertiesDataProvider() { + public function tagsGetPropertiesDataProvider() { return [ // request both, receive both [ diff --git a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php index cd7f4c24340..6aabb4845fe 100644 --- a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php +++ b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php @@ -87,6 +87,6 @@ class SapiMock extends Sapi { * * @return void */ - static function sendResponse(ResponseInterface $response) { + public static function sendResponse(ResponseInterface $response) { } } diff --git a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php index dc47c20f345..97e140a0ab7 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php @@ -43,12 +43,12 @@ use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; class SystemTagPluginTest extends \Test\TestCase { - const ID_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::ID_PROPERTYNAME; - const DISPLAYNAME_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::DISPLAYNAME_PROPERTYNAME; - const USERVISIBLE_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::USERVISIBLE_PROPERTYNAME; - const USERASSIGNABLE_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::USERASSIGNABLE_PROPERTYNAME; - const CANASSIGN_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::CANASSIGN_PROPERTYNAME; - const GROUPS_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::GROUPS_PROPERTYNAME; + public const ID_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::ID_PROPERTYNAME; + public const DISPLAYNAME_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::DISPLAYNAME_PROPERTYNAME; + public const USERVISIBLE_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::USERVISIBLE_PROPERTYNAME; + public const USERASSIGNABLE_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::USERASSIGNABLE_PROPERTYNAME; + public const CANASSIGN_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::CANASSIGN_PROPERTYNAME; + public const GROUPS_PROPERTYNAME = \OCA\DAV\SystemTag\SystemTagPlugin::GROUPS_PROPERTYNAME; /** * @var \Sabre\DAV\Server diff --git a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php index f7b34315106..d8ba21c47f9 100644 --- a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php +++ b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php @@ -72,7 +72,7 @@ class AssemblyStreamTest extends \Test\TestCase { $this->assertEquals(substr($expected, $offset), $content); } - function providesNodes() { + public function providesNodes() { $data8k = $this->makeData(8192); $dataLess8k = $this->makeData(8191); diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php index 24b1f21ecd0..fe12bfaf727 100644 --- a/apps/encryption/lib/Crypto/Crypt.php +++ b/apps/encryption/lib/Crypto/Crypt.php @@ -54,16 +54,16 @@ use OCP\IUserSession; * @package OCA\Encryption\Crypto */ class Crypt { - const DEFAULT_CIPHER = 'AES-256-CTR'; + public const DEFAULT_CIPHER = 'AES-256-CTR'; // default cipher from old Nextcloud versions - const LEGACY_CIPHER = 'AES-128-CFB'; + public const LEGACY_CIPHER = 'AES-128-CFB'; // default key format, old Nextcloud version encrypted the private key directly // with the user password - const LEGACY_KEY_FORMAT = 'password'; + public const LEGACY_KEY_FORMAT = 'password'; - const HEADER_START = 'HBEGIN'; - const HEADER_END = 'HEND'; + public const HEADER_START = 'HBEGIN'; + public const HEADER_END = 'HEND'; /** @var ILogger */ private $logger; diff --git a/apps/encryption/lib/Crypto/Encryption.php b/apps/encryption/lib/Crypto/Encryption.php index 57cf4e2edac..39dfece7629 100644 --- a/apps/encryption/lib/Crypto/Encryption.php +++ b/apps/encryption/lib/Crypto/Encryption.php @@ -45,8 +45,8 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class Encryption implements IEncryptionModule { - const ID = 'OC_DEFAULT_MODULE'; - const DISPLAY_NAME = 'Default encryption module'; + public const ID = 'OC_DEFAULT_MODULE'; + public const DISPLAY_NAME = 'Default encryption module'; /** * @var Crypt diff --git a/apps/encryption/lib/Session.php b/apps/encryption/lib/Session.php index 4398f9c4e0a..3c79cd29e17 100644 --- a/apps/encryption/lib/Session.php +++ b/apps/encryption/lib/Session.php @@ -34,9 +34,9 @@ class Session { /** @var ISession */ protected $session; - const NOT_INITIALIZED = '0'; - const INIT_EXECUTED = '1'; - const INIT_SUCCESSFUL = '2'; + public const NOT_INITIALIZED = '0'; + public const INIT_EXECUTED = '1'; + public const INIT_SUCCESSFUL = '2'; /** * @param ISession $session diff --git a/apps/encryption/lib/Settings/Personal.php b/apps/encryption/lib/Settings/Personal.php index 7ecf457e641..bd0e17f0282 100644 --- a/apps/encryption/lib/Settings/Personal.php +++ b/apps/encryption/lib/Settings/Personal.php @@ -30,7 +30,7 @@ use OCP\IConfig; use OCP\IUserSession; use OCP\Settings\ISettings; -class Personal implements ISettings { +class Personal implements ISettings { /** @var IConfig */ private $config; diff --git a/apps/encryption/tests/Controller/SettingsControllerTest.php b/apps/encryption/tests/Controller/SettingsControllerTest.php index 0cd69c8c1c4..f0935f1b788 100644 --- a/apps/encryption/tests/Controller/SettingsControllerTest.php +++ b/apps/encryption/tests/Controller/SettingsControllerTest.php @@ -245,7 +245,7 @@ class SettingsControllerTest extends TestCase { $data['message']); } - function testSetEncryptHomeStorage() { + public function testSetEncryptHomeStorage() { $value = true; $this->utilMock->expects($this->once())->method('setEncryptHomeStorage')->with($value); $this->controller->setEncryptHomeStorage($value); diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php index aaa3e27cfd2..228fab305b9 100644 --- a/apps/federatedfilesharing/lib/FederatedShareProvider.php +++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php @@ -58,7 +58,7 @@ use OCP\Share\IShareProvider; * @package OCA\FederatedFileSharing */ class FederatedShareProvider implements IShareProvider { - const SHARE_TYPE_REMOTE = 6; + public const SHARE_TYPE_REMOTE = 6; /** @var IDBConnection */ private $dbConnection; diff --git a/apps/federatedfilesharing/lib/Notifications.php b/apps/federatedfilesharing/lib/Notifications.php index 6d11ea65096..7b2105ecb0f 100644 --- a/apps/federatedfilesharing/lib/Notifications.php +++ b/apps/federatedfilesharing/lib/Notifications.php @@ -33,7 +33,7 @@ use OCP\Http\Client\IClientService; use OCP\OCS\IDiscoveryService; class Notifications { - const RESPONSE_FORMAT = 'json'; // default response format for ocs calls + public const RESPONSE_FORMAT = 'json'; // default response format for ocs calls /** @var AddressHandler */ private $addressHandler; diff --git a/apps/federatedfilesharing/lib/TokenHandler.php b/apps/federatedfilesharing/lib/TokenHandler.php index 3922765aeba..37645a855c8 100644 --- a/apps/federatedfilesharing/lib/TokenHandler.php +++ b/apps/federatedfilesharing/lib/TokenHandler.php @@ -30,7 +30,7 @@ use OCP\Security\ISecureRandom; * @package OCA\FederatedFileSharing */ class TokenHandler { - const TOKEN_LENGTH = 15; + public const TOKEN_LENGTH = 15; /** @var ISecureRandom */ private $secureRandom; diff --git a/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php b/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php index df138333de6..5674f700cb6 100644 --- a/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php +++ b/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php @@ -144,7 +144,7 @@ class RequestHandlerControllerTest extends \Test\TestCase { ); } - function testCreateShare() { + public function testCreateShare() { // simulate a post request $_POST['remote'] = 'localhost'; $_POST['token'] = 'token'; @@ -185,7 +185,7 @@ class RequestHandlerControllerTest extends \Test\TestCase { $this->assertInstanceOf(DataResponse::class, $result); } - function testDeclineShare() { + public function testDeclineShare() { $id = 42; $_POST['token'] = 'token'; @@ -209,7 +209,7 @@ class RequestHandlerControllerTest extends \Test\TestCase { } - function testAcceptShare() { + public function testAcceptShare() { $id = 42; $_POST['token'] = 'token'; diff --git a/apps/federatedfilesharing/tests/TestCase.php b/apps/federatedfilesharing/tests/TestCase.php index 813c3c8a15f..174197a1559 100644 --- a/apps/federatedfilesharing/tests/TestCase.php +++ b/apps/federatedfilesharing/tests/TestCase.php @@ -36,8 +36,8 @@ use OC\Group\Database; * Base class for sharing tests. */ abstract class TestCase extends \Test\TestCase { - const TEST_FILES_SHARING_API_USER1 = "test-share-user1"; - const TEST_FILES_SHARING_API_USER2 = "test-share-user2"; + public const TEST_FILES_SHARING_API_USER1 = "test-share-user1"; + public const TEST_FILES_SHARING_API_USER2 = "test-share-user2"; public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); diff --git a/apps/federation/lib/TrustedServers.php b/apps/federation/lib/TrustedServers.php index 3d659e7eb95..cc1913e9475 100644 --- a/apps/federation/lib/TrustedServers.php +++ b/apps/federation/lib/TrustedServers.php @@ -42,13 +42,13 @@ use Symfony\Component\EventDispatcher\GenericEvent; class TrustedServers { /** after a user list was exchanged at least once successfully */ - const STATUS_OK = 1; + public const STATUS_OK = 1; /** waiting for shared secret or initial user list exchange */ - const STATUS_PENDING = 2; + public const STATUS_PENDING = 2; /** something went wrong, misconfigured server, software bug,... user interaction needed */ - const STATUS_FAILURE = 3; + public const STATUS_FAILURE = 3; /** remote server revoked access */ - const STATUS_ACCESS_REVOKED = 4; + public const STATUS_ACCESS_REVOKED = 4; /** @var dbHandler */ private $dbHandler; diff --git a/apps/files/lib/Activity/FavoriteProvider.php b/apps/files/lib/Activity/FavoriteProvider.php index 9cf1255765b..8692b83f008 100644 --- a/apps/files/lib/Activity/FavoriteProvider.php +++ b/apps/files/lib/Activity/FavoriteProvider.php @@ -32,8 +32,8 @@ use OCP\IURLGenerator; use OCP\L10N\IFactory; class FavoriteProvider implements IProvider { - const SUBJECT_ADDED = 'added_favorite'; - const SUBJECT_REMOVED = 'removed_favorite'; + public const SUBJECT_ADDED = 'added_favorite'; + public const SUBJECT_REMOVED = 'removed_favorite'; /** @var IFactory */ protected $languageFactory; diff --git a/apps/files/lib/Activity/Helper.php b/apps/files/lib/Activity/Helper.php index df9ed7af909..c274df2ccbb 100644 --- a/apps/files/lib/Activity/Helper.php +++ b/apps/files/lib/Activity/Helper.php @@ -27,7 +27,7 @@ use OCP\ITagManager; class Helper { /** If a user has a lot of favorites the query might get too slow and long */ - const FAVORITE_LIMIT = 50; + public const FAVORITE_LIMIT = 50; /** @var ITagManager */ protected $tagManager; diff --git a/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php b/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php index b0f91b70401..ca890269a93 100644 --- a/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php +++ b/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php @@ -31,7 +31,7 @@ use OCP\DB\QueryBuilder\IQueryBuilder; * Delete all share entries that have no matching entries in the file cache table. */ class DeleteOrphanedItems extends TimedJob { - const CHUNK_SIZE = 200; + public const CHUNK_SIZE = 200; /** @var \OCP\IDBConnection */ protected $connection; diff --git a/apps/files/lib/BackgroundJob/ScanFiles.php b/apps/files/lib/BackgroundJob/ScanFiles.php index f1ff1a633ef..b9f37ca8116 100644 --- a/apps/files/lib/BackgroundJob/ScanFiles.php +++ b/apps/files/lib/BackgroundJob/ScanFiles.php @@ -48,7 +48,7 @@ class ScanFiles extends \OC\BackgroundJob\TimedJob { private $logger; /** Amount of users that should get scanned per execution */ - const USERS_PER_SESSION = 500; + public const USERS_PER_SESSION = 500; /** * @param IConfig|null $config diff --git a/apps/files/lib/Command/DeleteOrphanedFiles.php b/apps/files/lib/Command/DeleteOrphanedFiles.php index c5072983ef4..855958511d7 100644 --- a/apps/files/lib/Command/DeleteOrphanedFiles.php +++ b/apps/files/lib/Command/DeleteOrphanedFiles.php @@ -32,7 +32,7 @@ use Symfony\Component\Console\Output\OutputInterface; * Delete all file entries that have no matching entries in the storage table. */ class DeleteOrphanedFiles extends Command { - const CHUNK_SIZE = 200; + public const CHUNK_SIZE = 200; /** * @var IDBConnection diff --git a/apps/files/tests/HelperTest.php b/apps/files/tests/HelperTest.php index 867d2dab4b0..974d1187f2a 100644 --- a/apps/files/tests/HelperTest.php +++ b/apps/files/tests/HelperTest.php @@ -61,7 +61,7 @@ class HelperTest extends \Test\TestCase { ]; } - function sortDataProvider() { + public function sortDataProvider() { return [ [ 'name', diff --git a/apps/files_external/lib/Command/Applicable.php b/apps/files_external/lib/Command/Applicable.php index 8dfbf396a20..0e28d2bf79f 100644 --- a/apps/files_external/lib/Command/Applicable.php +++ b/apps/files_external/lib/Command/Applicable.php @@ -51,7 +51,7 @@ class Applicable extends Base { */ private $groupManager; - function __construct( + public function __construct( GlobalStoragesService $globalService, IUserManager $userManager, IGroupManager $groupManager diff --git a/apps/files_external/lib/Command/Backends.php b/apps/files_external/lib/Command/Backends.php index 5618b3fd16d..3e51f6d3b08 100644 --- a/apps/files_external/lib/Command/Backends.php +++ b/apps/files_external/lib/Command/Backends.php @@ -35,7 +35,7 @@ class Backends extends Base { /** @var BackendService */ private $backendService; - function __construct(BackendService $backendService + public function __construct(BackendService $backendService ) { parent::__construct(); diff --git a/apps/files_external/lib/Command/Config.php b/apps/files_external/lib/Command/Config.php index f58b1561e68..a42689ddec1 100644 --- a/apps/files_external/lib/Command/Config.php +++ b/apps/files_external/lib/Command/Config.php @@ -38,7 +38,7 @@ class Config extends Base { */ protected $globalService; - function __construct(GlobalStoragesService $globalService) { + public function __construct(GlobalStoragesService $globalService) { parent::__construct(); $this->globalService = $globalService; } diff --git a/apps/files_external/lib/Command/Create.php b/apps/files_external/lib/Command/Create.php index 7926da60b9e..a094ff49572 100644 --- a/apps/files_external/lib/Command/Create.php +++ b/apps/files_external/lib/Command/Create.php @@ -64,7 +64,7 @@ class Create extends Base { /** @var IUserSession */ private $userSession; - function __construct(GlobalStoragesService $globalService, + public function __construct(GlobalStoragesService $globalService, UserStoragesService $userService, IUserManager $userManager, IUserSession $userSession, diff --git a/apps/files_external/lib/Command/Delete.php b/apps/files_external/lib/Command/Delete.php index 21f4217445d..f8bef4c79ac 100644 --- a/apps/files_external/lib/Command/Delete.php +++ b/apps/files_external/lib/Command/Delete.php @@ -58,7 +58,7 @@ class Delete extends Base { */ protected $userManager; - function __construct(GlobalStoragesService $globalService, UserStoragesService $userService, IUserSession $userSession, IUserManager $userManager) { + public function __construct(GlobalStoragesService $globalService, UserStoragesService $userService, IUserSession $userSession, IUserManager $userManager) { parent::__construct(); $this->globalService = $globalService; $this->userService = $userService; diff --git a/apps/files_external/lib/Command/Import.php b/apps/files_external/lib/Command/Import.php index e006bb9f560..a1f61bd9f1d 100644 --- a/apps/files_external/lib/Command/Import.php +++ b/apps/files_external/lib/Command/Import.php @@ -66,7 +66,7 @@ class Import extends Base { /** @var BackendService */ private $backendService; - function __construct(GlobalStoragesService $globalService, + public function __construct(GlobalStoragesService $globalService, UserStoragesService $userService, IUserSession $userSession, IUserManager $userManager, diff --git a/apps/files_external/lib/Command/ListCommand.php b/apps/files_external/lib/Command/ListCommand.php index 6fa493a6598..b238b33f6a4 100644 --- a/apps/files_external/lib/Command/ListCommand.php +++ b/apps/files_external/lib/Command/ListCommand.php @@ -58,9 +58,9 @@ class ListCommand extends Base { */ protected $userManager; - const ALL = -1; + public const ALL = -1; - function __construct(GlobalStoragesService $globalService, UserStoragesService $userService, IUserSession $userSession, IUserManager $userManager) { + public function __construct(GlobalStoragesService $globalService, UserStoragesService $userService, IUserSession $userSession, IUserManager $userManager) { parent::__construct(); $this->globalService = $globalService; $this->userService = $userService; diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php index 6b83c570c67..96b39de6e1e 100644 --- a/apps/files_external/lib/Command/Notify.php +++ b/apps/files_external/lib/Command/Notify.php @@ -52,7 +52,7 @@ class Notify extends Base { /** @var ILogger */ private $logger; - function __construct(GlobalStoragesService $globalService, IDBConnection $connection, ILogger $logger) { + public function __construct(GlobalStoragesService $globalService, IDBConnection $connection, ILogger $logger) { parent::__construct(); $this->globalService = $globalService; $this->connection = $connection; diff --git a/apps/files_external/lib/Command/Verify.php b/apps/files_external/lib/Command/Verify.php index 062a0c6ea5f..bd80c2267e7 100644 --- a/apps/files_external/lib/Command/Verify.php +++ b/apps/files_external/lib/Command/Verify.php @@ -42,7 +42,7 @@ class Verify extends Base { */ protected $globalService; - function __construct(GlobalStoragesService $globalService) { + public function __construct(GlobalStoragesService $globalService) { parent::__construct(); $this->globalService = $globalService; } diff --git a/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php b/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php index 4822789ba2b..cd72634e58a 100644 --- a/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php +++ b/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php @@ -32,7 +32,7 @@ use OCP\IL10N; * Amazon S3 access key authentication */ class AccessKey extends AuthMechanism { - const SCHEME_AMAZONS3_ACCESSKEY = 'amazons3_accesskey'; + public const SCHEME_AMAZONS3_ACCESSKEY = 'amazons3_accesskey'; public function __construct(IL10N $l) { $this diff --git a/apps/files_external/lib/Lib/Auth/AuthMechanism.php b/apps/files_external/lib/Lib/Auth/AuthMechanism.php index c13774ea5e0..5a693b75dbf 100644 --- a/apps/files_external/lib/Lib/Auth/AuthMechanism.php +++ b/apps/files_external/lib/Lib/Auth/AuthMechanism.php @@ -52,14 +52,14 @@ use OCA\Files_External\Lib\VisibilityTrait; */ class AuthMechanism implements \JsonSerializable { /** Standard authentication schemes */ - const SCHEME_NULL = 'null'; - const SCHEME_BUILTIN = 'builtin'; - const SCHEME_PASSWORD = 'password'; - const SCHEME_OAUTH1 = 'oauth1'; - const SCHEME_OAUTH2 = 'oauth2'; - const SCHEME_PUBLICKEY = 'publickey'; - const SCHEME_OPENSTACK = 'openstack'; - const SCHEME_SMB = 'smb'; + public const SCHEME_NULL = 'null'; + public const SCHEME_BUILTIN = 'builtin'; + public const SCHEME_PASSWORD = 'password'; + public const SCHEME_OAUTH1 = 'oauth1'; + public const SCHEME_OAUTH2 = 'oauth2'; + public const SCHEME_PUBLICKEY = 'publickey'; + public const SCHEME_OPENSTACK = 'openstack'; + public const SCHEME_SMB = 'smb'; use VisibilityTrait; use FrontendDefinitionTrait; diff --git a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php index de6e34c4443..34b1b747bfe 100644 --- a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php +++ b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php @@ -36,7 +36,7 @@ use OCP\Security\ICredentialsManager; * Global Username and Password */ class GlobalAuth extends AuthMechanism { - const CREDENTIALS_IDENTIFIER = 'password::global'; + public const CREDENTIALS_IDENTIFIER = 'password::global'; /** @var ICredentialsManager */ protected $credentialsManager; diff --git a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php index 0165bb6d077..8d06707b2af 100644 --- a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php +++ b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php @@ -35,7 +35,7 @@ use OCP\Security\ICredentialsManager; * Username and password from login credentials, saved in DB */ class LoginCredentials extends AuthMechanism { - const CREDENTIALS_IDENTIFIER = 'password::logincredentials/credentials'; + public const CREDENTIALS_IDENTIFIER = 'password::logincredentials/credentials'; /** @var ISession */ protected $session; diff --git a/apps/files_external/lib/Lib/Auth/Password/UserProvided.php b/apps/files_external/lib/Lib/Auth/Password/UserProvided.php index 552b707b544..429e0f1c261 100644 --- a/apps/files_external/lib/Lib/Auth/Password/UserProvided.php +++ b/apps/files_external/lib/Lib/Auth/Password/UserProvided.php @@ -37,7 +37,7 @@ use OCP\Security\ICredentialsManager; * User provided Username and Password */ class UserProvided extends AuthMechanism implements IUserProvided { - const CREDENTIALS_IDENTIFIER_PREFIX = 'password::userprovided/'; + public const CREDENTIALS_IDENTIFIER_PREFIX = 'password::userprovided/'; /** @var ICredentialsManager */ protected $credentialsManager; diff --git a/apps/files_external/lib/Lib/Backend/InvalidBackend.php b/apps/files_external/lib/Lib/Backend/InvalidBackend.php index fc9b0992197..36e033cfc90 100644 --- a/apps/files_external/lib/Lib/Backend/InvalidBackend.php +++ b/apps/files_external/lib/Lib/Backend/InvalidBackend.php @@ -43,7 +43,7 @@ class InvalidBackend extends Backend { * * @param string $invalidId id of the backend that did not exist */ - function __construct($invalidId) { + public function __construct($invalidId) { $this->invalidId = $invalidId; $this ->setIdentifier($invalidId) diff --git a/apps/files_external/lib/Lib/DefinitionParameter.php b/apps/files_external/lib/Lib/DefinitionParameter.php index 2e1ce7fb1dd..519de22d70d 100644 --- a/apps/files_external/lib/Lib/DefinitionParameter.php +++ b/apps/files_external/lib/Lib/DefinitionParameter.php @@ -29,18 +29,18 @@ namespace OCA\Files_External\Lib; class DefinitionParameter implements \JsonSerializable { // placeholder value for password fields, when the client updates a storage configuration // placeholder values are ignored and the field is left unmodified - const UNMODIFIED_PLACEHOLDER = '__unmodified__'; + public const UNMODIFIED_PLACEHOLDER = '__unmodified__'; /** Value constants */ - const VALUE_TEXT = 0; - const VALUE_BOOLEAN = 1; - const VALUE_PASSWORD = 2; - const VALUE_HIDDEN = 3; + public const VALUE_TEXT = 0; + public const VALUE_BOOLEAN = 1; + public const VALUE_PASSWORD = 2; + public const VALUE_HIDDEN = 3; /** Flag constants */ - const FLAG_NONE = 0; - const FLAG_OPTIONAL = 1; - const FLAG_USER_PROVIDED = 2; + public const FLAG_NONE = 0; + public const FLAG_OPTIONAL = 1; + public const FLAG_USER_PROVIDED = 2; /** @var string name of parameter */ private $name; diff --git a/apps/files_external/lib/Lib/Storage/OwnCloud.php b/apps/files_external/lib/Lib/Storage/OwnCloud.php index d8e3ee321b7..8125d87d9ee 100644 --- a/apps/files_external/lib/Lib/Storage/OwnCloud.php +++ b/apps/files_external/lib/Lib/Storage/OwnCloud.php @@ -39,7 +39,7 @@ use Sabre\DAV\Client; * */ class OwnCloud extends \OC\Files\Storage\DAV implements IDisableEncryptionStorage { - const OC_URL_SUFFIX = 'remote.php/webdav'; + public const OC_URL_SUFFIX = 'remote.php/webdav'; public function __construct($params) { // extract context path from host if specified diff --git a/apps/files_external/lib/Lib/Storage/SFTPReadStream.php b/apps/files_external/lib/Lib/Storage/SFTPReadStream.php index a3023d1a22b..a1e3696a46e 100644 --- a/apps/files_external/lib/Lib/Storage/SFTPReadStream.php +++ b/apps/files_external/lib/Lib/Storage/SFTPReadStream.php @@ -50,7 +50,7 @@ class SFTPReadStream implements File { private $buffer = ''; - static function register($protocol = 'sftpread') { + public static function register($protocol = 'sftpread') { if (in_array($protocol, stream_get_wrappers(), true)) { return false; } diff --git a/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php b/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php index 50faf8f466c..c817789dad6 100644 --- a/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php +++ b/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php @@ -50,7 +50,7 @@ class SFTPWriteStream implements File { private $buffer = ''; - static function register($protocol = 'sftpwrite') { + public static function register($protocol = 'sftpwrite') { if (in_array($protocol, stream_get_wrappers(), true)) { return false; } diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php index 96fb4f0ac9a..3ecb73f54af 100644 --- a/apps/files_external/lib/Lib/Storage/Swift.php +++ b/apps/files_external/lib/Lib/Storage/Swift.php @@ -101,7 +101,7 @@ class Swift extends \OC\Files\Storage\Common { return $path; } - const SUBCONTAINER_FILE = '.subcontainers'; + public const SUBCONTAINER_FILE = '.subcontainers'; /** * translate directory path to container name diff --git a/apps/files_external/lib/Lib/StorageConfig.php b/apps/files_external/lib/Lib/StorageConfig.php index 5ed65918b22..43d95b8232a 100644 --- a/apps/files_external/lib/Lib/StorageConfig.php +++ b/apps/files_external/lib/Lib/StorageConfig.php @@ -36,8 +36,8 @@ use OCA\Files_External\Lib\Backend\Backend; * External storage configuration */ class StorageConfig implements \JsonSerializable { - const MOUNT_TYPE_ADMIN = 1; - const MOUNT_TYPE_PERSONAl = 2; + public const MOUNT_TYPE_ADMIN = 1; + public const MOUNT_TYPE_PERSONAl = 2; /** * Storage config id diff --git a/apps/files_external/lib/Service/BackendService.php b/apps/files_external/lib/Service/BackendService.php index 617b44651ae..d89e782f6f6 100644 --- a/apps/files_external/lib/Service/BackendService.php +++ b/apps/files_external/lib/Service/BackendService.php @@ -41,15 +41,15 @@ use OCP\IConfig; class BackendService { /** Visibility constants for VisibilityTrait */ - const VISIBILITY_NONE = 0; - const VISIBILITY_PERSONAL = 1; - const VISIBILITY_ADMIN = 2; + public const VISIBILITY_NONE = 0; + public const VISIBILITY_PERSONAL = 1; + public const VISIBILITY_ADMIN = 2; //const VISIBILITY_ALIENS = 4; - const VISIBILITY_DEFAULT = 3; // PERSONAL | ADMIN + public const VISIBILITY_DEFAULT = 3; // PERSONAL | ADMIN /** Priority constants for PriorityTrait */ - const PRIORITY_DEFAULT = 100; + public const PRIORITY_DEFAULT = 100; /** @var IConfig */ protected $config; diff --git a/apps/files_external/lib/Service/DBConfigService.php b/apps/files_external/lib/Service/DBConfigService.php index 51373e8dda6..7a4579fd3f7 100644 --- a/apps/files_external/lib/Service/DBConfigService.php +++ b/apps/files_external/lib/Service/DBConfigService.php @@ -36,12 +36,12 @@ use OCP\Security\ICrypto; * Stores the mount config in the database */ class DBConfigService { - const MOUNT_TYPE_ADMIN = 1; - const MOUNT_TYPE_PERSONAl = 2; + public const MOUNT_TYPE_ADMIN = 1; + public const MOUNT_TYPE_PERSONAl = 2; - const APPLICABLE_TYPE_GLOBAL = 1; - const APPLICABLE_TYPE_GROUP = 2; - const APPLICABLE_TYPE_USER = 3; + public const APPLICABLE_TYPE_GLOBAL = 1; + public const APPLICABLE_TYPE_GROUP = 2; + public const APPLICABLE_TYPE_USER = 3; /** * @var IDBConnection diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index c69955c3406..745f2da6d5e 100644 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -60,10 +60,10 @@ use phpseclib\Crypt\AES; class OC_Mount_Config { // TODO: make this class non-static and give it a proper namespace - const MOUNT_TYPE_GLOBAL = 'global'; - const MOUNT_TYPE_GROUP = 'group'; - const MOUNT_TYPE_USER = 'user'; - const MOUNT_TYPE_PERSONAL = 'personal'; + public const MOUNT_TYPE_GLOBAL = 'global'; + public const MOUNT_TYPE_GROUP = 'group'; + public const MOUNT_TYPE_USER = 'user'; + public const MOUNT_TYPE_PERSONAL = 'personal'; // whether to skip backend test (for unit tests, as this static class is not mockable) public static $skipTest = false; diff --git a/apps/files_external/tests/Controller/StoragesControllerTest.php b/apps/files_external/tests/Controller/StoragesControllerTest.php index 40d0154d992..617ad11c459 100644 --- a/apps/files_external/tests/Controller/StoragesControllerTest.php +++ b/apps/files_external/tests/Controller/StoragesControllerTest.php @@ -173,7 +173,7 @@ abstract class StoragesControllerTest extends \Test\TestCase { $this->assertEquals($storageConfig, $data); } - function mountPointNamesProvider() { + public function mountPointNamesProvider() { return [ [''], ['/'], diff --git a/apps/files_external/tests/OwnCloudFunctionsTest.php b/apps/files_external/tests/OwnCloudFunctionsTest.php index 7ce72ce62d6..47544312576 100644 --- a/apps/files_external/tests/OwnCloudFunctionsTest.php +++ b/apps/files_external/tests/OwnCloudFunctionsTest.php @@ -35,7 +35,7 @@ namespace OCA\Files_External\Tests; * @package OCA\Files_External\Tests */ class OwnCloudFunctionsTest extends \Test\TestCase { - function configUrlProvider() { + public function configUrlProvider() { return [ [ [ diff --git a/apps/files_external/tests/Service/GlobalStoragesServiceTest.php b/apps/files_external/tests/Service/GlobalStoragesServiceTest.php index b977a4b3eb6..e35649dacf5 100644 --- a/apps/files_external/tests/Service/GlobalStoragesServiceTest.php +++ b/apps/files_external/tests/Service/GlobalStoragesServiceTest.php @@ -63,7 +63,7 @@ class GlobalStoragesServiceTest extends StoragesServiceTest { ]); } - function storageDataProvider() { + public function storageDataProvider() { return [ // all users [ @@ -191,7 +191,7 @@ class GlobalStoragesServiceTest extends StoragesServiceTest { $this->assertEquals(0, $newStorage->getStatus()); } - function hooksAddStorageDataProvider() { + public function hooksAddStorageDataProvider() { return [ // applicable all [ @@ -320,7 +320,7 @@ class GlobalStoragesServiceTest extends StoragesServiceTest { } } - function hooksUpdateStorageDataProvider() { + public function hooksUpdateStorageDataProvider() { return [ [ // nothing to multiple users and groups @@ -551,7 +551,7 @@ class GlobalStoragesServiceTest extends StoragesServiceTest { } } - function hooksDeleteStorageDataProvider() { + public function hooksDeleteStorageDataProvider() { return [ [ ['user1', 'user2'], diff --git a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php index c23d741b23d..f99b25a9fc7 100644 --- a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php +++ b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php @@ -57,9 +57,9 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { protected $user; - const USER_ID = 'test_user'; - const GROUP_ID = 'test_group'; - const GROUP_ID2 = 'test_group2'; + public const USER_ID = 'test_user'; + public const GROUP_ID = 'test_group'; + public const GROUP_ID2 = 'test_group2'; protected function setUp(): void { parent::setUp(); diff --git a/apps/files_sharing/lib/Activity/Filter.php b/apps/files_sharing/lib/Activity/Filter.php index 4df53745c7b..4997482bddb 100644 --- a/apps/files_sharing/lib/Activity/Filter.php +++ b/apps/files_sharing/lib/Activity/Filter.php @@ -28,8 +28,8 @@ use OCP\IL10N; use OCP\IURLGenerator; class Filter implements IFilter { - const TYPE_REMOTE_SHARE = 'remote_share'; - const TYPE_SHARED = 'shared'; + public const TYPE_REMOTE_SHARE = 'remote_share'; + public const TYPE_SHARED = 'shared'; /** @var IL10N */ protected $l; diff --git a/apps/files_sharing/lib/Activity/Providers/Downloads.php b/apps/files_sharing/lib/Activity/Providers/Downloads.php index 23c55e08a26..acb4ce3837a 100644 --- a/apps/files_sharing/lib/Activity/Providers/Downloads.php +++ b/apps/files_sharing/lib/Activity/Providers/Downloads.php @@ -26,11 +26,11 @@ namespace OCA\Files_Sharing\Activity\Providers; use OCP\Activity\IEvent; class Downloads extends Base { - const SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED = 'public_shared_file_downloaded'; - const SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED = 'public_shared_folder_downloaded'; + public const SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED = 'public_shared_file_downloaded'; + public const SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED = 'public_shared_folder_downloaded'; - const SUBJECT_SHARED_FILE_BY_EMAIL_DOWNLOADED = 'file_shared_with_email_downloaded'; - const SUBJECT_SHARED_FOLDER_BY_EMAIL_DOWNLOADED = 'folder_shared_with_email_downloaded'; + public const SUBJECT_SHARED_FILE_BY_EMAIL_DOWNLOADED = 'file_shared_with_email_downloaded'; + public const SUBJECT_SHARED_FOLDER_BY_EMAIL_DOWNLOADED = 'folder_shared_with_email_downloaded'; /** * @param IEvent $event diff --git a/apps/files_sharing/lib/Activity/Providers/Groups.php b/apps/files_sharing/lib/Activity/Providers/Groups.php index c6115a8dba0..dfc3e6b521d 100644 --- a/apps/files_sharing/lib/Activity/Providers/Groups.php +++ b/apps/files_sharing/lib/Activity/Providers/Groups.php @@ -35,13 +35,13 @@ use OCP\IUserManager; use OCP\L10N\IFactory; class Groups extends Base { - const SUBJECT_SHARED_GROUP_SELF = 'shared_group_self'; - const SUBJECT_RESHARED_GROUP_BY = 'reshared_group_by'; + public const SUBJECT_SHARED_GROUP_SELF = 'shared_group_self'; + public const SUBJECT_RESHARED_GROUP_BY = 'reshared_group_by'; - const SUBJECT_UNSHARED_GROUP_SELF = 'unshared_group_self'; - const SUBJECT_UNSHARED_GROUP_BY = 'unshared_group_by'; + public const SUBJECT_UNSHARED_GROUP_SELF = 'unshared_group_self'; + public const SUBJECT_UNSHARED_GROUP_BY = 'unshared_group_by'; - const SUBJECT_EXPIRED_GROUP = 'expired_group'; + public const SUBJECT_EXPIRED_GROUP = 'expired_group'; /** @var IGroupManager */ protected $groupManager; diff --git a/apps/files_sharing/lib/Activity/Providers/PublicLinks.php b/apps/files_sharing/lib/Activity/Providers/PublicLinks.php index 0ebe6cdec0f..884296e46f5 100644 --- a/apps/files_sharing/lib/Activity/Providers/PublicLinks.php +++ b/apps/files_sharing/lib/Activity/Providers/PublicLinks.php @@ -26,12 +26,12 @@ namespace OCA\Files_Sharing\Activity\Providers; use OCP\Activity\IEvent; class PublicLinks extends Base { - const SUBJECT_SHARED_LINK_SELF = 'shared_link_self'; - const SUBJECT_RESHARED_LINK_BY = 'reshared_link_by'; - const SUBJECT_UNSHARED_LINK_SELF = 'unshared_link_self'; - const SUBJECT_UNSHARED_LINK_BY = 'unshared_link_by'; - const SUBJECT_LINK_EXPIRED = 'link_expired'; - const SUBJECT_LINK_BY_EXPIRED = 'link_by_expired'; + public const SUBJECT_SHARED_LINK_SELF = 'shared_link_self'; + public const SUBJECT_RESHARED_LINK_BY = 'reshared_link_by'; + public const SUBJECT_UNSHARED_LINK_SELF = 'unshared_link_self'; + public const SUBJECT_UNSHARED_LINK_BY = 'unshared_link_by'; + public const SUBJECT_LINK_EXPIRED = 'link_expired'; + public const SUBJECT_LINK_BY_EXPIRED = 'link_by_expired'; /** * @param IEvent $event diff --git a/apps/files_sharing/lib/Activity/Providers/RemoteShares.php b/apps/files_sharing/lib/Activity/Providers/RemoteShares.php index 2604288d448..4a297fcf060 100644 --- a/apps/files_sharing/lib/Activity/Providers/RemoteShares.php +++ b/apps/files_sharing/lib/Activity/Providers/RemoteShares.php @@ -33,10 +33,10 @@ use OCP\IUserManager; use OCP\L10N\IFactory; class RemoteShares extends Base { - const SUBJECT_REMOTE_SHARE_ACCEPTED = 'remote_share_accepted'; - const SUBJECT_REMOTE_SHARE_DECLINED = 'remote_share_declined'; - const SUBJECT_REMOTE_SHARE_RECEIVED = 'remote_share_received'; - const SUBJECT_REMOTE_SHARE_UNSHARED = 'remote_share_unshared'; + public const SUBJECT_REMOTE_SHARE_ACCEPTED = 'remote_share_accepted'; + public const SUBJECT_REMOTE_SHARE_DECLINED = 'remote_share_declined'; + public const SUBJECT_REMOTE_SHARE_RECEIVED = 'remote_share_received'; + public const SUBJECT_REMOTE_SHARE_UNSHARED = 'remote_share_unshared'; public function __construct(IFactory $languageFactory, IURLGenerator $url, diff --git a/apps/files_sharing/lib/Activity/Providers/Users.php b/apps/files_sharing/lib/Activity/Providers/Users.php index aff5feddc01..8f90ffdf567 100644 --- a/apps/files_sharing/lib/Activity/Providers/Users.php +++ b/apps/files_sharing/lib/Activity/Providers/Users.php @@ -28,18 +28,18 @@ namespace OCA\Files_Sharing\Activity\Providers; use OCP\Activity\IEvent; class Users extends Base { - const SUBJECT_SHARED_USER_SELF = 'shared_user_self'; - const SUBJECT_RESHARED_USER_BY = 'reshared_user_by'; - const SUBJECT_UNSHARED_USER_SELF = 'unshared_user_self'; - const SUBJECT_UNSHARED_USER_BY = 'unshared_user_by'; + public const SUBJECT_SHARED_USER_SELF = 'shared_user_self'; + public const SUBJECT_RESHARED_USER_BY = 'reshared_user_by'; + public const SUBJECT_UNSHARED_USER_SELF = 'unshared_user_self'; + public const SUBJECT_UNSHARED_USER_BY = 'unshared_user_by'; - const SUBJECT_SHARED_WITH_BY = 'shared_with_by'; - const SUBJECT_UNSHARED_BY = 'unshared_by'; - const SUBJECT_SELF_UNSHARED = 'self_unshared'; - const SUBJECT_SELF_UNSHARED_BY = 'self_unshared_by'; + public const SUBJECT_SHARED_WITH_BY = 'shared_with_by'; + public const SUBJECT_UNSHARED_BY = 'unshared_by'; + public const SUBJECT_SELF_UNSHARED = 'self_unshared'; + public const SUBJECT_SELF_UNSHARED_BY = 'self_unshared_by'; - const SUBJECT_EXPIRED_USER = 'expired_user'; - const SUBJECT_EXPIRED = 'expired'; + public const SUBJECT_EXPIRED_USER = 'expired_user'; + public const SUBJECT_EXPIRED = 'expired'; /** * @param IEvent $event diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php index 2902b820af3..34db7441daa 100644 --- a/apps/files_sharing/lib/AppInfo/Application.php +++ b/apps/files_sharing/lib/AppInfo/Application.php @@ -65,7 +65,7 @@ use OCP\Util; use Symfony\Component\EventDispatcher\GenericEvent; class Application extends App { - const APP_ID = 'files_sharing'; + public const APP_ID = 'files_sharing'; public function __construct(array $urlParams = []) { parent::__construct(self::APP_ID, $urlParams); diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index 3923fdf09d3..8331787c6df 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -48,7 +48,7 @@ use OCP\Share; use OCP\Share\IShare; class Manager { - const STORAGE = '\OCA\Files_Sharing\External\Storage'; + public const STORAGE = '\OCA\Files_Sharing\External\Storage'; /** * @var string diff --git a/apps/files_sharing/lib/External/MountProvider.php b/apps/files_sharing/lib/External/MountProvider.php index 992aba48c66..5d26bf20b47 100644 --- a/apps/files_sharing/lib/External/MountProvider.php +++ b/apps/files_sharing/lib/External/MountProvider.php @@ -30,7 +30,7 @@ use OCP\IDBConnection; use OCP\IUser; class MountProvider implements IMountProvider { - const STORAGE = '\OCA\Files_Sharing\External\Storage'; + public const STORAGE = '\OCA\Files_Sharing\External\Storage'; /** * @var \OCP\IDBConnection diff --git a/apps/files_sharing/lib/ShareBackend/File.php b/apps/files_sharing/lib/ShareBackend/File.php index 2db6c374c85..a15391162ff 100644 --- a/apps/files_sharing/lib/ShareBackend/File.php +++ b/apps/files_sharing/lib/ShareBackend/File.php @@ -37,13 +37,13 @@ namespace OCA\Files_Sharing\ShareBackend; use OCA\FederatedFileSharing\FederatedShareProvider; class File implements \OCP\Share_Backend_File_Dependent { - const FORMAT_SHARED_STORAGE = 0; - const FORMAT_GET_FOLDER_CONTENTS = 1; - const FORMAT_FILE_APP_ROOT = 2; - const FORMAT_OPENDIR = 3; - const FORMAT_GET_ALL = 4; - const FORMAT_PERMISSIONS = 5; - const FORMAT_TARGET_NAMES = 6; + public const FORMAT_SHARED_STORAGE = 0; + public const FORMAT_GET_FOLDER_CONTENTS = 1; + public const FORMAT_FILE_APP_ROOT = 2; + public const FORMAT_OPENDIR = 3; + public const FORMAT_GET_ALL = 4; + public const FORMAT_PERMISSIONS = 5; + public const FORMAT_TARGET_NAMES = 6; private $path; diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php index 828453be765..1e290e28f77 100644 --- a/apps/files_sharing/lib/Updater.php +++ b/apps/files_sharing/lib/Updater.php @@ -31,7 +31,7 @@ class Updater { /** * @param array $params */ - static public function renameHook($params) { + public static function renameHook($params) { self::renameChildren($params['oldpath'], $params['newpath']); self::moveShareToShare($params['newpath']); } @@ -46,7 +46,7 @@ class Updater { * * @param string $path */ - static private function moveShareToShare($path) { + private static function moveShareToShare($path) { $userFolder = \OC::$server->getUserFolder(); // If the user folder can't be constructed (e.g. link share) just return. @@ -90,7 +90,7 @@ class Updater { * @param string $oldPath old path relative to data/user/files * @param string $newPath new path relative to data/user/files */ - static private function renameChildren($oldPath, $newPath) { + private static function renameChildren($oldPath, $newPath) { $absNewPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $newPath); $absOldPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $oldPath); diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index 2d262a0104a..6bbb62d6090 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -53,8 +53,8 @@ use OCP\Share\IShare; * TODO: convert to real intergration tests */ class ApiTest extends TestCase { - const TEST_FOLDER_NAME = '/folder_share_api_test'; - const APP_NAME = 'files_sharing'; + public const TEST_FOLDER_NAME = '/folder_share_api_test'; + public const APP_NAME = 'files_sharing'; private static $tempStorage; @@ -130,7 +130,7 @@ class ApiTest extends TestCase { ); } - function testCreateShareUserFile() { + public function testCreateShareUserFile() { $this->setUp(); // for some reasons phpunit refuses to do this for us only for this test $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2); @@ -148,7 +148,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); } - function testCreateShareUserFolder() { + public function testCreateShareUserFolder() { $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2); $ocs->cleanup(); @@ -165,7 +165,7 @@ class ApiTest extends TestCase { } - function testCreateShareGroupFile() { + public function testCreateShareGroupFile() { $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_GROUP, self::TEST_FILES_SHARING_API_GROUP1); $ocs->cleanup(); @@ -181,7 +181,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); } - function testCreateShareGroupFolder() { + public function testCreateShareGroupFolder() { $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_GROUP, self::TEST_FILES_SHARING_API_GROUP1); $ocs->cleanup(); @@ -245,7 +245,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); } - function testEnforceLinkPassword() { + public function testEnforceLinkPassword() { $password = md5(time()); $config = \OC::$server->getConfig(); $config->setAppValue('core', 'shareapi_enforce_links_password', 'yes'); @@ -299,7 +299,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testSharePermissions() { + public function testSharePermissions() { // sharing file to a user should work if shareapi_exclude_groups is set // to no \OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups', 'no'); @@ -350,7 +350,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testGetAllShares() { + public function testGetAllShares() { $node = $this->userFolder->get($this->filename); $share = $this->shareManager->newShare(); @@ -371,7 +371,7 @@ class ApiTest extends TestCase { $this->shareManager->deleteShare($share); } - function testGetAllSharesWithMe() { + public function testGetAllSharesWithMe() { $node1 = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -407,7 +407,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testPublicLinkUrl() { + public function testPublicLinkUrl() { $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK); $ocs->cleanup(); @@ -456,7 +456,7 @@ class ApiTest extends TestCase { * @depends testCreateShareUserFile * @depends testCreateShareLink */ - function testGetShareFromSource() { + public function testGetShareFromSource() { $node = $this->userFolder->get($this->filename); $share = $this->shareManager->newShare(); $share->setNode($node) @@ -489,7 +489,7 @@ class ApiTest extends TestCase { * @depends testCreateShareUserFile * @depends testCreateShareLink */ - function testGetShareFromSourceWithReshares() { + public function testGetShareFromSourceWithReshares() { $node = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node) @@ -530,7 +530,7 @@ class ApiTest extends TestCase { * @medium * @depends testCreateShareUserFile */ - function testGetShareFromId() { + public function testGetShareFromId() { $node = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node) @@ -554,7 +554,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testGetShareFromFolder() { + public function testGetShareFromFolder() { $node1 = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -584,7 +584,7 @@ class ApiTest extends TestCase { $this->shareManager->deleteShare($share2); } - function testGetShareFromFolderWithFile() { + public function testGetShareFromFolderWithFile() { $node1 = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -610,7 +610,7 @@ class ApiTest extends TestCase { * share a folder, than reshare a file within the shared folder and check if we construct the correct path * @medium */ - function testGetShareFromFolderReshares() { + public function testGetShareFromFolderReshares() { $node1 = $this->userFolder->get($this->folder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -670,7 +670,7 @@ class ApiTest extends TestCase { * reshare a sub folder and check if we get the correct path * @medium */ - function testGetShareFromSubFolderReShares() { + public function testGetShareFromSubFolderReShares() { $node1 = $this->userFolder->get($this->folder . $this->subfolder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -712,7 +712,7 @@ class ApiTest extends TestCase { * test re-re-share of folder if the path gets constructed correctly * @medium */ - function XtestGetShareFromFolderReReShares() { + public function XtestGetShareFromFolderReReShares() { $node1 = $this->userFolder->get($this->folder . $this->subfolder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -789,7 +789,7 @@ class ApiTest extends TestCase { * test multiple shared folder if the path gets constructed correctly * @medium */ - function testGetShareMultipleSharedFolder() { + public function testGetShareMultipleSharedFolder() { $this->setUp(); $node1 = $this->userFolder->get($this->folder . $this->subfolder); $share1 = $this->shareManager->newShare(); @@ -854,7 +854,7 @@ class ApiTest extends TestCase { * test re-re-share of folder if the path gets constructed correctly * @medium */ - function testGetShareFromFileReReShares() { + public function testGetShareFromFileReReShares() { $node1 = $this->userFolder->get($this->folder . $this->subfolder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -909,7 +909,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testGetShareFromUnknownId() { + public function testGetShareFromUnknownId() { $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER3); try { $ocs->getShare(0); @@ -925,7 +925,7 @@ class ApiTest extends TestCase { * @depends testCreateShareUserFile * @depends testCreateShareLink */ - function testUpdateShare() { + public function testUpdateShare() { $password = md5(time()); $node1 = $this->userFolder->get($this->filename); @@ -976,7 +976,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testUpdateShareUpload() { + public function testUpdateShareUpload() { $node1 = $this->userFolder->get($this->folder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -1006,7 +1006,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testUpdateShareExpireDate() { + public function testUpdateShareExpireDate() { $node1 = $this->userFolder->get($this->folder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -1078,7 +1078,7 @@ class ApiTest extends TestCase { * @medium * @depends testCreateShareUserFile */ - function testDeleteShare() { + public function testDeleteShare() { $node1 = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -1110,7 +1110,7 @@ class ApiTest extends TestCase { /** * test unshare of a reshared file */ - function testDeleteReshare() { + public function testDeleteReshare() { $node1 = $this->userFolder->get($this->folder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php index 355a1a8bb1b..09fc9f6f5a7 100644 --- a/apps/files_sharing/tests/CacheTest.php +++ b/apps/files_sharing/tests/CacheTest.php @@ -147,7 +147,7 @@ class CacheTest extends TestCase { parent::tearDown(); } - function searchDataProvider() { + public function searchDataProvider() { return [ ['%another%', [ @@ -211,7 +211,7 @@ class CacheTest extends TestCase { * we cannot use a dataProvider because that would cause the stray hook detection to remove the hooks * that were added in setUpBeforeClass. */ - function testSearch() { + public function testSearch() { foreach ($this->searchDataProvider() as $data) { list($pattern, $expectedFiles) = $data; @@ -223,7 +223,7 @@ class CacheTest extends TestCase { /** * Test searching by mime type */ - function testSearchByMime() { + public function testSearchByMime() { $results = $this->sharedStorage->getCache()->searchByMime('text'); $check = [ [ @@ -242,7 +242,7 @@ class CacheTest extends TestCase { $this->verifyFiles($check, $results); } - function testGetFolderContentsInRoot() { + public function testGetFolderContentsInRoot() { $results = $this->user2View->getDirectoryContent('/'); // we should get the shared items "shareddir" and "shared single file.txt" @@ -274,7 +274,7 @@ class CacheTest extends TestCase { ); } - function testGetFolderContentsInSubdir() { + public function testGetFolderContentsInSubdir() { $results = $this->user2View->getDirectoryContent('/shareddir'); $this->verifyFiles( @@ -305,7 +305,7 @@ class CacheTest extends TestCase { ); } - function testGetFolderContentsWhenSubSubdirShared() { + public function testGetFolderContentsWhenSubSubdirShared() { self::loginHelper(self::TEST_FILES_SHARING_API_USER1); $rootFolder = \OC::$server->getUserFolder(self::TEST_FILES_SHARING_API_USER1); diff --git a/apps/files_sharing/tests/ExternalStorageTest.php b/apps/files_sharing/tests/ExternalStorageTest.php index fa8df930a4e..b8c1db6c9da 100644 --- a/apps/files_sharing/tests/ExternalStorageTest.php +++ b/apps/files_sharing/tests/ExternalStorageTest.php @@ -39,7 +39,7 @@ use OCP\Http\Client\IResponse; * @group DB */ class ExternalStorageTest extends \Test\TestCase { - function optionsProvider() { + public function optionsProvider() { return [ [ 'http://remoteserver:8080/owncloud', diff --git a/apps/files_sharing/tests/PermissionsTest.php b/apps/files_sharing/tests/PermissionsTest.php index edbaf2f555a..4d21b3e0eb7 100644 --- a/apps/files_sharing/tests/PermissionsTest.php +++ b/apps/files_sharing/tests/PermissionsTest.php @@ -137,7 +137,7 @@ class PermissionsTest extends TestCase { /** * Test that the permissions of shared directory are returned correctly */ - function testGetPermissions() { + public function testGetPermissions() { $sharedDirPerms = $this->sharedStorage->getPermissions(''); $this->assertEquals(31, $sharedDirPerms); $sharedDirPerms = $this->sharedStorage->getPermissions('textfile.txt'); @@ -151,7 +151,7 @@ class PermissionsTest extends TestCase { /** * Test that the permissions of shared directory are returned correctly */ - function testGetDirectoryPermissions() { + public function testGetDirectoryPermissions() { $contents = $this->secondView->getDirectoryContent('files/shareddir'); $this->assertEquals('subdir', $contents[0]['name']); $this->assertEquals(31, $contents[0]['permissions']); diff --git a/apps/files_sharing/tests/ShareTest.php b/apps/files_sharing/tests/ShareTest.php index 313c8d8ac56..ba6b401e65e 100644 --- a/apps/files_sharing/tests/ShareTest.php +++ b/apps/files_sharing/tests/ShareTest.php @@ -34,7 +34,7 @@ namespace OCA\Files_Sharing\Tests; * @group DB */ class ShareTest extends TestCase { - const TEST_FOLDER_NAME = '/folder_share_api_test'; + public const TEST_FOLDER_NAME = '/folder_share_api_test'; private static $tempStorage; diff --git a/apps/files_sharing/tests/TestCase.php b/apps/files_sharing/tests/TestCase.php index 323fc06f321..f84867c0aca 100644 --- a/apps/files_sharing/tests/TestCase.php +++ b/apps/files_sharing/tests/TestCase.php @@ -47,12 +47,12 @@ use Test\Traits\MountProviderTrait; abstract class TestCase extends \Test\TestCase { use MountProviderTrait; - const TEST_FILES_SHARING_API_USER1 = "test-share-user1"; - const TEST_FILES_SHARING_API_USER2 = "test-share-user2"; - const TEST_FILES_SHARING_API_USER3 = "test-share-user3"; - const TEST_FILES_SHARING_API_USER4 = "test-share-user4"; + public const TEST_FILES_SHARING_API_USER1 = "test-share-user1"; + public const TEST_FILES_SHARING_API_USER2 = "test-share-user2"; + public const TEST_FILES_SHARING_API_USER3 = "test-share-user3"; + public const TEST_FILES_SHARING_API_USER4 = "test-share-user4"; - const TEST_FILES_SHARING_API_GROUP1 = "test-share-group1"; + public const TEST_FILES_SHARING_API_GROUP1 = "test-share-group1"; public $filename; public $data; diff --git a/apps/files_sharing/tests/UnshareChildrenTest.php b/apps/files_sharing/tests/UnshareChildrenTest.php index 56fdeb44a30..15daf9d5108 100644 --- a/apps/files_sharing/tests/UnshareChildrenTest.php +++ b/apps/files_sharing/tests/UnshareChildrenTest.php @@ -37,7 +37,7 @@ namespace OCA\Files_Sharing\Tests; class UnshareChildrenTest extends TestCase { protected $subsubfolder; - const TEST_FOLDER_NAME = '/folder_share_api_test'; + public const TEST_FOLDER_NAME = '/folder_share_api_test'; private static $tempStorage; diff --git a/apps/files_sharing/tests/UpdaterTest.php b/apps/files_sharing/tests/UpdaterTest.php index 0abc76df433..f2227721edc 100644 --- a/apps/files_sharing/tests/UpdaterTest.php +++ b/apps/files_sharing/tests/UpdaterTest.php @@ -36,7 +36,7 @@ namespace OCA\Files_Sharing\Tests; * @group DB */ class UpdaterTest extends TestCase { - const TEST_FOLDER_NAME = '/folder_share_updater_test'; + public const TEST_FOLDER_NAME = '/folder_share_updater_test'; public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); diff --git a/apps/files_sharing/tests/WatcherTest.php b/apps/files_sharing/tests/WatcherTest.php index e483b2e1d92..e105bf16161 100644 --- a/apps/files_sharing/tests/WatcherTest.php +++ b/apps/files_sharing/tests/WatcherTest.php @@ -111,7 +111,7 @@ class WatcherTest extends TestCase { * Tests that writing a file using the shared storage will propagate the file * size to the owner's parent folders. */ - function testFolderSizePropagationToOwnerStorage() { + public function testFolderSizePropagationToOwnerStorage() { $initialSizes = self::getOwnerDirSizes('files/container/shareddir'); $textData = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; @@ -141,7 +141,7 @@ class WatcherTest extends TestCase { * Tests that writing a file using the shared storage will propagate the file * size to the owner's parent folders. */ - function testSubFolderSizePropagationToOwnerStorage() { + public function testSubFolderSizePropagationToOwnerStorage() { $initialSizes = self::getOwnerDirSizes('files/container/shareddir/subdir'); $textData = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; @@ -173,7 +173,7 @@ class WatcherTest extends TestCase { * where the key is the path and the value is the size. * @param string $path */ - function getOwnerDirSizes($path) { + public function getOwnerDirSizes($path) { $result = []; while ($path != '' && $path != '' && $path != '.') { diff --git a/apps/files_trashbin/lib/Command/CleanUp.php b/apps/files_trashbin/lib/Command/CleanUp.php index 59acbdcd000..a9bbe95af56 100644 --- a/apps/files_trashbin/lib/Command/CleanUp.php +++ b/apps/files_trashbin/lib/Command/CleanUp.php @@ -52,7 +52,7 @@ class CleanUp extends Command { * @param IUserManager $userManager * @param IDBConnection $dbConnection */ - function __construct(IRootFolder $rootFolder, IUserManager $userManager, IDBConnection $dbConnection) { + public function __construct(IRootFolder $rootFolder, IUserManager $userManager, IDBConnection $dbConnection) { parent::__construct(); $this->userManager = $userManager; $this->rootFolder = $rootFolder; diff --git a/apps/files_trashbin/lib/Command/Expire.php b/apps/files_trashbin/lib/Command/Expire.php index fb4417774e6..66bf4ed306e 100644 --- a/apps/files_trashbin/lib/Command/Expire.php +++ b/apps/files_trashbin/lib/Command/Expire.php @@ -41,7 +41,7 @@ class Expire implements ICommand { /** * @param string $user */ - function __construct($user) { + public function __construct($user) { $this->user = $user; } diff --git a/apps/files_trashbin/lib/Command/ExpireTrash.php b/apps/files_trashbin/lib/Command/ExpireTrash.php index fdf7f89b2ce..c4d8992379d 100644 --- a/apps/files_trashbin/lib/Command/ExpireTrash.php +++ b/apps/files_trashbin/lib/Command/ExpireTrash.php @@ -100,7 +100,7 @@ class ExpireTrash extends Command { } } - function expireTrashForUser(IUser $user) { + public function expireTrashForUser(IUser $user) { $uid = $user->getUID(); if (!$this->setupFS($uid)) { return; diff --git a/apps/files_trashbin/lib/Expiration.php b/apps/files_trashbin/lib/Expiration.php index 9a660f9e942..3a2dc2ede03 100644 --- a/apps/files_trashbin/lib/Expiration.php +++ b/apps/files_trashbin/lib/Expiration.php @@ -32,8 +32,8 @@ use OCP\IConfig; class Expiration { // how long do we keep files in the trash bin if no other value is defined in the config file (unit: days) - const DEFAULT_RETENTION_OBLIGATION = 30; - const NO_OBLIGATION = -1; + public const DEFAULT_RETENTION_OBLIGATION = 30; + public const NO_OBLIGATION = -1; /** @var ITimeFactory */ private $timeFactory; diff --git a/apps/files_trashbin/lib/Sabre/AbstractTrashFile.php b/apps/files_trashbin/lib/Sabre/AbstractTrashFile.php index ad80711ff1d..7f606bbbc6e 100644 --- a/apps/files_trashbin/lib/Sabre/AbstractTrashFile.php +++ b/apps/files_trashbin/lib/Sabre/AbstractTrashFile.php @@ -29,7 +29,7 @@ namespace OCA\Files_Trashbin\Sabre; use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\IFile; -abstract class AbstractTrashFile extends AbstractTrash implements IFile , ITrash { +abstract class AbstractTrashFile extends AbstractTrash implements IFile, ITrash { public function put($data) { throw new Forbidden(); } diff --git a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php index 1920ed17863..ac3fcdb3192 100644 --- a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php +++ b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php @@ -35,10 +35,10 @@ use Sabre\DAV\Server; use Sabre\DAV\ServerPlugin; class PropfindPlugin extends ServerPlugin { - const TRASHBIN_FILENAME = '{http://nextcloud.org/ns}trashbin-filename'; - const TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location'; - const TRASHBIN_DELETION_TIME = '{http://nextcloud.org/ns}trashbin-deletion-time'; - const TRASHBIN_TITLE = '{http://nextcloud.org/ns}trashbin-title'; + public const TRASHBIN_FILENAME = '{http://nextcloud.org/ns}trashbin-filename'; + public const TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location'; + public const TRASHBIN_DELETION_TIME = '{http://nextcloud.org/ns}trashbin-deletion-time'; + public const TRASHBIN_TITLE = '{http://nextcloud.org/ns}trashbin-title'; /** @var Server */ private $server; diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index adfdf1364be..4ceac3b04c5 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -56,7 +56,7 @@ use OCP\User; class Trashbin { // unit: percentage; 50% of available disk space/quota - const DEFAULTMAXSIZE = 50; + public const DEFAULTMAXSIZE = 50; /** * Whether versions have already be rescanned during this PHP request diff --git a/apps/files_trashbin/tests/ExpirationTest.php b/apps/files_trashbin/tests/ExpirationTest.php index 581ef247ac7..a9b4124236e 100644 --- a/apps/files_trashbin/tests/ExpirationTest.php +++ b/apps/files_trashbin/tests/ExpirationTest.php @@ -28,9 +28,9 @@ use OCP\IConfig; use PHPUnit\Framework\MockObject\MockObject; class ExpirationTest extends \Test\TestCase { - const SECONDS_PER_DAY = 86400; //60*60*24 + public const SECONDS_PER_DAY = 86400; //60*60*24 - const FAKE_TIME_NOW = 1000000; + public const FAKE_TIME_NOW = 1000000; public function expirationData() { $today = 100*self::SECONDS_PER_DAY; diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php index fbf1b1c1c13..136d8121cfa 100644 --- a/apps/files_trashbin/tests/TrashbinTest.php +++ b/apps/files_trashbin/tests/TrashbinTest.php @@ -37,8 +37,8 @@ use OCA\Files_Sharing\AppInfo\Application; * @group DB */ class TrashbinTest extends \Test\TestCase { - const TEST_TRASHBIN_USER1 = "test-trashbin-user1"; - const TEST_TRASHBIN_USER2 = "test-trashbin-user2"; + public const TEST_TRASHBIN_USER1 = "test-trashbin-user1"; + public const TEST_TRASHBIN_USER2 = "test-trashbin-user2"; private $trashRoot1; private $trashRoot2; diff --git a/apps/files_versions/lib/AppInfo/Application.php b/apps/files_versions/lib/AppInfo/Application.php index 36d7b6d2767..23942bf8952 100644 --- a/apps/files_versions/lib/AppInfo/Application.php +++ b/apps/files_versions/lib/AppInfo/Application.php @@ -42,7 +42,7 @@ use OCP\AppFramework\IAppContainer; use OCP\EventDispatcher\IEventDispatcher; class Application extends App { - const APP_ID = 'files_versions'; + public const APP_ID = 'files_versions'; public function __construct(array $urlParams = []) { parent::__construct(self::APP_ID, $urlParams); diff --git a/apps/files_versions/lib/BackgroundJob/ExpireVersions.php b/apps/files_versions/lib/BackgroundJob/ExpireVersions.php index 4c8f82a1c76..201824389d5 100644 --- a/apps/files_versions/lib/BackgroundJob/ExpireVersions.php +++ b/apps/files_versions/lib/BackgroundJob/ExpireVersions.php @@ -31,7 +31,7 @@ use OCP\IUser; use OCP\IUserManager; class ExpireVersions extends \OC\BackgroundJob\TimedJob { - const ITEMS_PER_SESSION = 1000; + public const ITEMS_PER_SESSION = 1000; /** * @var Expiration diff --git a/apps/files_versions/lib/Command/CleanUp.php b/apps/files_versions/lib/Command/CleanUp.php index 397a1450578..fb8538adefc 100644 --- a/apps/files_versions/lib/Command/CleanUp.php +++ b/apps/files_versions/lib/Command/CleanUp.php @@ -42,7 +42,7 @@ class CleanUp extends Command { * @param IRootFolder $rootFolder * @param IUserManager $userManager */ - function __construct(IRootFolder $rootFolder, IUserManager $userManager) { + public function __construct(IRootFolder $rootFolder, IUserManager $userManager) { parent::__construct(); $this->userManager = $userManager; $this->rootFolder = $rootFolder; diff --git a/apps/files_versions/lib/Command/Expire.php b/apps/files_versions/lib/Command/Expire.php index 55f88aba688..a98eba2ece9 100644 --- a/apps/files_versions/lib/Command/Expire.php +++ b/apps/files_versions/lib/Command/Expire.php @@ -46,7 +46,7 @@ class Expire implements ICommand { * @param string $user * @param string $fileName */ - function __construct($user, $fileName) { + public function __construct($user, $fileName) { $this->user = $user; $this->fileName = $fileName; } diff --git a/apps/files_versions/lib/Command/ExpireVersions.php b/apps/files_versions/lib/Command/ExpireVersions.php index 944e0136691..4d9dbc25238 100644 --- a/apps/files_versions/lib/Command/ExpireVersions.php +++ b/apps/files_versions/lib/Command/ExpireVersions.php @@ -99,7 +99,7 @@ class ExpireVersions extends Command { } } - function expireVersionsForUser(IUser $user) { + public function expireVersionsForUser(IUser $user) { $uid = $user->getUID(); if (!$this->setupFS($uid)) { return; diff --git a/apps/files_versions/lib/Expiration.php b/apps/files_versions/lib/Expiration.php index c9c91d67d7f..ab1eeab6901 100644 --- a/apps/files_versions/lib/Expiration.php +++ b/apps/files_versions/lib/Expiration.php @@ -30,7 +30,7 @@ use OCP\IConfig; class Expiration { // how long do we keep files a version if no other value is defined in the config file (unit: days) - const NO_OBLIGATION = -1; + public const NO_OBLIGATION = -1; /** @var ITimeFactory */ private $timeFactory; diff --git a/apps/files_versions/lib/Sabre/Plugin.php b/apps/files_versions/lib/Sabre/Plugin.php index 41c3ff5a5a8..0c8858d3bb8 100644 --- a/apps/files_versions/lib/Sabre/Plugin.php +++ b/apps/files_versions/lib/Sabre/Plugin.php @@ -41,11 +41,11 @@ class Plugin extends ServerPlugin { /** @var IRequest */ private $request; - function __construct(IRequest $request) { + public function __construct(IRequest $request) { $this->request = $request; } - function initialize(Server $server) { + public function initialize(Server $server) { $this->server = $server; $server->on('afterMethod:GET', [$this, 'afterGet']); diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index f62650e539d..cb5a02581b5 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -57,13 +57,13 @@ use OCP\Lock\ILockingProvider; use OCP\User; class Storage { - const DEFAULTENABLED=true; - const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota - const VERSIONS_ROOT = 'files_versions/'; + public const DEFAULTENABLED=true; + public const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota + public const VERSIONS_ROOT = 'files_versions/'; - const DELETE_TRIGGER_MASTER_REMOVED = 0; - const DELETE_TRIGGER_RETENTION_CONSTRAINT = 1; - const DELETE_TRIGGER_QUOTA_EXCEEDED = 2; + public const DELETE_TRIGGER_MASTER_REMOVED = 0; + public const DELETE_TRIGGER_RETENTION_CONSTRAINT = 1; + public const DELETE_TRIGGER_QUOTA_EXCEEDED = 2; // files for which we can remove the versions after the delete operation was successful private static $deletedFiles = []; diff --git a/apps/files_versions/tests/ExpirationTest.php b/apps/files_versions/tests/ExpirationTest.php index 426d07e4b42..1979da624c7 100644 --- a/apps/files_versions/tests/ExpirationTest.php +++ b/apps/files_versions/tests/ExpirationTest.php @@ -31,7 +31,7 @@ use OCP\IConfig; use PHPUnit\Framework\MockObject\MockObject; class ExpirationTest extends \Test\TestCase { - const SECONDS_PER_DAY = 86400; //60*60*24 + public const SECONDS_PER_DAY = 86400; //60*60*24 public function expirationData() { $today = 100*self::SECONDS_PER_DAY; diff --git a/apps/files_versions/tests/VersioningTest.php b/apps/files_versions/tests/VersioningTest.php index c3ae186e73e..26429574364 100644 --- a/apps/files_versions/tests/VersioningTest.php +++ b/apps/files_versions/tests/VersioningTest.php @@ -47,9 +47,9 @@ use OCP\IUser; * @group DB */ class VersioningTest extends \Test\TestCase { - const TEST_VERSIONS_USER = 'test-versions-user'; - const TEST_VERSIONS_USER2 = 'test-versions-user2'; - const USERS_VERSIONS_ROOT = '/test-versions-user/files_versions'; + public const TEST_VERSIONS_USER = 'test-versions-user'; + public const TEST_VERSIONS_USER2 = 'test-versions-user2'; + public const USERS_VERSIONS_ROOT = '/test-versions-user/files_versions'; /** * @var \OC\Files\View diff --git a/apps/oauth2/lib/Controller/SettingsController.php b/apps/oauth2/lib/Controller/SettingsController.php index 89685bbee19..db0c6957d06 100644 --- a/apps/oauth2/lib/Controller/SettingsController.php +++ b/apps/oauth2/lib/Controller/SettingsController.php @@ -53,7 +53,7 @@ class SettingsController extends Controller { /** @var IL10N */ private $l; - const validChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + public const validChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; /** * @param string $appName diff --git a/apps/settings/lib/AppInfo/Application.php b/apps/settings/lib/AppInfo/Application.php index 809fe6cf844..0f1a529ae81 100644 --- a/apps/settings/lib/AppInfo/Application.php +++ b/apps/settings/lib/AppInfo/Application.php @@ -54,7 +54,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; class Application extends App { - const APP_ID = 'settings'; + public const APP_ID = 'settings'; /** * @param array $urlParams diff --git a/apps/settings/lib/Controller/AuthSettingsController.php b/apps/settings/lib/Controller/AuthSettingsController.php index 0296a1ac5cb..c7099f28499 100644 --- a/apps/settings/lib/Controller/AuthSettingsController.php +++ b/apps/settings/lib/Controller/AuthSettingsController.php @@ -62,7 +62,7 @@ class AuthSettingsController extends Controller { private $session; /** IUserSession */ - private $userSession; + private $userSession; /** @var string */ private $uid; diff --git a/apps/sharebymail/lib/Activity.php b/apps/sharebymail/lib/Activity.php index 757b2692e86..af8157523f1 100644 --- a/apps/sharebymail/lib/Activity.php +++ b/apps/sharebymail/lib/Activity.php @@ -60,12 +60,12 @@ class Activity implements IProvider { /** @var array */ protected $contactNames = []; - const SUBJECT_SHARED_EMAIL_SELF = 'shared_with_email_self'; - const SUBJECT_SHARED_EMAIL_BY = 'shared_with_email_by'; - const SUBJECT_SHARED_EMAIL_PASSWORD_SEND = 'shared_with_email_password_send'; - const SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF = 'shared_with_email_password_send_self'; - const SUBJECT_UNSHARED_EMAIL_SELF = 'unshared_with_email_self'; - const SUBJECT_UNSHARED_EMAIL_BY = 'unshared_with_email_by'; + public const SUBJECT_SHARED_EMAIL_SELF = 'shared_with_email_self'; + public const SUBJECT_SHARED_EMAIL_BY = 'shared_with_email_by'; + public const SUBJECT_SHARED_EMAIL_PASSWORD_SEND = 'shared_with_email_password_send'; + public const SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF = 'shared_with_email_password_send_self'; + public const SUBJECT_UNSHARED_EMAIL_SELF = 'unshared_with_email_self'; + public const SUBJECT_UNSHARED_EMAIL_BY = 'unshared_with_email_by'; /** * @param IFactory $languageFactory diff --git a/apps/systemtags/lib/Activity/Provider.php b/apps/systemtags/lib/Activity/Provider.php index c60aad31d62..6c91daffe18 100644 --- a/apps/systemtags/lib/Activity/Provider.php +++ b/apps/systemtags/lib/Activity/Provider.php @@ -33,12 +33,12 @@ use OCP\IUserManager; use OCP\L10N\IFactory; class Provider implements IProvider { - const CREATE_TAG = 'create_tag'; - const UPDATE_TAG = 'update_tag'; - const DELETE_TAG = 'delete_tag'; + public const CREATE_TAG = 'create_tag'; + public const UPDATE_TAG = 'update_tag'; + public const DELETE_TAG = 'delete_tag'; - const ASSIGN_TAG = 'assign_tag'; - const UNASSIGN_TAG = 'unassign_tag'; + public const ASSIGN_TAG = 'assign_tag'; + public const UNASSIGN_TAG = 'unassign_tag'; /** @var IFactory */ protected $languageFactory; diff --git a/apps/testing/lib/Locking/FakeDBLockingProvider.php b/apps/testing/lib/Locking/FakeDBLockingProvider.php index 62cbc4d2468..2de83eac1a8 100644 --- a/apps/testing/lib/Locking/FakeDBLockingProvider.php +++ b/apps/testing/lib/Locking/FakeDBLockingProvider.php @@ -29,7 +29,7 @@ use OCP\ILogger; class FakeDBLockingProvider extends \OC\Lock\DBLockingProvider { // Lock for 10 hours just to be sure - const TTL = 36000; + public const TTL = 36000; /** * Need a new child, because parent::connection is private instead of protected... diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 6744b044cdf..71994585c73 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -64,7 +64,7 @@ use OCP\IUserManager; * @package OCA\User_LDAP */ class Access extends LDAPUtility { - const UUID_ATTRIBUTES = ['entryuuid', 'nsuniqueid', 'objectguid', 'guid', 'ipauniqueid']; + public const UUID_ATTRIBUTES = ['entryuuid', 'nsuniqueid', 'objectguid', 'guid', 'ipauniqueid']; /** @var \OCA\User_LDAP\Connection */ public $connection; diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php index 4076a6e8a3d..81e33e6244f 100644 --- a/apps/user_ldap/lib/Configuration.php +++ b/apps/user_ldap/lib/Configuration.php @@ -41,9 +41,9 @@ namespace OCA\User_LDAP; * @property string ldapUserAvatarRule */ class Configuration { - const AVATAR_PREFIX_DEFAULT = 'default'; - const AVATAR_PREFIX_NONE = 'none'; - const AVATAR_PREFIX_DATA_ATTRIBUTE = 'data:'; + public const AVATAR_PREFIX_DEFAULT = 'default'; + public const AVATAR_PREFIX_NONE = 'none'; + public const AVATAR_PREFIX_DATA_ATTRIBUTE = 'data:'; protected $configPrefix = null; protected $configRead = false; diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php index cec4866b0ea..0cc93a08e6f 100644 --- a/apps/user_ldap/lib/Connection.php +++ b/apps/user_ldap/lib/Connection.php @@ -348,6 +348,7 @@ class Connection extends LDAPUtility { $result[$dbkey] = implode("\n", $config[$configkey]); break; } //else follows default + // no break default: $result[$dbkey] = $config[$configkey]; } diff --git a/apps/user_ldap/lib/Controller/RenewPasswordController.php b/apps/user_ldap/lib/Controller/RenewPasswordController.php index 499a25e0d28..3395d10c488 100644 --- a/apps/user_ldap/lib/Controller/RenewPasswordController.php +++ b/apps/user_ldap/lib/Controller/RenewPasswordController.php @@ -54,7 +54,7 @@ class RenewPasswordController extends Controller { * @param IConfig $config * @param IURLGenerator $urlGenerator */ - function __construct($appName, IRequest $request, IUserManager $userManager, + public function __construct($appName, IRequest $request, IUserManager $userManager, IConfig $config, IL10N $l10n, ISession $session, IURLGenerator $urlGenerator) { parent::__construct($appName, $request); $this->userManager = $userManager; diff --git a/apps/user_ldap/lib/Jobs/Sync.php b/apps/user_ldap/lib/Jobs/Sync.php index 1ef2d16e7c2..053ca894902 100644 --- a/apps/user_ldap/lib/Jobs/Sync.php +++ b/apps/user_ldap/lib/Jobs/Sync.php @@ -43,8 +43,8 @@ use OCP\IUserManager; use OCP\Notification\IManager; class Sync extends TimedJob { - const MAX_INTERVAL = 12 * 60 * 60; // 12h - const MIN_INTERVAL = 30 * 60; // 30min + public const MAX_INTERVAL = 12 * 60 * 60; // 12h + public const MIN_INTERVAL = 30 * 60; // 30min /** @var Helper */ protected $ldapHelper; /** @var LDAP */ diff --git a/apps/user_ldap/lib/Jobs/UpdateGroups.php b/apps/user_ldap/lib/Jobs/UpdateGroups.php index 19981a69bd2..6241483cb92 100644 --- a/apps/user_ldap/lib/Jobs/UpdateGroups.php +++ b/apps/user_ldap/lib/Jobs/UpdateGroups.php @@ -46,9 +46,9 @@ use OCA\User_LDAP\User\Manager; use OCP\ILogger; class UpdateGroups extends \OC\BackgroundJob\TimedJob { - static private $groupsFromDB; + private static $groupsFromDB; - static private $groupBE; + private static $groupBE; public function __construct() { $this->interval = self::getRefreshInterval(); @@ -61,7 +61,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob { self::updateGroups(); } - static public function updateGroups() { + public static function updateGroups() { \OCP\Util::writeLog('user_ldap', 'Run background job "updateGroups"', ILogger::DEBUG); $knownGroups = array_keys(self::getKnownGroups()); @@ -84,7 +84,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob { /** * @return int */ - static private function getRefreshInterval() { + private static function getRefreshInterval() { //defaults to every hour return \OC::$server->getConfig()->getAppValue('user_ldap', 'bgjRefreshInterval', 3600); } @@ -92,7 +92,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob { /** * @param string[] $groups */ - static private function handleKnownGroups($groups) { + private static function handleKnownGroups($groups) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – Dealing with known Groups.', ILogger::DEBUG); $query = \OC_DB::prepare(' UPDATE `*PREFIX*ldap_group_members` @@ -130,7 +130,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob { /** * @param string[] $createdGroups */ - static private function handleCreatedGroups($createdGroups) { + private static function handleCreatedGroups($createdGroups) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – dealing with created Groups.', ILogger::DEBUG); $query = \OC_DB::prepare(' INSERT @@ -152,7 +152,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob { /** * @param string[] $removedGroups */ - static private function handleRemovedGroups($removedGroups) { + private static function handleRemovedGroups($removedGroups) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – dealing with removed groups.', ILogger::DEBUG); $query = \OC_DB::prepare(' DELETE @@ -173,7 +173,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob { /** * @return \OCA\User_LDAP\Group_LDAP|\OCA\User_LDAP\Group_Proxy */ - static private function getGroupBE() { + private static function getGroupBE() { if (!is_null(self::$groupBE)) { return self::$groupBE; } @@ -209,7 +209,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob { /** * @return array */ - static private function getKnownGroups() { + private static function getKnownGroups() { if (is_array(self::$groupsFromDB)) { return self::$groupsFromDB; } diff --git a/apps/user_ldap/lib/Proxy.php b/apps/user_ldap/lib/Proxy.php index 7698895eaf0..3cf55f8cd58 100644 --- a/apps/user_ldap/lib/Proxy.php +++ b/apps/user_ldap/lib/Proxy.php @@ -38,7 +38,7 @@ use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\User\Manager; abstract class Proxy { - static private $accesses = []; + private static $accesses = []; private $ldap = null; /** @var \OCP\ICache|null */ diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index 724db063659..7d4e6c267de 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/apps/user_ldap/lib/User/User.php @@ -107,8 +107,8 @@ class User { /** * DB config keys for user preferences */ - const USER_PREFKEY_FIRSTLOGIN = 'firstLoginAccomplished'; - const USER_PREFKEY_LASTREFRESH = 'lastFeatureRefresh'; + public const USER_PREFKEY_FIRSTLOGIN = 'firstLoginAccomplished'; + public const USER_PREFKEY_LASTREFRESH = 'lastFeatureRefresh'; /** * @brief constructor, make sure the subclasses call this one! diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php index 01a9e19076d..73032bfd7f2 100644 --- a/apps/user_ldap/lib/Wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -43,25 +43,25 @@ use OCP\ILogger; class Wizard extends LDAPUtility { /** @var \OCP\IL10N */ - static protected $l; + protected static $l; protected $access; protected $cr; protected $configuration; protected $result; protected $resultCache = []; - const LRESULT_PROCESSED_OK = 2; - const LRESULT_PROCESSED_INVALID = 3; - const LRESULT_PROCESSED_SKIP = 4; + public const LRESULT_PROCESSED_OK = 2; + public const LRESULT_PROCESSED_INVALID = 3; + public const LRESULT_PROCESSED_SKIP = 4; - const LFILTER_LOGIN = 2; - const LFILTER_USER_LIST = 3; - const LFILTER_GROUP_LIST = 4; + public const LFILTER_LOGIN = 2; + public const LFILTER_USER_LIST = 3; + public const LFILTER_GROUP_LIST = 4; - const LFILTER_MODE_ASSISTED = 2; - const LFILTER_MODE_RAW = 1; + public const LFILTER_MODE_ASSISTED = 2; + public const LFILTER_MODE_RAW = 1; - const LDAP_NW_TIMEOUT = 4; + public const LDAP_NW_TIMEOUT = 4; /** * Constructor diff --git a/apps/workflowengine/lib/AppInfo/Application.php b/apps/workflowengine/lib/AppInfo/Application.php index c9e982a311f..70b5468c553 100644 --- a/apps/workflowengine/lib/AppInfo/Application.php +++ b/apps/workflowengine/lib/AppInfo/Application.php @@ -35,7 +35,7 @@ use OCP\WorkflowEngine\IOperationCompat; use Symfony\Component\EventDispatcher\EventDispatcherInterface; class Application extends \OCP\AppFramework\App { - const APP_ID = 'workflowengine'; + public const APP_ID = 'workflowengine'; /** @var EventDispatcherInterface */ protected $dispatcher; diff --git a/apps/workflowengine/lib/Check/RequestTime.php b/apps/workflowengine/lib/Check/RequestTime.php index 9729129104f..df210cdae58 100644 --- a/apps/workflowengine/lib/Check/RequestTime.php +++ b/apps/workflowengine/lib/Check/RequestTime.php @@ -26,8 +26,8 @@ use OCP\IL10N; use OCP\WorkflowEngine\ICheck; class RequestTime implements ICheck { - const REGEX_TIME = '([0-1][0-9]|2[0-3]):([0-5][0-9])'; - const REGEX_TIMEZONE = '([a-zA-Z]+(?:\\/[a-zA-Z\-\_]+)+)'; + public const REGEX_TIME = '([0-1][0-9]|2[0-3]):([0-5][0-9])'; + public const REGEX_TIMEZONE = '([a-zA-Z]+(?:\\/[a-zA-Z\-\_]+)+)'; /** @var bool[] */ protected $cachedResults; diff --git a/apps/workflowengine/lib/Settings/ASettings.php b/apps/workflowengine/lib/Settings/ASettings.php index b2db7d12364..a3f2ad2495f 100644 --- a/apps/workflowengine/lib/Settings/ASettings.php +++ b/apps/workflowengine/lib/Settings/ASettings.php @@ -83,7 +83,7 @@ abstract class ASettings implements ISettings { $this->config = $config; } - abstract function getScope(): int; + abstract public function getScope(): int; /** * @return TemplateResponse diff --git a/apps/workflowengine/lib/Settings/Admin.php b/apps/workflowengine/lib/Settings/Admin.php index 11e9096bc56..cc6269c168b 100644 --- a/apps/workflowengine/lib/Settings/Admin.php +++ b/apps/workflowengine/lib/Settings/Admin.php @@ -28,7 +28,7 @@ namespace OCA\WorkflowEngine\Settings; use OCP\WorkflowEngine\IManager; class Admin extends ASettings { - function getScope(): int { + public function getScope(): int { return IManager::SCOPE_ADMIN; } } diff --git a/apps/workflowengine/lib/Settings/Personal.php b/apps/workflowengine/lib/Settings/Personal.php index af922726121..8d95dba5de8 100644 --- a/apps/workflowengine/lib/Settings/Personal.php +++ b/apps/workflowengine/lib/Settings/Personal.php @@ -28,7 +28,7 @@ namespace OCA\WorkflowEngine\Settings; use OCP\WorkflowEngine\IManager; class Personal extends ASettings { - function getScope(): int { + public function getScope(): int { return IManager::SCOPE_USER; } |