diff options
172 files changed, 545 insertions, 545 deletions
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/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index dd3cb048483..b620b20d4d5 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -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..c298a3f5ab6 100644 --- a/apps/dav/lib/CalDAV/Plugin.php +++ b/apps/dav/lib/CalDAV/Plugin.php @@ -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/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/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/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/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/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..782bc4c0f58 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -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..701aa679b44 100644 --- a/apps/dav/lib/CardDAV/Xml/Groups.php +++ b/apps/dav/lib/CardDAV/Xml/Groups.php @@ -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..366e51ad189 100644 --- a/apps/dav/lib/Command/MoveCalendar.php +++ b/apps/dav/lib/Command/MoveCalendar.php @@ -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..d21f13ebccd 100644 --- a/apps/dav/lib/Comments/CommentNode.php +++ b/apps/dav/lib/Comments/CommentNode.php @@ -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..ecfb5e5cfab 100644 --- a/apps/dav/lib/Comments/CommentsPlugin.php +++ b/apps/dav/lib/Comments/CommentsPlugin.php @@ -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..d64c5c36423 100644 --- a/apps/dav/lib/Comments/EntityCollection.php +++ b/apps/dav/lib/Comments/EntityCollection.php @@ -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..ba33d3234b3 100644 --- a/apps/dav/lib/Connector/Sabre/Auth.php +++ b/apps/dav/lib/Connector/Sabre/Auth.php @@ -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..7c9204cbe75 100644 --- a/apps/dav/lib/Connector/Sabre/ChecksumList.php +++ b/apps/dav/lib/Connector/Sabre/ChecksumList.php @@ -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..5ae8dcdb938 100644 --- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php @@ -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/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/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..e14fd691f45 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -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/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..ed32b7a00b1 100644 --- a/apps/dav/lib/Connector/Sabre/ShareTypeList.php +++ b/apps/dav/lib/Connector/Sabre/ShareTypeList.php @@ -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..d303305fe47 100644 --- a/apps/dav/lib/Connector/Sabre/ShareeList.php +++ b/apps/dav/lib/Connector/Sabre/ShareeList.php @@ -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/TagList.php b/apps/dav/lib/Connector/Sabre/TagList.php index 72c3fb31b07..c73f698c188 100644 --- a/apps/dav/lib/Connector/Sabre/TagList.php +++ b/apps/dav/lib/Connector/Sabre/TagList.php @@ -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/DAV/GroupPrincipalBackend.php b/apps/dav/lib/DAV/GroupPrincipalBackend.php index f03c7cc2bdd..cfa896c4f2c 100644 --- a/apps/dav/lib/DAV/GroupPrincipalBackend.php +++ b/apps/dav/lib/DAV/GroupPrincipalBackend.php @@ -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/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..148afa323dd 100644 --- a/apps/dav/lib/DAV/Sharing/Plugin.php +++ b/apps/dav/lib/DAV/Sharing/Plugin.php @@ -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/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/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/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..ea4eef1690a 100644 --- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php @@ -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..49519431151 100644 --- a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php @@ -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/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/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/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/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..e7f43ce2a0e 100644 --- a/apps/files_external/lib/Command/ListCommand.php +++ b/apps/files_external/lib/Command/ListCommand.php @@ -60,7 +60,7 @@ class ListCommand extends Base { 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/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/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/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_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..bb478044a2f 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -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/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_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/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/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/UpdateGroups.php b/apps/user_ldap/lib/Jobs/UpdateGroups.php index 810d88b3ccc..6241483cb92 100644 --- a/apps/user_ldap/lib/Jobs/UpdateGroups.php +++ b/apps/user_ldap/lib/Jobs/UpdateGroups.php @@ -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/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; } diff --git a/build/license.php b/build/license.php index 9e2b5f94df4..7bd9e1054c0 100644 --- a/build/license.php +++ b/build/license.php @@ -78,7 +78,7 @@ EOD; * @param string|string[] $folder * @param string|bool $gitRoot */ - function exec($folder, $gitRoot = false) { + public function exec($folder, $gitRoot = false) { if (is_array($folder)) { foreach ($folder as $f) { $this->exec($f, $gitRoot); @@ -121,7 +121,7 @@ EOD; $this->printFilesToCheck(); } - function writeAuthorsFile() { + public function writeAuthorsFile() { ksort($this->authors); $template = "Nextcloud is written by: @AUTHORS@ @@ -139,7 +139,7 @@ With help from many libraries and frameworks including: file_put_contents(__DIR__.'/../AUTHORS', $template); } - function handleFile($path, $gitRoot) { + public function handleFile($path, $gitRoot) { $source = file_get_contents($path); if ($this->isMITLicensed($source)) { echo "MIT licensed file: $path" . PHP_EOL; diff --git a/lib/base.php b/lib/base.php index f6eb79ab270..b1f9569926f 100644 --- a/lib/base.php +++ b/lib/base.php @@ -1043,7 +1043,7 @@ class OC { * @param OCP\IRequest $request * @return boolean */ - static function handleLogin(OCP\IRequest $request) { + public static function handleLogin(OCP\IRequest $request) { $userSession = self::$server->getUserSession(); if (OC_User::handleApacheAuth()) { return true; diff --git a/lib/private/App/AppStore/Bundles/Bundle.php b/lib/private/App/AppStore/Bundles/Bundle.php index d6b74ff3b6b..16458121b36 100644 --- a/lib/private/App/AppStore/Bundles/Bundle.php +++ b/lib/private/App/AppStore/Bundles/Bundle.php @@ -41,7 +41,7 @@ abstract class Bundle { * * @return string */ - public final function getIdentifier() { + final public function getIdentifier() { return substr(strrchr(get_class($this), '\\'), 1); } @@ -50,12 +50,12 @@ abstract class Bundle { * * @return string */ - public abstract function getName(); + abstract public function getName(); /** * Get the list of app identifiers in the bundle * * @return array */ - public abstract function getAppIdentifiers(); + abstract public function getAppIdentifiers(); } diff --git a/lib/private/App/Platform.php b/lib/private/App/Platform.php index 45b00c20219..f03e241e9a0 100644 --- a/lib/private/App/Platform.php +++ b/lib/private/App/Platform.php @@ -38,7 +38,7 @@ class Platform { /** * @param IConfig $config */ - function __construct(IConfig $config) { + public function __construct(IConfig $config) { $this->config = $config; } diff --git a/lib/private/Archive/Archive.php b/lib/private/Archive/Archive.php index 5150e6ddee3..43b44e5a23a 100644 --- a/lib/private/Archive/Archive.php +++ b/lib/private/Archive/Archive.php @@ -34,88 +34,88 @@ abstract class Archive { /** * @param $source */ - public abstract function __construct($source); + abstract public function __construct($source); /** * add an empty folder to the archive * @param string $path * @return bool */ - public abstract function addFolder($path); + abstract public function addFolder($path); /** * add a file to the archive * @param string $path * @param string $source either a local file or string data * @return bool */ - public abstract function addFile($path, $source=''); + abstract public function addFile($path, $source=''); /** * rename a file or folder in the archive * @param string $source * @param string $dest * @return bool */ - public abstract function rename($source, $dest); + abstract public function rename($source, $dest); /** * get the uncompressed size of a file in the archive * @param string $path * @return int */ - public abstract function filesize($path); + abstract public function filesize($path); /** * get the last modified time of a file in the archive * @param string $path * @return int */ - public abstract function mtime($path); + abstract public function mtime($path); /** * get the files in a folder * @param string $path * @return array */ - public abstract function getFolder($path); + abstract public function getFolder($path); /** * get all files in the archive * @return array */ - public abstract function getFiles(); + abstract public function getFiles(); /** * get the content of a file * @param string $path * @return string */ - public abstract function getFile($path); + abstract public function getFile($path); /** * extract a single file from the archive * @param string $path * @param string $dest * @return bool */ - public abstract function extractFile($path, $dest); + abstract public function extractFile($path, $dest); /** * extract the archive * @param string $dest * @return bool */ - public abstract function extract($dest); + abstract public function extract($dest); /** * check if a file or folder exists in the archive * @param string $path * @return bool */ - public abstract function fileExists($path); + abstract public function fileExists($path); /** * remove a file or folder from the archive * @param string $path * @return bool */ - public abstract function remove($path); + abstract public function remove($path); /** * get a file handler * @param string $path * @param string $mode * @return resource */ - public abstract function getStream($path, $mode); + abstract public function getStream($path, $mode); /** * add a folder and all its content * @param string $path diff --git a/lib/private/Archive/TAR.php b/lib/private/Archive/TAR.php index d90e21305c3..f6e7c12d02d 100644 --- a/lib/private/Archive/TAR.php +++ b/lib/private/Archive/TAR.php @@ -63,7 +63,7 @@ class TAR extends Archive { * @param string $file * @return integer */ - static public function getTarType($file) { + public static function getTarType($file) { if (strpos($file, '.')) { $extension = substr($file, strrpos($file, '.')); switch ($extension) { diff --git a/lib/private/Authentication/Login/ALoginCommand.php b/lib/private/Authentication/Login/ALoginCommand.php index 8ad162842bf..effc9adf1c0 100644 --- a/lib/private/Authentication/Login/ALoginCommand.php +++ b/lib/private/Authentication/Login/ALoginCommand.php @@ -43,5 +43,5 @@ abstract class ALoginCommand { } } - public abstract function process(LoginData $loginData): LoginResult; + abstract public function process(LoginData $loginData): LoginResult; } diff --git a/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialEntity.php b/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialEntity.php index c9ebf8ce456..2a4740bef4b 100644 --- a/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialEntity.php +++ b/lib/private/Authentication/WebAuthn/Db/PublicKeyCredentialEntity.php @@ -62,7 +62,7 @@ class PublicKeyCredentialEntity extends Entity implements JsonSerializable { $this->addType('data', 'string'); } - static function fromPublicKeyCrendentialSource(string $name, PublicKeyCredentialSource $publicKeyCredentialSource): PublicKeyCredentialEntity { + public static function fromPublicKeyCrendentialSource(string $name, PublicKeyCredentialSource $publicKeyCredentialSource): PublicKeyCredentialEntity { $publicKeyCredentialEntity = new self(); $publicKeyCredentialEntity->setName($name); @@ -73,7 +73,7 @@ class PublicKeyCredentialEntity extends Entity implements JsonSerializable { return $publicKeyCredentialEntity; } - function toPublicKeyCredentialSource(): PublicKeyCredentialSource { + public function toPublicKeyCredentialSource(): PublicKeyCredentialSource { return PublicKeyCredentialSource::createFromArray( json_decode($this->getData(), true) ); diff --git a/lib/private/DB/MDB2SchemaWriter.php b/lib/private/DB/MDB2SchemaWriter.php index 3cabff9d8f1..4af68709387 100644 --- a/lib/private/DB/MDB2SchemaWriter.php +++ b/lib/private/DB/MDB2SchemaWriter.php @@ -36,7 +36,7 @@ class MDB2SchemaWriter { * @param \OC\DB\Connection $conn * @return bool */ - static public function saveSchemaToFile($file, \OC\DB\Connection $conn) { + public static function saveSchemaToFile($file, \OC\DB\Connection $conn) { $config = \OC::$server->getConfig(); $xml = new \SimpleXMLElement('<database/>'); diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 2dfefeff662..78749da0cac 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -963,7 +963,7 @@ class Cache implements ICache { * @return array first element holding the storage id, second the path * @deprecated use getPathById() instead */ - static public function getById($id) { + public static function getById($id) { $query = \OC::$server->getDatabaseConnection()->getQueryBuilder(); $query->select('path', 'storage') ->from('filecache') diff --git a/lib/private/Files/Cache/Wrapper/CacheWrapper.php b/lib/private/Files/Cache/Wrapper/CacheWrapper.php index 302758bbc22..4901a530799 100644 --- a/lib/private/Files/Cache/Wrapper/CacheWrapper.php +++ b/lib/private/Files/Cache/Wrapper/CacheWrapper.php @@ -319,7 +319,7 @@ class CacheWrapper extends Cache { * @param int $id * @return array first element holding the storage id, second the path */ - static public function getById($id) { + public static function getById($id) { return parent::getById($id); } } diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php index 248b6d2d854..1e9902f8871 100644 --- a/lib/private/Files/Filesystem.php +++ b/lib/private/Files/Filesystem.php @@ -277,7 +277,7 @@ class Filesystem { * @param string $path * @return string */ - static public function getMountPoint($path) { + public static function getMountPoint($path) { if (!self::$mounts) { \OC_Util::setupFS(); } @@ -295,7 +295,7 @@ class Filesystem { * @param string $path * @return string[] */ - static public function getMountPoints($path) { + public static function getMountPoints($path) { if (!self::$mounts) { \OC_Util::setupFS(); } @@ -349,7 +349,7 @@ class Filesystem { * @param string $path * @return array an array consisting of the storage and the internal path */ - static public function resolvePath($path) { + public static function resolvePath($path) { if (!self::$mounts) { \OC_Util::setupFS(); } @@ -361,7 +361,7 @@ class Filesystem { } } - static public function init($user, $root) { + public static function init($user, $root) { if (self::$defaultInstance) { return false; } @@ -380,7 +380,7 @@ class Filesystem { return true; } - static public function initMountManager() { + public static function initMountManager() { if (!self::$mounts) { self::$mounts = \OC::$server->getMountManager(); } @@ -489,14 +489,14 @@ class Filesystem { * * @return View */ - static public function getView() { + public static function getView() { return self::$defaultInstance; } /** * tear down the filesystem, removing all storage providers */ - static public function tearDown() { + public static function tearDown() { self::clearMounts(); self::$defaultInstance = null; } @@ -508,7 +508,7 @@ class Filesystem { * * Returns path like /admin/files */ - static public function getRoot() { + public static function getRoot() { if (!self::$defaultInstance) { return null; } @@ -532,7 +532,7 @@ class Filesystem { * @param array $arguments * @param string $mountpoint */ - static public function mount($class, $arguments, $mountpoint) { + public static function mount($class, $arguments, $mountpoint) { if (!self::$mounts) { \OC_Util::setupFS(); } @@ -548,7 +548,7 @@ class Filesystem { * @param string $path * @return string */ - static public function getLocalFile($path) { + public static function getLocalFile($path) { return self::$defaultInstance->getLocalFile($path); } @@ -556,7 +556,7 @@ class Filesystem { * @param string $path * @return string */ - static public function getLocalFolder($path) { + public static function getLocalFolder($path) { return self::$defaultInstance->getLocalFolder($path); } @@ -566,7 +566,7 @@ class Filesystem { * @param string $path * @return string */ - static public function getLocalPath($path) { + public static function getLocalPath($path) { $datadir = \OC_User::getHome(\OC_User::getUser()) . '/files'; $newpath = $path; if (strncmp($newpath, $datadir, strlen($datadir)) == 0) { @@ -581,7 +581,7 @@ class Filesystem { * @param string $path * @return bool */ - static public function isValidPath($path) { + public static function isValidPath($path) { $path = self::normalizePath($path); if (!$path || $path[0] !== '/') { $path = '/' . $path; @@ -598,7 +598,7 @@ class Filesystem { * * @param array $data from hook */ - static public function isBlacklisted($data) { + public static function isBlacklisted($data) { if (isset($data['path'])) { $path = $data['path']; } elseif (isset($data['newpath'])) { @@ -615,7 +615,7 @@ class Filesystem { * @param string $filename * @return bool */ - static public function isFileBlacklisted($filename) { + public static function isFileBlacklisted($filename) { $filename = self::normalizePath($filename); $blacklist = \OC::$server->getConfig()->getSystemValue('blacklisted_files', ['.htaccess']); @@ -630,7 +630,7 @@ class Filesystem { * @param string $dir * @return boolean */ - static public function isIgnoredDir($dir) { + public static function isIgnoredDir($dir) { if ($dir === '.' || $dir === '..') { return true; } @@ -640,128 +640,128 @@ class Filesystem { /** * following functions are equivalent to their php builtin equivalents for arguments/return values. */ - static public function mkdir($path) { + public static function mkdir($path) { return self::$defaultInstance->mkdir($path); } - static public function rmdir($path) { + public static function rmdir($path) { return self::$defaultInstance->rmdir($path); } - static public function is_dir($path) { + public static function is_dir($path) { return self::$defaultInstance->is_dir($path); } - static public function is_file($path) { + public static function is_file($path) { return self::$defaultInstance->is_file($path); } - static public function stat($path) { + public static function stat($path) { return self::$defaultInstance->stat($path); } - static public function filetype($path) { + public static function filetype($path) { return self::$defaultInstance->filetype($path); } - static public function filesize($path) { + public static function filesize($path) { return self::$defaultInstance->filesize($path); } - static public function readfile($path) { + public static function readfile($path) { return self::$defaultInstance->readfile($path); } - static public function isCreatable($path) { + public static function isCreatable($path) { return self::$defaultInstance->isCreatable($path); } - static public function isReadable($path) { + public static function isReadable($path) { return self::$defaultInstance->isReadable($path); } - static public function isUpdatable($path) { + public static function isUpdatable($path) { return self::$defaultInstance->isUpdatable($path); } - static public function isDeletable($path) { + public static function isDeletable($path) { return self::$defaultInstance->isDeletable($path); } - static public function isSharable($path) { + public static function isSharable($path) { return self::$defaultInstance->isSharable($path); } - static public function file_exists($path) { + public static function file_exists($path) { return self::$defaultInstance->file_exists($path); } - static public function filemtime($path) { + public static function filemtime($path) { return self::$defaultInstance->filemtime($path); } - static public function touch($path, $mtime = null) { + public static function touch($path, $mtime = null) { return self::$defaultInstance->touch($path, $mtime); } /** * @return string */ - static public function file_get_contents($path) { + public static function file_get_contents($path) { return self::$defaultInstance->file_get_contents($path); } - static public function file_put_contents($path, $data) { + public static function file_put_contents($path, $data) { return self::$defaultInstance->file_put_contents($path, $data); } - static public function unlink($path) { + public static function unlink($path) { return self::$defaultInstance->unlink($path); } - static public function rename($path1, $path2) { + public static function rename($path1, $path2) { return self::$defaultInstance->rename($path1, $path2); } - static public function copy($path1, $path2) { + public static function copy($path1, $path2) { return self::$defaultInstance->copy($path1, $path2); } - static public function fopen($path, $mode) { + public static function fopen($path, $mode) { return self::$defaultInstance->fopen($path, $mode); } /** * @return string */ - static public function toTmpFile($path) { + public static function toTmpFile($path) { return self::$defaultInstance->toTmpFile($path); } - static public function fromTmpFile($tmpFile, $path) { + public static function fromTmpFile($tmpFile, $path) { return self::$defaultInstance->fromTmpFile($tmpFile, $path); } - static public function getMimeType($path) { + public static function getMimeType($path) { return self::$defaultInstance->getMimeType($path); } - static public function hash($type, $path, $raw = false) { + public static function hash($type, $path, $raw = false) { return self::$defaultInstance->hash($type, $path, $raw); } - static public function free_space($path = '/') { + public static function free_space($path = '/') { return self::$defaultInstance->free_space($path); } - static public function search($query) { + public static function search($query) { return self::$defaultInstance->search($query); } /** * @param string $query */ - static public function searchByMime($query) { + public static function searchByMime($query) { return self::$defaultInstance->searchByMime($query); } @@ -770,7 +770,7 @@ class Filesystem { * @param string $userId owner of the tags * @return FileInfo[] array or file info */ - static public function searchByTag($tag, $userId) { + public static function searchByTag($tag, $userId) { return self::$defaultInstance->searchByTag($tag, $userId); } @@ -781,7 +781,7 @@ class Filesystem { * @param int $time * @return bool */ - static public function hasUpdated($path, $time) { + public static function hasUpdated($path, $time) { return self::$defaultInstance->hasUpdated($path, $time); } @@ -912,7 +912,7 @@ class Filesystem { * @param string $path * @return string */ - static public function getETag($path) { + public static function getETag($path) { return self::$defaultInstance->getETag($path); } } diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php index 0939dd2a23c..a0a19954a8d 100644 --- a/lib/private/Files/ObjectStore/S3ObjectTrait.php +++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php @@ -49,7 +49,7 @@ trait S3ObjectTrait { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function readObject($urn) { + public function readObject($urn) { return SeekableHttpStream::open(function ($range) use ($urn) { $command = $this->getConnection()->getCommand('GetObject', [ 'Bucket' => $this->bucket, @@ -81,7 +81,7 @@ trait S3ObjectTrait { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function writeObject($urn, $stream) { + public function writeObject($urn, $stream) { $count = 0; $countStream = CallbackWrapper::wrap($stream, function ($read) use (&$count) { $count += $read; @@ -114,7 +114,7 @@ trait S3ObjectTrait { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function deleteObject($urn) { + public function deleteObject($urn) { $this->getConnection()->deleteObject([ 'Bucket' => $this->bucket, 'Key' => $urn, diff --git a/lib/private/Files/ObjectStore/StorageObjectStore.php b/lib/private/Files/ObjectStore/StorageObjectStore.php index 0321b7cdf5f..6151214ca70 100644 --- a/lib/private/Files/ObjectStore/StorageObjectStore.php +++ b/lib/private/Files/ObjectStore/StorageObjectStore.php @@ -44,7 +44,7 @@ class StorageObjectStore implements IObjectStore { * @return string the container or bucket name where objects are stored * @since 7.0.0 */ - function getStorageId() { + public function getStorageId() { $this->storage->getId(); } @@ -54,7 +54,7 @@ class StorageObjectStore implements IObjectStore { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function readObject($urn) { + public function readObject($urn) { $handle = $this->storage->fopen($urn, 'r'); if ($handle) { return $handle; @@ -69,7 +69,7 @@ class StorageObjectStore implements IObjectStore { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function writeObject($urn, $stream) { + public function writeObject($urn, $stream) { $handle = $this->storage->fopen($urn, 'w'); if ($handle) { stream_copy_to_stream($stream, $handle); @@ -85,7 +85,7 @@ class StorageObjectStore implements IObjectStore { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - function deleteObject($urn) { + public function deleteObject($urn) { $this->storage->unlink($urn); } diff --git a/lib/private/Files/Stream/Quota.php b/lib/private/Files/Stream/Quota.php index d0609d7e459..3bf46264b83 100644 --- a/lib/private/Files/Stream/Quota.php +++ b/lib/private/Files/Stream/Quota.php @@ -44,7 +44,7 @@ class Quota extends Wrapper { * @param int $limit * @return resource */ - static public function wrap($stream, $limit) { + public static function wrap($stream, $limit) { $context = stream_context_create([ 'quota' => [ 'source' => $stream, diff --git a/lib/private/Memcache/APCu.php b/lib/private/Memcache/APCu.php index 3523ea2a86b..5886f75731a 100644 --- a/lib/private/Memcache/APCu.php +++ b/lib/private/Memcache/APCu.php @@ -150,7 +150,7 @@ class APCu extends Cache implements IMemcache { /** * @return bool */ - static public function isAvailable() { + public static function isAvailable() { if (!extension_loaded('apcu')) { return false; } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enabled')) { diff --git a/lib/private/Memcache/ArrayCache.php b/lib/private/Memcache/ArrayCache.php index 407f4af06f4..8c91d9fcbbb 100644 --- a/lib/private/Memcache/ArrayCache.php +++ b/lib/private/Memcache/ArrayCache.php @@ -154,7 +154,7 @@ class ArrayCache extends Cache implements IMemcache { /** * {@inheritDoc} */ - static public function isAvailable() { + public static function isAvailable() { return true; } } diff --git a/lib/private/Memcache/Memcached.php b/lib/private/Memcache/Memcached.php index e3fc1b35f1a..eff76a41c45 100644 --- a/lib/private/Memcache/Memcached.php +++ b/lib/private/Memcache/Memcached.php @@ -210,7 +210,7 @@ class Memcached extends Cache implements IMemcache { return $result; } - static public function isAvailable() { + public static function isAvailable() { return extension_loaded('memcached'); } diff --git a/lib/private/Memcache/NullCache.php b/lib/private/Memcache/NullCache.php index 371c9381f56..6ea90e9045b 100644 --- a/lib/private/Memcache/NullCache.php +++ b/lib/private/Memcache/NullCache.php @@ -67,7 +67,7 @@ class NullCache extends Cache implements \OCP\IMemcache { return true; } - static public function isAvailable() { + public static function isAvailable() { return true; } } diff --git a/lib/private/Memcache/Redis.php b/lib/private/Memcache/Redis.php index 7023c6b7871..af1a6864b43 100644 --- a/lib/private/Memcache/Redis.php +++ b/lib/private/Memcache/Redis.php @@ -174,7 +174,7 @@ class Redis extends Cache implements IMemcacheTTL { self::$cache->expire($this->getNameSpace() . $key, $ttl); } - static public function isAvailable() { + public static function isAvailable() { return \OC::$server->getGetRedisFactory()->isAvailable(); } } diff --git a/lib/private/Server.php b/lib/private/Server.php index 629673418f7..1a3eabc852e 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1971,14 +1971,14 @@ class Server extends ServerContainer implements IServerContainer { /** * @return IMountManager **/ - function getMountManager() { + public function getMountManager() { return $this->query(IMountManager::class); } /** * @return IUserMountCache */ - function getUserMountCache() { + public function getUserMountCache() { return $this->query(IUserMountCache::class); } diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 89904827b2a..ddddb8704c8 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -287,7 +287,7 @@ class TemplateLayout extends \OC_Template { * @param array $styles * @return array */ - static public function findStylesheetFiles($styles, $compileScss = true) { + public static function findStylesheetFiles($styles, $compileScss = true) { // Read the selected theme from the config file $theme = \OC_Util::getTheme(); @@ -328,7 +328,7 @@ class TemplateLayout extends \OC_Template { * @param array $scripts * @return array */ - static public function findJavascriptFiles($scripts) { + public static function findJavascriptFiles($scripts) { // Read the selected theme from the config file $theme = \OC_Util::getTheme(); diff --git a/lib/private/legacy/OC_DB.php b/lib/private/legacy/OC_DB.php index 63f1447ad91..1d2e9bd1429 100644 --- a/lib/private/legacy/OC_DB.php +++ b/lib/private/legacy/OC_DB.php @@ -58,7 +58,7 @@ class OC_DB { * * SQL query via Doctrine prepare(), needs to be execute()'d! */ - static public function prepare($query , $limit = null, $offset = null, $isManipulation = null) { + public static function prepare($query , $limit = null, $offset = null, $isManipulation = null) { $connection = \OC::$server->getDatabaseConnection(); if ($isManipulation === null) { @@ -84,7 +84,7 @@ class OC_DB { * @param string $sql * @return bool */ - static public function isManipulation($sql) { + public static function isManipulation($sql) { $selectOccurrence = stripos($sql, 'SELECT'); if ($selectOccurrence !== false && $selectOccurrence < 10) { return false; @@ -113,7 +113,7 @@ class OC_DB { * @return OC_DB_StatementWrapper * @throws \OC\DatabaseException */ - static public function executeAudited($stmt, array $parameters = []) { + public static function executeAudited($stmt, array $parameters = []) { if (is_string($stmt)) { // convert to an array with 'sql' if (stripos($stmt, 'LIMIT') !== false) { //OFFSET requires LIMIT, so we only need to check for LIMIT diff --git a/lib/private/legacy/OC_FileChunking.php b/lib/private/legacy/OC_FileChunking.php index 37cf42a31cb..188023a960a 100644 --- a/lib/private/legacy/OC_FileChunking.php +++ b/lib/private/legacy/OC_FileChunking.php @@ -40,7 +40,7 @@ class OC_FileChunking { */ protected $ttl; - static public function decodeName($name) { + public static function decodeName($name) { preg_match('/(?P<name>.*)-chunking-(?P<transferid>\d+)-(?P<chunkcount>\d+)-(?P<index>\d+)/', $name, $matches); return $matches; } diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index 3439d1f8936..8cd492de117 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -135,7 +135,7 @@ class OC_Helper { * @param string $dest target folder * */ - static function copyr($src, $dest) { + public static function copyr($src, $dest) { if (is_dir($src)) { if (!is_dir($dest)) { mkdir($dest); @@ -157,7 +157,7 @@ class OC_Helper { * @param bool $deleteSelf if set to false only the content of the folder will be deleted * @return bool */ - static function rmdirr($dir, $deleteSelf = true) { + public static function rmdirr($dir, $deleteSelf = true) { if (is_dir($dir)) { $files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS), @@ -193,7 +193,7 @@ class OC_Helper { * @deprecated 18.0.0 * @return \OC\Files\Type\TemplateManager */ - static public function getFileTemplateManager() { + public static function getFileTemplateManager() { if (!self::$templateManager) { self::$templateManager = new \OC\Files\Type\TemplateManager(); } diff --git a/lib/private/legacy/OC_Hook.php b/lib/private/legacy/OC_Hook.php index 4e75c9da747..980eb609259 100644 --- a/lib/private/legacy/OC_Hook.php +++ b/lib/private/legacy/OC_Hook.php @@ -51,7 +51,7 @@ class OC_Hook { * * TODO: write example */ - static public function connect($signalClass, $signalName, $slotClass, $slotName) { + public static function connect($signalClass, $signalName, $slotClass, $slotName) { // If we're trying to connect to an emitting class that isn't // yet registered, register it if (!array_key_exists($signalClass, self::$registered)) { @@ -91,7 +91,7 @@ class OC_Hook { * * TODO: write example */ - static public function emit($signalClass, $signalName, $params = []) { + public static function emit($signalClass, $signalName, $params = []) { // Return false if no hook handlers are listening to this // emitting class @@ -129,7 +129,7 @@ class OC_Hook { * @param string $signalClass * @param string $signalName */ - static public function clear($signalClass='', $signalName='') { + public static function clear($signalClass='', $signalName='') { if ($signalClass) { if ($signalName) { self::$registered[$signalClass][$signalName]=[]; @@ -145,7 +145,7 @@ class OC_Hook { * DO NOT USE! * For unit tests ONLY! */ - static public function getHooks() { + public static function getHooks() { return self::$registered; } } diff --git a/lib/private/legacy/OC_Response.php b/lib/private/legacy/OC_Response.php index bbeb6258109..89f0ee5247b 100644 --- a/lib/private/legacy/OC_Response.php +++ b/lib/private/legacy/OC_Response.php @@ -33,7 +33,7 @@ class OC_Response { * @param string $filename file name * @param string $type disposition type, either 'attachment' or 'inline' */ - static public function setContentDispositionHeader($filename, $type = 'attachment') { + public static function setContentDispositionHeader($filename, $type = 'attachment') { if (\OC::$server->getRequest()->isUserAgent( [ \OC\AppFramework\Http\Request::USER_AGENT_IE, @@ -51,7 +51,7 @@ class OC_Response { * Sets the content length header (with possible workarounds) * @param string|int|float $length Length to be sent */ - static public function setContentLengthHeader($length) { + public static function setContentLengthHeader($length) { if (PHP_INT_SIZE === 4) { if ($length > PHP_INT_MAX && stripos(PHP_SAPI, 'apache') === 0) { // Apache PHP SAPI casts Content-Length headers to PHP integers. diff --git a/lib/public/Files.php b/lib/public/Files.php index a1ff8a6d5a9..33bd3296193 100644 --- a/lib/public/Files.php +++ b/lib/public/Files.php @@ -54,7 +54,7 @@ class Files { * @since 5.0.0 * @deprecated 14.0.0 */ - static public function rmdirr($dir) { + public static function rmdirr($dir) { return \OC_Helper::rmdirr($dir); } @@ -66,7 +66,7 @@ class Files { * @since 5.0.0 * @deprecated 14.0.0 */ - static public function getMimeType($path) { + public static function getMimeType($path) { return \OC::$server->getMimeTypeDetector()->detect($path); } @@ -77,7 +77,7 @@ class Files { * @since 6.0.0 * @deprecated 14.0.0 */ - static public function searchByMime($mimetype) { + public static function searchByMime($mimetype) { return \OC\Files\Filesystem::searchByMime($mimetype); } diff --git a/lib/public/Util.php b/lib/public/Util.php index 46d818fc497..5e805af4c40 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -336,7 +336,7 @@ class Util { * TODO: write example * @since 4.0.0 */ - static public function connectHook($signalClass, $signalName, $slotClass, $slotName) { + public static function connectHook($signalClass, $signalName, $slotClass, $slotName) { return \OC_Hook::connect($signalClass, $signalName, $slotClass, $slotName); } @@ -350,7 +350,7 @@ class Util { * TODO: write example * @since 4.0.0 */ - static public function emitHook($signalclass, $signalname, $params = []) { + public static function emitHook($signalclass, $signalname, $params = []) { return \OC_Hook::emit($signalclass, $signalname, $params); } diff --git a/tests/lib/APITest.php b/tests/lib/APITest.php index ebb03425375..7027d64eceb 100644 --- a/tests/lib/APITest.php +++ b/tests/lib/APITest.php @@ -17,7 +17,7 @@ class APITest extends \Test\TestCase { /** * @param string $message */ - function buildResponse($shipped, $data, $code, $message=null) { + public function buildResponse($shipped, $data, $code, $message=null) { $resp = new \OC\OCS\Result($data, $code, $message); $resp->addHeader('KEY', 'VALUE'); return [ @@ -32,7 +32,7 @@ class APITest extends \Test\TestCase { /** * @param \OC\OCS\Result $result */ - function checkResult($result, $success) { + public function checkResult($result, $success) { // Check response is of correct type $this->assertInstanceOf(\OC\OCS\Result::class, $result); // Check if it succeeded diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php index 40cd308f886..09a939f4855 100644 --- a/tests/lib/App/DependencyAnalyzerTest.php +++ b/tests/lib/App/DependencyAnalyzerTest.php @@ -144,7 +144,7 @@ class DependencyAnalyzerTest extends TestCase { * @param $expectedMissing * @param $libs */ - function testLibs($expectedMissing, $libs) { + public function testLibs($expectedMissing, $libs) { $app = [ 'dependencies' => [ ] @@ -164,7 +164,7 @@ class DependencyAnalyzerTest extends TestCase { * @param $expectedMissing * @param $oss */ - function testOS($expectedMissing, $oss) { + public function testOS($expectedMissing, $oss) { $app = [ 'dependencies' => [] ]; @@ -183,7 +183,7 @@ class DependencyAnalyzerTest extends TestCase { * @param $expectedMissing * @param $oc */ - function testOC($expectedMissing, $oc) { + public function testOC($expectedMissing, $oc) { $app = [ 'dependencies' => [] ]; @@ -200,7 +200,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - function providesOC() { + public function providesOC() { return [ // no version -> no missing dependency [ @@ -428,7 +428,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - function providesOS() { + public function providesOS() { return [ [[], null], [[], []], @@ -440,7 +440,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - function providesLibs() { + public function providesLibs() { return [ // we expect curl to exist [[], 'curl'], @@ -470,7 +470,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - function providesCommands() { + public function providesCommands() { return [ [[], null], // grep is known on linux @@ -488,7 +488,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - function providesDatabases() { + public function providesDatabases() { return [ // non BC - in case on databases are defined -> all are supported [[], null], @@ -501,7 +501,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - function providesPhpVersion() { + public function providesPhpVersion() { return [ [[], null, null, null], [[], '5.4', null, null], diff --git a/tests/lib/AppFramework/Http/RequestStream.php b/tests/lib/AppFramework/Http/RequestStream.php index 1dcfbce46d1..3868ed16505 100644 --- a/tests/lib/AppFramework/Http/RequestStream.php +++ b/tests/lib/AppFramework/Http/RequestStream.php @@ -10,7 +10,7 @@ class RequestStream { protected $position; protected $varname; - function stream_open($path, $mode, $options, &$opened_path) { + public function stream_open($path, $mode, $options, &$opened_path) { $url = parse_url($path); $this->varname = $url["host"]; $this->position = 0; @@ -18,13 +18,13 @@ class RequestStream { return true; } - function stream_read($count) { + public function stream_read($count) { $ret = substr($GLOBALS[$this->varname], $this->position, $count); $this->position += strlen($ret); return $ret; } - function stream_write($data) { + public function stream_write($data) { $left = substr($GLOBALS[$this->varname], 0, $this->position); $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); $GLOBALS[$this->varname] = $left . $data . $right; @@ -32,15 +32,15 @@ class RequestStream { return strlen($data); } - function stream_tell() { + public function stream_tell() { return $this->position; } - function stream_eof() { + public function stream_eof() { return $this->position >= strlen($GLOBALS[$this->varname]); } - function stream_seek($offset, $whence) { + public function stream_seek($offset, $whence) { switch ($whence) { case SEEK_SET: if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { @@ -96,7 +96,7 @@ class RequestStream { //return false; } - function stream_metadata($path, $option, $var) { + public function stream_metadata($path, $option, $var) { if ($option == STREAM_META_TOUCH) { $url = parse_url($path); $varname = $url["host"]; diff --git a/tests/lib/AppFramework/Http/RequestTest.php b/tests/lib/AppFramework/Http/RequestTest.php index 2004bd2e6b5..a8e2f2248c6 100644 --- a/tests/lib/AppFramework/Http/RequestTest.php +++ b/tests/lib/AppFramework/Http/RequestTest.php @@ -902,7 +902,7 @@ class RequestTest extends \Test\TestCase { /** * @return array */ - function userAgentProvider() { + public function userAgentProvider() { return [ [ 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)', diff --git a/tests/lib/AppFramework/Http/ResponseTest.php b/tests/lib/AppFramework/Http/ResponseTest.php index 3978326d130..e6f88b6a6e9 100644 --- a/tests/lib/AppFramework/Http/ResponseTest.php +++ b/tests/lib/AppFramework/Http/ResponseTest.php @@ -118,7 +118,7 @@ class ResponseTest extends \Test\TestCase { } - function testSetCookies() { + public function testSetCookies() { $expected = [ 'foo' => [ 'value' => 'bar', @@ -137,7 +137,7 @@ class ResponseTest extends \Test\TestCase { } - function testInvalidateCookie() { + public function testInvalidateCookie() { $this->childResponse->addCookie('foo', 'bar'); $this->childResponse->invalidateCookie('foo'); $expected = [ @@ -153,7 +153,7 @@ class ResponseTest extends \Test\TestCase { } - function testInvalidateCookies() { + public function testInvalidateCookies() { $this->childResponse->addCookie('foo', 'bar'); $this->childResponse->addCookie('bar', 'foo'); $expected = [ diff --git a/tests/lib/Cache/CappedMemoryCacheTest.php b/tests/lib/Cache/CappedMemoryCacheTest.php index 00231004fe5..db0d2bd1193 100644 --- a/tests/lib/Cache/CappedMemoryCacheTest.php +++ b/tests/lib/Cache/CappedMemoryCacheTest.php @@ -49,7 +49,7 @@ class CappedMemoryCacheTest extends TestCache { $this->assertTrue($instance->hasKey('5')); } - function testClear() { + public function testClear() { $value = 'ipsum lorum'; $this->instance->set('1_value1', $value); $this->instance->set('1_value2', $value); @@ -63,7 +63,7 @@ class CappedMemoryCacheTest extends TestCache { $this->assertFalse($this->instance->hasKey('3_value1')); } - function testIndirectSet() { + public function testIndirectSet() { $this->instance->set('array', []); $this->instance['array'][] = 'foo'; diff --git a/tests/lib/Cache/FileCacheTest.php b/tests/lib/Cache/FileCacheTest.php index 96c35ebf786..1a28724ae12 100644 --- a/tests/lib/Cache/FileCacheTest.php +++ b/tests/lib/Cache/FileCacheTest.php @@ -49,7 +49,7 @@ class FileCacheTest extends TestCache { * */ private $rootView; - function skip() { + public function skip() { //$this->skipUnless(OC_User::isLoggedIn()); } diff --git a/tests/lib/Cache/TestCache.php b/tests/lib/Cache/TestCache.php index b7aa01f350f..9dfc46eb5a0 100644 --- a/tests/lib/Cache/TestCache.php +++ b/tests/lib/Cache/TestCache.php @@ -22,7 +22,7 @@ abstract class TestCache extends \Test\TestCase { parent::tearDown(); } - function testSimple() { + public function testSimple() { $this->assertNull($this->instance->get('value1')); $this->assertFalse($this->instance->hasKey('value1')); @@ -51,7 +51,7 @@ abstract class TestCache extends \Test\TestCase { $this->assertFalse($this->instance->hasKey('value1')); } - function testClear() { + public function testClear() { $value='ipsum lorum'; $this->instance->set('1_value1', $value . '1'); $this->instance->set('1_value2', $value . '2'); diff --git a/tests/lib/Command/AsyncBusTest.php b/tests/lib/Command/AsyncBusTest.php index 31f28bb88c9..bfe201ed369 100644 --- a/tests/lib/Command/AsyncBusTest.php +++ b/tests/lib/Command/AsyncBusTest.php @@ -23,7 +23,7 @@ class SimpleCommand implements ICommand { class StateFullCommand implements ICommand { private $state; - function __construct($state) { + public function __construct($state) { $this->state = $state; } diff --git a/tests/lib/DateTimeFormatterTest.php b/tests/lib/DateTimeFormatterTest.php index 42870bf6281..2beb89654f6 100644 --- a/tests/lib/DateTimeFormatterTest.php +++ b/tests/lib/DateTimeFormatterTest.php @@ -176,7 +176,7 @@ class DateTimeFormatterTest extends TestCase { } - function testFormatDateWithInvalidTZ() { + public function testFormatDateWithInvalidTZ() { $this->expectException(\Exception::class); $this->formatter->formatDate(1350129205, 'long', new \DateTimeZone('Mordor/Barad-dûr')); diff --git a/tests/lib/ErrorHandlerTest.php b/tests/lib/ErrorHandlerTest.php index 32112c19787..702f64bfb99 100644 --- a/tests/lib/ErrorHandlerTest.php +++ b/tests/lib/ErrorHandlerTest.php @@ -28,7 +28,7 @@ class ErrorHandlerTest extends \Test\TestCase { * provide username, password combinations for testRemovePassword * @return array */ - function passwordProvider() { + public function passwordProvider() { return [ ['user', 'password'], ['user@owncloud.org', 'password'], @@ -43,7 +43,7 @@ class ErrorHandlerTest extends \Test\TestCase { * @param string $username * @param string $password */ - function testRemovePassword($username, $password) { + public function testRemovePassword($username, $password) { $url = 'http://'.$username.':'.$password.'@owncloud.org'; $expectedResult = 'http://xxx:xxx@owncloud.org'; $result = TestableErrorHandler::testRemovePassword($url); diff --git a/tests/lib/Files/Cache/CacheTest.php b/tests/lib/Files/Cache/CacheTest.php index f3e61e8e820..97663c16c02 100644 --- a/tests/lib/Files/Cache/CacheTest.php +++ b/tests/lib/Files/Cache/CacheTest.php @@ -265,7 +265,7 @@ class CacheTest extends \Test\TestCase { $this->assertFalse($this->cache->inCache($dir2)); } - function testStatus() { + public function testStatus() { $this->assertEquals(\OC\Files\Cache\Cache::NOT_FOUND, $this->cache->getStatus('foo')); $this->cache->put('foo', ['size' => -1]); $this->assertEquals(\OC\Files\Cache\Cache::PARTIAL, $this->cache->getStatus('foo')); @@ -296,7 +296,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals($fileName, $cacheEntry['path']); } - function testSearch() { + public function testSearch() { $file1 = 'folder'; $file2 = 'folder/foobar'; $file3 = 'folder/foo'; @@ -325,7 +325,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals(2, count($this->cache->searchByMime('foo/file'))); } - function testSearchQueryByTag() { + public function testSearchQueryByTag() { $userId = static::getUniqueID('user'); \OC::$server->getUserManager()->createUser($userId, $userId); static::loginAsUser($userId); @@ -380,7 +380,7 @@ class CacheTest extends \Test\TestCase { } } - function testSearchByQuery() { + public function testSearchByQuery() { $file1 = 'folder'; $file2 = 'folder/foobar'; $file3 = 'folder/foo'; @@ -415,7 +415,7 @@ class CacheTest extends \Test\TestCase { , 10, 0, [], $user))); } - function movePathProvider() { + public function movePathProvider() { return [ ['folder/foo', 'folder/foobar', ['1', '2']], ['folder/foo', 'foo', ['1', '2']], @@ -426,7 +426,7 @@ class CacheTest extends \Test\TestCase { /** * @dataProvider movePathProvider */ - function testMove($sourceFolder, $targetFolder, $children) { + public function testMove($sourceFolder, $targetFolder, $children) { $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/bar']; $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory']; @@ -461,7 +461,7 @@ class CacheTest extends \Test\TestCase { } } - function testGetIncomplete() { + public function testGetIncomplete() { $file1 = 'folder1'; $file2 = 'folder2'; $file3 = 'folder3'; @@ -478,13 +478,13 @@ class CacheTest extends \Test\TestCase { $this->assertEquals($file3, $this->cache->getIncomplete()); } - function testNonExisting() { + public function testNonExisting() { $this->assertFalse($this->cache->get('foo.txt')); $this->assertFalse($this->cache->get(-1)); $this->assertEquals([], $this->cache->getFolderContents('foo')); } - function testGetById() { + public function testGetById() { $storageId = $this->storage->getId(); $data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file']; $id = $this->cache->put('foo', $data); @@ -495,7 +495,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals([$storageId, 'foo'], \OC\Files\Cache\Cache::getById($id)); } - function testStorageMTime() { + public function testStorageMTime() { $data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file']; $this->cache->put('foo', $data); $cachedData = $this->cache->get('foo'); @@ -512,7 +512,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals(25, $cachedData['mtime']); } - function testLongId() { + public function testLongId() { $storage = new LongId([]); $cache = $storage->getCache(); $storageId = $storage->getId(); @@ -606,7 +606,7 @@ class CacheTest extends \Test\TestCase { $this->assertEquals(1, count($this->cache->getFolderContents('folder'))); } - function bogusPathNamesProvider() { + public function bogusPathNamesProvider() { return [ ['/bogus.txt', 'bogus.txt'], ['//bogus.txt', 'bogus.txt'], diff --git a/tests/lib/Files/Cache/ScannerTest.php b/tests/lib/Files/Cache/ScannerTest.php index c51ce0388d5..f9c05d52ee5 100644 --- a/tests/lib/Files/Cache/ScannerTest.php +++ b/tests/lib/Files/Cache/ScannerTest.php @@ -49,7 +49,7 @@ class ScannerTest extends \Test\TestCase { parent::tearDown(); } - function testFile() { + public function testFile() { $data = "dummy file data\n"; $this->storage->file_put_contents('foo.txt', $data); $this->scanner->scanFile('foo.txt'); @@ -70,7 +70,7 @@ class ScannerTest extends \Test\TestCase { $this->assertEquals($cachedData['mimetype'], 'image/png'); } - function testFile4Byte() { + public function testFile4Byte() { $data = "dummy file data\n"; $this->storage->file_put_contents('foo🙈.txt', $data); @@ -88,7 +88,7 @@ class ScannerTest extends \Test\TestCase { } } - function testFileInvalidChars() { + public function testFileInvalidChars() { $data = "dummy file data\n"; $this->storage->file_put_contents("foo\nbar.txt", $data); @@ -105,7 +105,7 @@ class ScannerTest extends \Test\TestCase { $this->storage->file_put_contents('folder/bar.txt', $textData); } - function testFolder() { + public function testFolder() { $this->fillTestFolders(); $this->scanner->scan(''); @@ -127,7 +127,7 @@ class ScannerTest extends \Test\TestCase { $this->assertEquals($cachedDataFolder2['size'], $cachedDataText2['size']); } - function testShallow() { + public function testShallow() { $this->fillTestFolders(); $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW); @@ -155,7 +155,7 @@ class ScannerTest extends \Test\TestCase { $this->assertNotEquals($cachedDataFolder['size'], -1); } - function testBackgroundScan() { + public function testBackgroundScan() { $this->fillTestFolders(); $this->storage->mkdir('folder2'); $this->storage->file_put_contents('folder2/bar.txt', 'foobar'); @@ -177,7 +177,7 @@ class ScannerTest extends \Test\TestCase { $this->assertFalse($this->cache->getIncomplete()); } - function testBackgroundScanOnlyRecurseIncomplete() { + public function testBackgroundScanOnlyRecurseIncomplete() { $this->fillTestFolders(); $this->storage->mkdir('folder2'); $this->storage->file_put_contents('folder2/bar.txt', 'foobar'); diff --git a/tests/lib/Files/Cache/WatcherTest.php b/tests/lib/Files/Cache/WatcherTest.php index 2a42a9e603f..42115c1c477 100644 --- a/tests/lib/Files/Cache/WatcherTest.php +++ b/tests/lib/Files/Cache/WatcherTest.php @@ -42,7 +42,7 @@ class WatcherTest extends \Test\TestCase { /** * @medium */ - function testWatcher() { + public function testWatcher() { $storage = $this->getTestStorage(); $cache = $storage->getCache(); $updater = $storage->getWatcher(); diff --git a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php index 5d7e9f8ec08..f0943ba5a03 100644 --- a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php +++ b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php @@ -31,7 +31,7 @@ class CacheJailTest extends CacheTest { $this->cache = new \OC\Files\Cache\Wrapper\CacheJail($this->sourceCache, 'foo'); } - function testSearchOutsideJail() { + public function testSearchOutsideJail() { $file1 = 'foo/foobar'; $file2 = 'folder/foobar'; $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder']; @@ -46,7 +46,7 @@ class CacheJailTest extends CacheTest { $this->assertEquals('foobar', $result[0]['path']); } - function testClearKeepEntriesOutsideJail() { + public function testClearKeepEntriesOutsideJail() { $file1 = 'foo/foobar'; $file2 = 'foo/foobar/asd'; $file3 = 'folder/foobar'; @@ -63,7 +63,7 @@ class CacheJailTest extends CacheTest { $this->assertTrue($this->sourceCache->inCache('folder/foobar')); } - function testGetById() { + public function testGetById() { $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory']; $id = $this->sourceCache->put('foo/bar', $data1); @@ -77,12 +77,12 @@ class CacheJailTest extends CacheTest { $this->assertEquals('foo/bar', $path); } - function testGetIncomplete() { + public function testGetIncomplete() { //not supported $this->addToAssertionCount(1); } - function testMoveFromJail() { + public function testMoveFromJail() { $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory']; $this->sourceCache->put('source', $folderData); @@ -98,7 +98,7 @@ class CacheJailTest extends CacheTest { $this->assertTrue($this->sourceCache->inCache('target/foo/bar')); } - function testMoveToJail() { + public function testMoveToJail() { $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory']; $this->sourceCache->put('source', $folderData); @@ -114,7 +114,7 @@ class CacheJailTest extends CacheTest { $this->assertTrue($this->sourceCache->inCache('target/foo/bar')); } - function testMoveBetweenJail() { + public function testMoveBetweenJail() { $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory']; $this->sourceCache->put('source', $folderData); diff --git a/tests/lib/Files/Node/NodeTest.php b/tests/lib/Files/Node/NodeTest.php index adcf43956be..86643617959 100644 --- a/tests/lib/Files/Node/NodeTest.php +++ b/tests/lib/Files/Node/NodeTest.php @@ -66,22 +66,22 @@ abstract class NodeTest extends \Test\TestCase { * @param string $path * @return Node */ - protected abstract function createTestNode($root, $view, $path); + abstract protected function createTestNode($root, $view, $path); /** * @return string */ - protected abstract function getNodeClass(); + abstract protected function getNodeClass(); /** * @return string */ - protected abstract function getNonExistingNodeClass(); + abstract protected function getNonExistingNodeClass(); /** * @return string */ - protected abstract function getViewDeleteMethod(); + abstract protected function getViewDeleteMethod(); protected function getMockStorage() { $storage = $this->getMockBuilder(Storage::class) diff --git a/tests/lib/Files/ObjectStore/NoopScannerTest.php b/tests/lib/Files/ObjectStore/NoopScannerTest.php index 570fc16ee98..7142fb6daf9 100644 --- a/tests/lib/Files/ObjectStore/NoopScannerTest.php +++ b/tests/lib/Files/ObjectStore/NoopScannerTest.php @@ -26,7 +26,7 @@ class NoopScannerTest extends \Test\TestCase { $this->scanner = new \OC\Files\ObjectStore\NoopScanner($this->storage); } - function testFile() { + public function testFile() { $data = "dummy file data\n"; $this->storage->file_put_contents('foo.txt', $data); @@ -46,7 +46,7 @@ class NoopScannerTest extends \Test\TestCase { $this->storage->file_put_contents('folder/bar.txt', $textData); } - function testFolder() { + public function testFolder() { $this->fillTestFolders(); $this->assertEquals( @@ -56,7 +56,7 @@ class NoopScannerTest extends \Test\TestCase { ); } - function testBackgroundScan() { + public function testBackgroundScan() { $this->fillTestFolders(); $this->storage->mkdir('folder2'); $this->storage->file_put_contents('folder2/bar.txt', 'foobar'); diff --git a/tests/lib/Files/ObjectStore/S3Test.php b/tests/lib/Files/ObjectStore/S3Test.php index 525e020445a..c1e7948e3c4 100644 --- a/tests/lib/Files/ObjectStore/S3Test.php +++ b/tests/lib/Files/ObjectStore/S3Test.php @@ -25,7 +25,7 @@ use Icewind\Streams\Wrapper; use OC\Files\ObjectStore\S3; class MultiPartUploadS3 extends S3 { - function writeObject($urn, $stream) { + public function writeObject($urn, $stream) { $this->getConnection()->upload($this->bucket, $urn, $stream, 'private', [ 'mup_threshold' => 1, ]); diff --git a/tests/lib/Files/Storage/HomeStorageQuotaTest.php b/tests/lib/Files/Storage/HomeStorageQuotaTest.php index cfee638d5f3..177fe1b4f6c 100644 --- a/tests/lib/Files/Storage/HomeStorageQuotaTest.php +++ b/tests/lib/Files/Storage/HomeStorageQuotaTest.php @@ -30,7 +30,7 @@ class HomeStorageQuotaTest extends \Test\TestCase { /** * Tests that the home storage is not wrapped when no quota exists. */ - function testHomeStorageWrapperWithoutQuota() { + public function testHomeStorageWrapperWithoutQuota() { $user1 = $this->getUniqueID(); \OC::$server->getUserManager()->createUser($user1, 'test'); \OC::$server->getConfig()->setUserValue($user1, 'files', 'quota', 'none'); @@ -55,7 +55,7 @@ class HomeStorageQuotaTest extends \Test\TestCase { /** * Tests that the home storage is not wrapped when no quota exists. */ - function testHomeStorageWrapperWithQuota() { + public function testHomeStorageWrapperWithQuota() { $user1 = $this->getUniqueID(); \OC::$server->getUserManager()->createUser($user1, 'test'); \OC::$server->getConfig()->setUserValue($user1, 'files', 'quota', '1024'); diff --git a/tests/lib/Files/Storage/Storage.php b/tests/lib/Files/Storage/Storage.php index 736cbfff4f0..c37a8152989 100644 --- a/tests/lib/Files/Storage/Storage.php +++ b/tests/lib/Files/Storage/Storage.php @@ -128,7 +128,7 @@ abstract class Storage extends \Test\TestCase { ]; } - function loremFileProvider() { + public function loremFileProvider() { $root = \OC::$SERVERROOT . '/tests/data/'; return [ // small file diff --git a/tests/lib/Files/Stream/EncryptionTest.php b/tests/lib/Files/Stream/EncryptionTest.php index e1ad3ec68fa..bedce1b6f6d 100644 --- a/tests/lib/Files/Stream/EncryptionTest.php +++ b/tests/lib/Files/Stream/EncryptionTest.php @@ -240,7 +240,7 @@ class EncryptionTest extends \Test\TestCase { unlink($fileName); } - function dataFilesProvider() { + public function dataFilesProvider() { return [ ['lorem-big.txt'], ['block-aligned.txt'], diff --git a/tests/lib/HelperStorageTest.php b/tests/lib/HelperStorageTest.php index 3169957fabb..4166d606366 100644 --- a/tests/lib/HelperStorageTest.php +++ b/tests/lib/HelperStorageTest.php @@ -81,7 +81,7 @@ class HelperStorageTest extends \Test\TestCase { /** * Test getting the storage info */ - function testGetStorageInfo() { + public function testGetStorageInfo() { $homeStorage = $this->getStorageMock(12); \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files'); $homeStorage->file_put_contents('test.txt', '01234'); @@ -95,7 +95,7 @@ class HelperStorageTest extends \Test\TestCase { /** * Test getting the storage info, ignoring extra mount points */ - function testGetStorageInfoExcludingExtStorage() { + public function testGetStorageInfoExcludingExtStorage() { $homeStorage = $this->getStorageMock(12); \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files'); $homeStorage->file_put_contents('test.txt', '01234'); @@ -115,7 +115,7 @@ class HelperStorageTest extends \Test\TestCase { /** * Test getting the storage info, including extra mount points */ - function testGetStorageInfoIncludingExtStorage() { + public function testGetStorageInfoIncludingExtStorage() { $homeStorage = new \OC\Files\Storage\Temporary([]); \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files'); $homeStorage->file_put_contents('test.txt', '01234'); @@ -146,7 +146,7 @@ class HelperStorageTest extends \Test\TestCase { * when user has no quota set, even when quota ext storage option * was set */ - function testGetStorageInfoIncludingExtStorageWithNoUserQuota() { + public function testGetStorageInfoIncludingExtStorageWithNoUserQuota() { $homeStorage = $this->getStorageMock(12); \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files'); $homeStorage->file_put_contents('test.txt', '01234'); @@ -173,7 +173,7 @@ class HelperStorageTest extends \Test\TestCase { /** * Test getting the storage info with quota enabled */ - function testGetStorageInfoWithQuota() { + public function testGetStorageInfoWithQuota() { $homeStorage = $this->getStorageMock(12); $homeStorage->file_put_contents('test.txt', '01234'); $homeStorage = new \OC\Files\Storage\Wrapper\Quota( @@ -193,7 +193,7 @@ class HelperStorageTest extends \Test\TestCase { /** * Test getting the storage info when data exceeds quota */ - function testGetStorageInfoWhenSizeExceedsQuota() { + public function testGetStorageInfoWhenSizeExceedsQuota() { $homeStorage = $this->getStorageMock(12); $homeStorage->file_put_contents('test.txt', '0123456789'); $homeStorage = new \OC\Files\Storage\Wrapper\Quota( @@ -215,7 +215,7 @@ class HelperStorageTest extends \Test\TestCase { * Test getting the storage info when the remaining * free storage space is less than the quota */ - function testGetStorageInfoWhenFreeSpaceLessThanQuota() { + public function testGetStorageInfoWhenFreeSpaceLessThanQuota() { $homeStorage = $this->getStorageMock(12); $homeStorage->file_put_contents('test.txt', '01234'); $homeStorage = new \OC\Files\Storage\Wrapper\Quota( diff --git a/tests/lib/ImageTest.php b/tests/lib/ImageTest.php index 3858945d191..5b83c4ac57f 100644 --- a/tests/lib/ImageTest.php +++ b/tests/lib/ImageTest.php @@ -344,7 +344,7 @@ class ImageTest extends \Test\TestCase { $this->assertEquals($expected[1], $img->height()); } - function convertDataProvider() { + public function convertDataProvider() { return [ [ 'image/gif'], [ 'image/jpeg'], diff --git a/tests/lib/LegacyHelperTest.php b/tests/lib/LegacyHelperTest.php index 1940d4f2d01..5c640e91284 100644 --- a/tests/lib/LegacyHelperTest.php +++ b/tests/lib/LegacyHelperTest.php @@ -47,12 +47,12 @@ class LegacyHelperTest extends \Test\TestCase { /** * @dataProvider providesComputerFileSize */ - function testComputerFileSize($expected, $input) { + public function testComputerFileSize($expected, $input) { $result = OC_Helper::computerFileSize($input); $this->assertEquals($expected, $result); } - function providesComputerFileSize() { + public function providesComputerFileSize() { return [ [0.0, "0 B"], [1024.0, "1 KB"], @@ -63,7 +63,7 @@ class LegacyHelperTest extends \Test\TestCase { ]; } - function testMb_array_change_key_case() { + public function testMb_array_change_key_case() { $arrayStart = [ "Foo" => "bar", "Bar" => "foo", @@ -89,7 +89,7 @@ class LegacyHelperTest extends \Test\TestCase { $this->assertEquals($result, $expected); } - function testRecursiveArraySearch() { + public function testRecursiveArraySearch() { $haystack = [ "Foo" => "own", "Bar" => "Cloud", @@ -103,7 +103,7 @@ class LegacyHelperTest extends \Test\TestCase { $this->assertFalse($result); } - function testBuildNotExistingFileNameForView() { + public function testBuildNotExistingFileNameForView() { $viewMock = $this->createMock(View::class); $this->assertEquals('/filename', OC_Helper::buildNotExistingFileNameForView('/', 'filename', $viewMock)); $this->assertEquals('dir/filename.ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename.ext', $viewMock)); @@ -188,7 +188,7 @@ class LegacyHelperTest extends \Test\TestCase { } - function streamCopyDataProvider() { + public function streamCopyDataProvider() { return [ [0, false, false, false], [0, false, \OC::$SERVERROOT . '/tests/data/lorem.txt', false], diff --git a/tests/lib/Memcache/MemcachedTest.php b/tests/lib/Memcache/MemcachedTest.php index 96b88992665..340ce85b9aa 100644 --- a/tests/lib/Memcache/MemcachedTest.php +++ b/tests/lib/Memcache/MemcachedTest.php @@ -10,7 +10,7 @@ namespace Test\Memcache; class MemcachedTest extends Cache { - static public function setUpBeforeClass(): void { + public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); if (!\OC\Memcache\Memcached::isAvailable()) { diff --git a/tests/lib/Memcache/RedisTest.php b/tests/lib/Memcache/RedisTest.php index d5bf10e7af9..e7bb9c29d36 100644 --- a/tests/lib/Memcache/RedisTest.php +++ b/tests/lib/Memcache/RedisTest.php @@ -10,7 +10,7 @@ namespace Test\Memcache; class RedisTest extends Cache { - static public function setUpBeforeClass(): void { + public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); if (!\OC\Memcache\Redis::isAvailable()) { diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php index 6a93657f8c8..d64c41c79e7 100644 --- a/tests/lib/Security/CertificateManagerTest.php +++ b/tests/lib/Security/CertificateManagerTest.php @@ -76,7 +76,7 @@ class CertificateManagerTest extends \Test\TestCase { $this->assertEquals($expected, $actual); } - function testListCertificates() { + public function testListCertificates() { // Test empty certificate bundle $this->assertSame([], $this->certificateManager->listCertificates()); @@ -93,7 +93,7 @@ class CertificateManagerTest extends \Test\TestCase { } - function testAddInvalidCertificate() { + public function testAddInvalidCertificate() { $this->expectException(\Exception::class); $this->expectExceptionMessage('Certificate could not get parsed.'); @@ -115,23 +115,23 @@ class CertificateManagerTest extends \Test\TestCase { * @dataProvider dangerousFileProvider * @param string $filename */ - function testAddDangerousFile($filename) { + public function testAddDangerousFile($filename) { $this->expectException(\Exception::class); $this->expectExceptionMessage('Filename is not valid'); $this->certificateManager->addCertificate(file_get_contents(__DIR__ . '/../../data/certificates/expiredCertificate.crt'), $filename); } - function testRemoveDangerousFile() { + public function testRemoveDangerousFile() { $this->assertFalse($this->certificateManager->removeCertificate('../../foo.txt')); } - function testRemoveExistingFile() { + public function testRemoveExistingFile() { $this->certificateManager->addCertificate(file_get_contents(__DIR__ . '/../../data/certificates/goodCertificate.crt'), 'GoodCertificate'); $this->assertTrue($this->certificateManager->removeCertificate('GoodCertificate')); } - function testGetCertificateBundle() { + public function testGetCertificateBundle() { $this->assertSame('/' . $this->username . '/files_external/rootcerts.crt', $this->certificateManager->getCertificateBundle()); } @@ -145,7 +145,7 @@ class CertificateManagerTest extends \Test\TestCase { * @param int $targetBundleExists * @param bool $expected */ - function testNeedRebundling($uid, + public function testNeedRebundling($uid, $CaBundleMtime, $systemWideMtime, $targetBundleMtime, @@ -194,7 +194,7 @@ class CertificateManagerTest extends \Test\TestCase { ); } - function dataTestNeedRebundling() { + public function dataTestNeedRebundling() { return [ //values: uid, CaBundleMtime, systemWideMtime, targetBundleMtime, targetBundleExists, expected diff --git a/tests/lib/Security/CertificateTest.php b/tests/lib/Security/CertificateTest.php index 986554cf967..223fb226904 100644 --- a/tests/lib/Security/CertificateTest.php +++ b/tests/lib/Security/CertificateTest.php @@ -53,7 +53,7 @@ class CertificateTest extends \Test\TestCase { } - function testCertificateStartingWithFileReference() { + public function testCertificateStartingWithFileReference() { $this->expectException(\Exception::class); $this->expectExceptionMessage('Certificate could not get parsed.'); diff --git a/tests/lib/Security/CryptoTest.php b/tests/lib/Security/CryptoTest.php index 2a2e6adac3e..a6f4902594a 100644 --- a/tests/lib/Security/CryptoTest.php +++ b/tests/lib/Security/CryptoTest.php @@ -30,13 +30,13 @@ class CryptoTest extends \Test\TestCase { /** * @dataProvider defaultEncryptionProvider */ - function testDefaultEncrypt($stringToEncrypt) { + public function testDefaultEncrypt($stringToEncrypt) { $ciphertext = $this->crypto->encrypt($stringToEncrypt); $this->assertEquals($stringToEncrypt, $this->crypto->decrypt($ciphertext)); } - function testWrongPassword() { + public function testWrongPassword() { $this->expectException(\Exception::class); $this->expectExceptionMessage('HMAC does not match.'); @@ -45,14 +45,14 @@ class CryptoTest extends \Test\TestCase { $this->crypto->decrypt($ciphertext, 'A wrong password!'); } - function testLaterDecryption() { + public function testLaterDecryption() { $stringToEncrypt = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.'; $encryptedString = '44a35023cca2e7a6125e06c29fc4b2ad9d8a33d0873a8b45b0de4ef9284f260c6c46bf25dc62120644c59b8bafe4281ddc47a70c35ae6c29ef7a63d79eefacc297e60b13042ac582733598d0a6b4de37311556bb5c480fd2633de4e6ebafa868c2d1e2d80a5d24f9660360dba4d6e0c8|lhrFgK0zd9U160Wo|a75e57ab701f9124e1113543fd1dc596f21e20d456a0d1e813d5a8aaec9adcb11213788e96598b67fe9486a9f0b99642c18296d0175db44b1ae426e4e91080ee'; $this->assertEquals($stringToEncrypt, $this->crypto->decrypt($encryptedString, 'ThisIsAVeryS3cur3P4ssw0rd')); } - function testWrongIV() { + public function testWrongIV() { $this->expectException(\Exception::class); $this->expectExceptionMessage('HMAC does not match.'); @@ -61,7 +61,7 @@ class CryptoTest extends \Test\TestCase { } - function testWrongParameters() { + public function testWrongParameters() { $this->expectException(\Exception::class); $this->expectExceptionMessage('Authenticated ciphertext could not be decoded.'); diff --git a/tests/lib/Security/SecureRandomTest.php b/tests/lib/Security/SecureRandomTest.php index 4075a1c7109..0ffd7ae7c14 100644 --- a/tests/lib/Security/SecureRandomTest.php +++ b/tests/lib/Security/SecureRandomTest.php @@ -42,7 +42,7 @@ class SecureRandomTest extends \Test\TestCase { /** * @dataProvider stringGenerationProvider */ - function testGetLowStrengthGeneratorLength($length, $expectedLength) { + public function testGetLowStrengthGeneratorLength($length, $expectedLength) { $generator = $this->rng; $this->assertEquals($expectedLength, strlen($generator->generate($length))); @@ -51,7 +51,7 @@ class SecureRandomTest extends \Test\TestCase { /** * @dataProvider stringGenerationProvider */ - function testMediumLowStrengthGeneratorLength($length, $expectedLength) { + public function testMediumLowStrengthGeneratorLength($length, $expectedLength) { $generator = $this->rng; $this->assertEquals($expectedLength, strlen($generator->generate($length))); @@ -60,7 +60,7 @@ class SecureRandomTest extends \Test\TestCase { /** * @dataProvider stringGenerationProvider */ - function testUninitializedGenerate($length, $expectedLength) { + public function testUninitializedGenerate($length, $expectedLength) { $this->assertEquals($expectedLength, strlen($this->rng->generate($length))); } diff --git a/tests/lib/Share/ShareTest.php b/tests/lib/Share/ShareTest.php index d7adc144cf4..fce963ec43a 100644 --- a/tests/lib/Share/ShareTest.php +++ b/tests/lib/Share/ShareTest.php @@ -226,13 +226,13 @@ class ShareTest extends \Test\TestCase { * @param string $url * @param string $expectedResult */ - function testRemoveProtocolFromUrl($url, $expectedResult) { + public function testRemoveProtocolFromUrl($url, $expectedResult) { $share = new \OC\Share\Share(); $result = self::invokePrivate($share, 'removeProtocolFromUrl', [$url]); $this->assertSame($expectedResult, $result); } - function urls() { + public function urls() { return [ ['http://owncloud.org', 'owncloud.org'], ['https://owncloud.org', 'owncloud.org'], @@ -245,13 +245,13 @@ class ShareTest extends \Test\TestCase { * @param array $ungrouped * @param array $grouped */ - function testGroupItems($ungrouped, $grouped) { + public function testGroupItems($ungrouped, $grouped) { $result = DummyShareClass::groupItemsTest($ungrouped); $this->compareArrays($grouped, $result); } - function compareArrays($result, $expectedResult) { + public function compareArrays($result, $expectedResult) { foreach ($expectedResult as $key => $value) { if (is_array($value)) { $this->compareArrays($result[$key], $value); @@ -261,7 +261,7 @@ class ShareTest extends \Test\TestCase { } } - function dataProviderTestGroupItems() { + public function dataProviderTestGroupItems() { return [ // one array with one share [ diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index a1708f9cf01..b28be47875a 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -266,7 +266,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { * * @param IQueryBuilder $queryBuilder */ - static protected function tearDownAfterClassCleanShares(IQueryBuilder $queryBuilder) { + protected static function tearDownAfterClassCleanShares(IQueryBuilder $queryBuilder) { $queryBuilder->delete('share') ->execute(); } @@ -276,7 +276,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { * * @param IQueryBuilder $queryBuilder */ - static protected function tearDownAfterClassCleanStorages(IQueryBuilder $queryBuilder) { + protected static function tearDownAfterClassCleanStorages(IQueryBuilder $queryBuilder) { $queryBuilder->delete('storages') ->execute(); } @@ -286,7 +286,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { * * @param IQueryBuilder $queryBuilder */ - static protected function tearDownAfterClassCleanFileCache(IQueryBuilder $queryBuilder) { + protected static function tearDownAfterClassCleanFileCache(IQueryBuilder $queryBuilder) { $queryBuilder->delete('filecache') ->execute(); } @@ -296,7 +296,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { * * @param string $dataDir */ - static protected function tearDownAfterClassCleanStrayDataFiles($dataDir) { + protected static function tearDownAfterClassCleanStrayDataFiles($dataDir) { $knownEntries = [ 'nextcloud.log' => true, 'audit.log' => true, @@ -321,7 +321,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { * * @param string $dir */ - static protected function tearDownAfterClassCleanStrayDataUnlinkDir($dir) { + protected static function tearDownAfterClassCleanStrayDataUnlinkDir($dir) { if ($dh = @opendir($dir)) { while (($file = readdir($dh)) !== false) { if (\OC\Files\Filesystem::isIgnoredDir($file)) { @@ -342,14 +342,14 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { /** * Clean up the list of hooks */ - static protected function tearDownAfterClassCleanStrayHooks() { + protected static function tearDownAfterClassCleanStrayHooks() { \OC_Hook::clear(); } /** * Clean up the list of locks */ - static protected function tearDownAfterClassCleanStrayLocks() { + protected static function tearDownAfterClassCleanStrayLocks() { \OC::$server->getLockingProvider()->releaseAll(); } @@ -359,7 +359,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { * * @param string $user user id or empty for a generic FS */ - static protected function loginAsUser($user = '') { + protected static function loginAsUser($user = '') { self::logout(); \OC\Files\Filesystem::tearDown(); \OC_User::setUserId($user); @@ -376,7 +376,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { /** * Logout the current user and tear down the filesystem. */ - static protected function logout() { + protected static function logout() { \OC_Util::tearDownFS(); \OC_User::setUserId(''); // needed for fully logout diff --git a/tests/lib/UrlGeneratorTest.php b/tests/lib/UrlGeneratorTest.php index 0baacda53d1..03f55ff2244 100644 --- a/tests/lib/UrlGeneratorTest.php +++ b/tests/lib/UrlGeneratorTest.php @@ -116,7 +116,7 @@ class UrlGeneratorTest extends \Test\TestCase { * test absolute URL construction * @dataProvider provideDocRootURLs */ - function testGetAbsoluteURLDocRoot($url, $expectedResult) { + public function testGetAbsoluteURLDocRoot($url, $expectedResult) { $this->mockBaseUrl(); \OC::$WEBROOT = ''; $result = $this->urlGenerator->getAbsoluteURL($url); @@ -128,7 +128,7 @@ class UrlGeneratorTest extends \Test\TestCase { * test absolute URL construction * @dataProvider provideSubDirURLs */ - function testGetAbsoluteURLSubDir($url, $expectedResult) { + public function testGetAbsoluteURLSubDir($url, $expectedResult) { $this->mockBaseUrl(); \OC::$WEBROOT = '/nextcloud'; $result = $this->urlGenerator->getAbsoluteURL($url); diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php index 75f62163f1e..6e25ce16e75 100644 --- a/tests/lib/UtilTest.php +++ b/tests/lib/UtilTest.php @@ -38,7 +38,7 @@ class UtilTest extends \Test\TestCase { $this->assertTrue(is_string($edition)); } - function testSanitizeHTML() { + public function testSanitizeHTML() { $badArray = [ 'While it is unusual to pass an array', 'this function actually <blink>supports</blink> it.', @@ -71,7 +71,7 @@ class UtilTest extends \Test\TestCase { $this->assertEquals('This is a good string without HTML.', $result); } - function testEncodePath() { + public function testEncodePath() { $component = '/§#@test%&^ä/-child'; $result = OC_Util::encodePath($component); $this->assertEquals("/%C2%A7%23%40test%25%26%5E%C3%A4/-child", $result); @@ -82,12 +82,12 @@ class UtilTest extends \Test\TestCase { $this->assertEquals($expected, \OC_Util::fileInfoLoaded()); } - function testGetDefaultEmailAddress() { + public function testGetDefaultEmailAddress() { $email = \OCP\Util::getDefaultEmailAddress("no-reply"); $this->assertEquals('no-reply@localhost', $email); } - function testGetDefaultEmailAddressFromConfig() { + public function testGetDefaultEmailAddressFromConfig() { $config = \OC::$server->getConfig(); $config->setSystemValue('mail_domain', 'example.com'); $email = \OCP\Util::getDefaultEmailAddress("no-reply"); @@ -95,7 +95,7 @@ class UtilTest extends \Test\TestCase { $config->deleteSystemValue('mail_domain'); } - function testGetConfiguredEmailAddressFromConfig() { + public function testGetConfiguredEmailAddressFromConfig() { $config = \OC::$server->getConfig(); $config->setSystemValue('mail_domain', 'example.com'); $config->setSystemValue('mail_from_address', 'owncloud'); @@ -105,7 +105,7 @@ class UtilTest extends \Test\TestCase { $config->deleteSystemValue('mail_from_address'); } - function testGetInstanceIdGeneratesValidId() { + public function testGetInstanceIdGeneratesValidId() { \OC::$server->getConfig()->deleteSystemValue('instanceid'); $instanceId = OC_Util::getInstanceId(); $this->assertStringStartsWith('oc', $instanceId); @@ -178,7 +178,7 @@ class UtilTest extends \Test\TestCase { * @param array $excludedGroups groups which should be excluded from sharing * @param bool $expected expected result */ - function testIsSharingDisabledForUser($groups, $membership, $excludedGroups, $expected) { + public function testIsSharingDisabledForUser($groups, $membership, $excludedGroups, $expected) { $config = $this->getMockBuilder(IConfig::class)->disableOriginalConstructor()->getMock(); $groupManager = $this->getMockBuilder('OCP\IGroupManager')->disableOriginalConstructor()->getMock(); $user = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock(); @@ -224,7 +224,7 @@ class UtilTest extends \Test\TestCase { * @dataProvider defaultAppsProvider * @group DB */ - function testDefaultApps($defaultAppConfig, $expectedPath, $enabledApps) { + public function testDefaultApps($defaultAppConfig, $expectedPath, $enabledApps) { $oldDefaultApps = \OC::$server->getConfig()->getSystemValue('defaultapp', ''); // CLI is doing messy stuff with the webroot, so need to work it around $oldWebRoot = \OC::$WEBROOT; @@ -249,7 +249,7 @@ class UtilTest extends \Test\TestCase { \OC_User::setUserId(null); } - function defaultAppsProvider() { + public function defaultAppsProvider() { return [ // none specified, default to files [ |