Skip to content

Commit

Permalink
Add visibility to all methods and position of static keyword
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Apr 10, 2020
1 parent a7c8d26 commit 1584c9a
Show file tree
Hide file tree
Showing 172 changed files with 545 additions and 545 deletions.
2 changes: 1 addition & 1 deletion apps/contactsinteraction/lib/AddressBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function delete(): void {
/**
* @inheritDoc
*/
function createFile($name, $data = null) {
public function createFile($name, $data = null) {
throw new Exception("This addressbook is immutable");
}

Expand Down
24 changes: 12 additions & 12 deletions apps/contactsinteraction/lib/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,84 +52,84 @@ public function __construct(RecentContact $contact, string $principal, array $ac
/**
* @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();
}
}
36 changes: 18 additions & 18 deletions apps/dav/lib/CalDAV/CalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function getCalendarsForUserCount($principalUri, $excludeBirthday = true)
* @param string $principalUri
* @return array
*/
function getCalendarsForUser($principalUri) {
public function getCalendarsForUser($principalUri) {
$principalUriOriginal = $principalUri;
$principalUri = $this->convertPrincipal($principalUri, true);
$fields = array_values($this->propertyMap);
Expand Down Expand Up @@ -722,7 +722,7 @@ public function getSubscriptionById($subscriptionId) {
* @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,
Expand Down Expand Up @@ -790,7 +790,7 @@ function createCalendar($principalUri, $calendarUri, array $properties) {
* @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';

Expand Down Expand Up @@ -840,7 +840,7 @@ function updateCalendar($calendarId, PropPatch $propPatch) {
* @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',
[
Expand Down Expand Up @@ -873,7 +873,7 @@ function deleteCalendar($calendarId) {
* @param string $principaluri
* @return void
*/
function deleteAllSharesByUser($principaluri) {
public function deleteAllSharesByUser($principaluri) {
$this->calendarSharingBackend->deleteAllSharesByUser($principaluri);
}

Expand Down Expand Up @@ -1048,7 +1048,7 @@ public function getMultipleCalendarObjects($id, array $uris, $calendarType=self:
* @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();
Expand Down Expand Up @@ -1131,7 +1131,7 @@ function createCalendarObject($calendarId, $objectUri, $calendarData, $calendarT
* @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')
Expand Down Expand Up @@ -1207,7 +1207,7 @@ public function setClassification($calendarObjectId, $classification) {
* @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) {
Expand Down Expand Up @@ -1688,7 +1688,7 @@ private function transformSearchProperty(Property $prop) {
* @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')
Expand Down Expand Up @@ -1763,7 +1763,7 @@ function getCalendarObjectByUID($principalUri, $uid) {
* @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 ]);
Expand Down Expand Up @@ -1854,7 +1854,7 @@ function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = nul
* @param string $principalUri
* @return array
*/
function getSubscriptionsForUser($principalUri) {
public function getSubscriptionsForUser($principalUri) {
$fields = array_values($this->subscriptionPropertyMap);
$fields[] = 'id';
$fields[] = 'uri';
Expand Down Expand Up @@ -1906,7 +1906,7 @@ function getSubscriptionsForUser($principalUri) {
* @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');
}
Expand Down Expand Up @@ -1969,7 +1969,7 @@ function createSubscription($principalUri, $uri, array $properties) {
* @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';

Expand Down Expand Up @@ -2015,7 +2015,7 @@ function updateSubscription($subscriptionId, PropPatch $propPatch) {
* @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',
[
Expand Down Expand Up @@ -2061,7 +2061,7 @@ function deleteSubscription($subscriptionId) {
* @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')
Expand Down Expand Up @@ -2095,7 +2095,7 @@ function getSchedulingObject($principalUri, $objectUri) {
* @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')
Expand Down Expand Up @@ -2123,7 +2123,7 @@ function getSchedulingObjects($principalUri) {
* @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)))
Expand All @@ -2139,7 +2139,7 @@ function deleteSchedulingObject($principalUri, $objectUri) {
* @param string $objectData
* @return void
*/
function createSchedulingObject($principalUri, $objectUri, $objectData) {
public function createSchedulingObject($principalUri, $objectUri, $objectData) {
$query = $this->db->getQueryBuilder();
$query->insert('schedulingobjects')
->values([
Expand Down
8 changes: 4 additions & 4 deletions apps/dav/lib/CalDAV/CalendarHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function getCalDAVBackend() {
/**
* @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)) {
Expand All @@ -86,7 +86,7 @@ function createExtendedCollection($name, MkCol $mkCol) {
/**
* @inheritdoc
*/
function getChildren() {
public function getChildren() {
$calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']);
$objects = [];
foreach ($calendars as $calendar) {
Expand Down Expand Up @@ -128,7 +128,7 @@ function getChildren() {
/**
* @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']);
Expand Down Expand Up @@ -182,7 +182,7 @@ function getChild($name) {
* @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);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/CalendarObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct(CalDavBackend $caldavBackend, IL10N $l10n,
/**
* @inheritdoc
*/
function get() {
public function get() {
$data = parent::get();

if (!$this->isShared()) {
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CalDAV/CalendarRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Outbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __construct(IConfig $config, string $principalUri) {
*
* @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');
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Principal/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion apps/dav/lib/CalDAV/Principal/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
8 changes: 4 additions & 4 deletions apps/dav/lib/CalDAV/PublicCalendarRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -58,22 +58,22 @@ function __construct(CalDavBackend $caldavBackend, IL10N $l10n,
/**
* @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);
}

/**
* @inheritdoc
*/
function getChildren() {
public function getChildren() {
return [];
}
}
Loading

0 comments on commit 1584c9a

Please sign in to comment.