chore: apply new CSFixer rules

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
This commit is contained in:
Ferdinand Thiessen 2025-06-30 15:04:05 +02:00 committed by Daniel Kesselberg
parent 28ef8b2689
commit 5981b7eb51
No known key found for this signature in database
GPG key ID: 4A81C29F63464E8F
1339 changed files with 3197 additions and 2089 deletions

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -118,16 +118,16 @@ class RequestHandlerController extends Controller {
// check if all required parameters are set
if (
$shareWith === null ||
$name === null ||
$providerId === null ||
$resourceType === null ||
$shareType === null ||
!is_array($protocol) ||
!isset($protocol['name']) ||
!isset($protocol['options']) ||
!is_array($protocol['options']) ||
!isset($protocol['options']['sharedSecret'])
$shareWith === null
|| $name === null
|| $providerId === null
|| $resourceType === null
|| $shareType === null
|| !is_array($protocol)
|| !isset($protocol['name'])
|| !isset($protocol['options'])
|| !is_array($protocol['options'])
|| !isset($protocol['options']['sharedSecret'])
) {
return new JSONResponse(
[
@ -340,10 +340,10 @@ class RequestHandlerController extends Controller {
public function receiveNotification($notificationType, $resourceType, $providerId, ?array $notification) {
// check if all required parameters are set
if (
$notificationType === null ||
$resourceType === null ||
$providerId === null ||
!is_array($notification)
$notificationType === null
|| $resourceType === null
|| $providerId === null
|| !is_array($notification)
) {
return new JSONResponse(
[

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@ -60,32 +61,30 @@ class CommentersSorterTest extends TestCase {
#1 sort properly and otherwise keep existing order
'actors' => ['users' => ['celia' => 3, 'darius' => 7, 'faruk' => 5, 'gail' => 5], 'bots' => ['r2-d2' => 8]],
'input' => [
'users' =>
[
['value' => ['shareWith' => 'alice']],
['value' => ['shareWith' => 'bob']],
['value' => ['shareWith' => 'celia']],
['value' => ['shareWith' => 'darius']],
['value' => ['shareWith' => 'elena']],
['value' => ['shareWith' => 'faruk']],
['value' => ['shareWith' => 'gail']],
],
'users' => [
['value' => ['shareWith' => 'alice']],
['value' => ['shareWith' => 'bob']],
['value' => ['shareWith' => 'celia']],
['value' => ['shareWith' => 'darius']],
['value' => ['shareWith' => 'elena']],
['value' => ['shareWith' => 'faruk']],
['value' => ['shareWith' => 'gail']],
],
'bots' => [
['value' => ['shareWith' => 'c-3po']],
['value' => ['shareWith' => 'r2-d2']],
]
],
'expected' => [
'users' =>
[
['value' => ['shareWith' => 'darius']],
['value' => ['shareWith' => 'faruk']],
['value' => ['shareWith' => 'gail']],
['value' => ['shareWith' => 'celia']],
['value' => ['shareWith' => 'alice']],
['value' => ['shareWith' => 'bob']],
['value' => ['shareWith' => 'elena']],
],
'users' => [
['value' => ['shareWith' => 'darius']],
['value' => ['shareWith' => 'faruk']],
['value' => ['shareWith' => 'gail']],
['value' => ['shareWith' => 'celia']],
['value' => ['shareWith' => 'alice']],
['value' => ['shareWith' => 'bob']],
['value' => ['shareWith' => 'elena']],
],
'bots' => [
['value' => ['shareWith' => 'r2-d2']],
['value' => ['shareWith' => 'c-3po']],
@ -96,32 +95,30 @@ class CommentersSorterTest extends TestCase {
#2 no commentors, input equals output
'actors' => [],
'input' => [
'users' =>
[
['value' => ['shareWith' => 'alice']],
['value' => ['shareWith' => 'bob']],
['value' => ['shareWith' => 'celia']],
['value' => ['shareWith' => 'darius']],
['value' => ['shareWith' => 'elena']],
['value' => ['shareWith' => 'faruk']],
['value' => ['shareWith' => 'gail']],
],
'users' => [
['value' => ['shareWith' => 'alice']],
['value' => ['shareWith' => 'bob']],
['value' => ['shareWith' => 'celia']],
['value' => ['shareWith' => 'darius']],
['value' => ['shareWith' => 'elena']],
['value' => ['shareWith' => 'faruk']],
['value' => ['shareWith' => 'gail']],
],
'bots' => [
['value' => ['shareWith' => 'c-3po']],
['value' => ['shareWith' => 'r2-d2']],
]
],
'expected' => [
'users' =>
[
['value' => ['shareWith' => 'alice']],
['value' => ['shareWith' => 'bob']],
['value' => ['shareWith' => 'celia']],
['value' => ['shareWith' => 'darius']],
['value' => ['shareWith' => 'elena']],
['value' => ['shareWith' => 'faruk']],
['value' => ['shareWith' => 'gail']],
],
'users' => [
['value' => ['shareWith' => 'alice']],
['value' => ['shareWith' => 'bob']],
['value' => ['shareWith' => 'celia']],
['value' => ['shareWith' => 'darius']],
['value' => ['shareWith' => 'elena']],
['value' => ['shareWith' => 'faruk']],
['value' => ['shareWith' => 'gail']],
],
'bots' => [
['value' => ['shareWith' => 'c-3po']],
['value' => ['shareWith' => 'r2-d2']],

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2017 ownCloud GmbH

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@ -40,8 +41,8 @@ abstract class Base implements IProvider {
* @return array
*/
protected function generateCalendarParameter($data, IL10N $l) {
if ($data['uri'] === CalDavBackend::PERSONAL_CALENDAR_URI &&
$data['name'] === CalDavBackend::PERSONAL_CALENDAR_NAME) {
if ($data['uri'] === CalDavBackend::PERSONAL_CALENDAR_URI
&& $data['name'] === CalDavBackend::PERSONAL_CALENDAR_NAME) {
return [
'type' => 'calendar',
'id' => (string)$data['id'],

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -295,8 +295,8 @@ class BirthdayService {
}
return (
$newCalendarData->VEVENT->DTSTART->getValue() !== $existingBirthday->VEVENT->DTSTART->getValue() ||
$newCalendarData->VEVENT->SUMMARY->getValue() !== $existingBirthday->VEVENT->SUMMARY->getValue()
$newCalendarData->VEVENT->DTSTART->getValue() !== $existingBirthday->VEVENT->DTSTART->getValue()
|| $newCalendarData->VEVENT->SUMMARY->getValue() !== $existingBirthday->VEVENT->SUMMARY->getValue()
);
}

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@ -409,8 +410,8 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
// New share can not have more permissions than the old one.
continue;
}
if (isset($calendars[$row['id']][$readOnlyPropertyName]) &&
$calendars[$row['id']][$readOnlyPropertyName] === 0) {
if (isset($calendars[$row['id']][$readOnlyPropertyName])
&& $calendars[$row['id']][$readOnlyPropertyName] === 0) {
// Old share is already read-write, no more permissions can be gained
continue;
}
@ -2009,8 +2010,8 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
if ($pattern !== '') {
$innerQuery->andWhere($innerQuery->expr()->iLike('op.value',
$outerQuery->createNamedParameter('%' .
$this->db->escapeLikeParameter($pattern) . '%')));
$outerQuery->createNamedParameter('%'
. $this->db->escapeLikeParameter($pattern) . '%')));
}
$start = null;

View file

@ -53,8 +53,8 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IRestorable, IShareable
if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI && strcasecmp($this->calendarInfo['{DAV:}displayname'], 'Contact birthdays') === 0) {
$this->calendarInfo['{DAV:}displayname'] = $l10n->t('Contact birthdays');
}
if ($this->getName() === CalDavBackend::PERSONAL_CALENDAR_URI &&
$this->calendarInfo['{DAV:}displayname'] === CalDavBackend::PERSONAL_CALENDAR_NAME) {
if ($this->getName() === CalDavBackend::PERSONAL_CALENDAR_URI
&& $this->calendarInfo['{DAV:}displayname'] === CalDavBackend::PERSONAL_CALENDAR_NAME) {
$this->calendarInfo['{DAV:}displayname'] = $l10n->t('Personal');
}
$this->l10n = $l10n;

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.

View file

@ -33,8 +33,8 @@ class CalendarRoot extends \Sabre\CalDAV\CalendarRoot {
}
public function getName() {
if ($this->principalPrefix === 'principals/calendar-resources' ||
$this->principalPrefix === 'principals/calendar-rooms') {
if ($this->principalPrefix === 'principals/calendar-resources'
|| $this->principalPrefix === 'principals/calendar-rooms') {
$parts = explode('/', $this->principalPrefix);
return $parts[1];

View file

@ -169,9 +169,9 @@ class EventReader {
if (isset($this->baseEvent->DTEND)) {
$this->baseEventEndDate = $this->baseEvent->DTEND->getDateTime($this->baseEventEndTimeZone);
$this->baseEventEndDateFloating = $this->baseEvent->DTEND->isFloating();
$this->baseEventDuration =
$this->baseEvent->DTEND->getDateTime($this->baseEventEndTimeZone)->getTimeStamp() -
$this->baseEventStartDate->getTimeStamp();
$this->baseEventDuration
= $this->baseEvent->DTEND->getDateTime($this->baseEventEndTimeZone)->getTimeStamp()
- $this->baseEventStartDate->getTimeStamp();
}
// evaluate if duration exists
// extract duration and calculate end date
@ -362,8 +362,8 @@ class EventReader {
public function recurringConcludes(): bool {
// retrieve rrule conclusions
if ($this->rruleIterator?->concludesOn() !== null ||
$this->rruleIterator?->concludesAfter() !== null) {
if ($this->rruleIterator?->concludesOn() !== null
|| $this->rruleIterator?->concludesAfter() !== null) {
return true;
}
// retrieve rdate conclusions

View file

@ -18,7 +18,7 @@ use Sabre\VObject\Writer;
* Calendar Export Service
*/
class ExportService {
public const FORMATS = ['ical', 'jcal', 'xcal'];
private string $systemVersion;
@ -92,7 +92,7 @@ class ExportService {
default => Writer::write($vobject)
};
}
/**
* Generates serialized content for a component in xml format
*/

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -441,10 +441,10 @@ class ReminderService {
*/
private function deleteOrProcessNext(array $reminder,
VObject\Component\VEvent $vevent):void {
if ($reminder['is_repeat_based'] ||
!$reminder['is_recurring'] ||
!$reminder['is_relative'] ||
$reminder['is_recurrence_exception']) {
if ($reminder['is_repeat_based']
|| !$reminder['is_recurring']
|| !$reminder['is_relative']
|| $reminder['is_recurrence_exception']) {
$this->backend->removeReminder($reminder['id']);
return;
}

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@ -85,8 +86,8 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$metaDataById[$metaDataRow[$this->dbForeignKeyName]] = [];
}
$metaDataById[$metaDataRow[$this->dbForeignKeyName]][$metaDataRow['key']] =
$metaDataRow['value'];
$metaDataById[$metaDataRow[$this->dbForeignKeyName]][$metaDataRow['key']]
= $metaDataRow['value'];
}
while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
@ -470,9 +471,9 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
* @return bool
*/
private function isAllowedToAccessResource(array $row, array $userGroups): bool {
if (!isset($row['group_restrictions']) ||
$row['group_restrictions'] === null ||
$row['group_restrictions'] === '') {
if (!isset($row['group_restrictions'])
|| $row['group_restrictions'] === null
|| $row['group_restrictions'] === '') {
return true;
}

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -45,7 +45,7 @@ use Sabre\VObject\Reader;
* @license http://sabre.io/license/ Modified BSD License
*/
class IMipPlugin extends SabreIMipPlugin {
private ?VCalendar $vCalendar = null;
public const MAX_DATE = '2038-01-01';
public const METHOD_REQUEST = 'request';

View file

@ -352,7 +352,7 @@ class IMipService {
* @return string
*/
public function generateWhenStringRecurringDaily(EventReader $er): string {
// initialize
$interval = (int)$er->recurringInterval();
$startTime = null;
@ -403,7 +403,7 @@ class IMipService {
* @return string
*/
public function generateWhenStringRecurringWeekly(EventReader $er): string {
// initialize
$interval = (int)$er->recurringInterval();
$startTime = null;
@ -456,15 +456,15 @@ class IMipService {
* @return string
*/
public function generateWhenStringRecurringMonthly(EventReader $er): string {
// initialize
$interval = (int)$er->recurringInterval();
$startTime = null;
$conclusion = null;
// days of month
if ($er->recurringPattern() === 'R') {
$days = implode(', ', array_map(function ($value) { return $this->localizeRelativePositionName($value); }, $er->recurringRelativePositionNamed())) . ' ' .
implode(', ', array_map(function ($value) { return $this->localizeDayName($value); }, $er->recurringDaysOfWeekNamed()));
$days = implode(', ', array_map(function ($value) { return $this->localizeRelativePositionName($value); }, $er->recurringRelativePositionNamed())) . ' '
. implode(', ', array_map(function ($value) { return $this->localizeDayName($value); }, $er->recurringDaysOfWeekNamed()));
} else {
$days = implode(', ', $er->recurringDaysOfMonth());
}
@ -521,7 +521,7 @@ class IMipService {
* @return string
*/
public function generateWhenStringRecurringYearly(EventReader $er): string {
// initialize
$interval = (int)$er->recurringInterval();
$startTime = null;
@ -530,8 +530,8 @@ class IMipService {
$months = implode(', ', array_map(function ($value) { return $this->localizeMonthName($value); }, $er->recurringMonthsOfYearNamed()));
// days of month
if ($er->recurringPattern() === 'R') {
$days = implode(', ', array_map(function ($value) { return $this->localizeRelativePositionName($value); }, $er->recurringRelativePositionNamed())) . ' ' .
implode(', ', array_map(function ($value) { return $this->localizeDayName($value); }, $er->recurringDaysOfWeekNamed()));
$days = implode(', ', array_map(function ($value) { return $this->localizeRelativePositionName($value); }, $er->recurringRelativePositionNamed())) . ' '
. implode(', ', array_map(function ($value) { return $this->localizeDayName($value); }, $er->recurringDaysOfWeekNamed()));
} else {
$days = $er->startDateTime()->format('jS');
}
@ -610,7 +610,7 @@ class IMipService {
true => $this->l10n->t('On specific dates between %1$s - %2$s until %3$s', [$startTime, $endTime, $conclusion]),
};
}
/**
* generates a occurring next string for a recurring event
*
@ -1108,8 +1108,8 @@ class IMipService {
$attendee = $iTipMessage->recipient;
$organizer = $iTipMessage->sender;
$sequence = $iTipMessage->sequence;
$recurrenceId = isset($vevent->{'RECURRENCE-ID'}) ?
$vevent->{'RECURRENCE-ID'}->serialize() : null;
$recurrenceId = isset($vevent->{'RECURRENCE-ID'})
? $vevent->{'RECURRENCE-ID'}->serialize() : null;
$uid = $vevent->{'UID'};
$query = $this->db->getQueryBuilder();

View file

@ -372,8 +372,8 @@ EOF;
return null;
}
$isResourceOrRoom = str_starts_with($principalUrl, 'principals/calendar-resources') ||
str_starts_with($principalUrl, 'principals/calendar-rooms');
$isResourceOrRoom = str_starts_with($principalUrl, 'principals/calendar-resources')
|| str_starts_with($principalUrl, 'principals/calendar-rooms');
if (str_starts_with($principalUrl, 'principals/users')) {
[, $userId] = split($principalUrl);

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@ -61,8 +62,8 @@ class SearchPlugin extends ServerPlugin {
$server->on('report', [$this, 'report']);
$server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] =
CalendarSearchReport::class;
$server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search']
= CalendarSearchReport::class;
}
/**

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -97,7 +97,7 @@ class TipBroker extends Broker {
// Also If the meeting STATUS property was changed to CANCELLED
// we need to send the attendee a CANCEL message.
if (!$attendee['newInstances'] || $eventInfo['status'] === 'CANCELLED') {
$message->method = $icalMsg->METHOD = 'CANCEL';
$message->significantChange = true;
// clone base event
@ -108,7 +108,7 @@ class TipBroker extends Broker {
$event->DTSTAMP = gmdate('Ymd\\THis\\Z');
$event->SEQUENCE = $message->sequence;
$icalMsg->add($event);
} else {
// The attendee gets the updated event body
$message->method = $icalMsg->METHOD = 'REQUEST';
@ -124,11 +124,11 @@ class TipBroker extends Broker {
$oldAttendeeInstances = array_keys($attendee['oldInstances']);
$newAttendeeInstances = array_keys($attendee['newInstances']);
$message->significantChange =
$attendee['forceSend'] === 'REQUEST' ||
count($oldAttendeeInstances) !== count($newAttendeeInstances) ||
count(array_diff($oldAttendeeInstances, $newAttendeeInstances)) > 0 ||
$oldEventInfo['significantChangeHash'] !== $eventInfo['significantChangeHash'];
$message->significantChange
= $attendee['forceSend'] === 'REQUEST'
|| count($oldAttendeeInstances) !== count($newAttendeeInstances)
|| count(array_diff($oldAttendeeInstances, $newAttendeeInstances)) > 0
|| $oldEventInfo['significantChangeHash'] !== $eventInfo['significantChangeHash'];
foreach ($attendee['newInstances'] as $instanceId => $instanceInfo) {
$currentEvent = clone $eventInfo['instances'][$instanceId];

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 ownCloud GmbH
* SPDX-License-Identifier: AGPL-3.0-only

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -41,8 +41,8 @@ abstract class Base implements IProvider {
* @return array
*/
protected function generateAddressbookParameter(array $data, IL10N $l): array {
if ($data['uri'] === CardDavBackend::PERSONAL_ADDRESSBOOK_URI &&
$data['name'] === CardDavBackend::PERSONAL_ADDRESSBOOK_NAME) {
if ($data['uri'] === CardDavBackend::PERSONAL_ADDRESSBOOK_URI
&& $data['name'] === CardDavBackend::PERSONAL_ADDRESSBOOK_NAME) {
return [
'type' => 'addressbook',
'id' => (string)$data['id'],

View file

@ -38,8 +38,8 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable, IMov
parent::__construct($carddavBackend, $addressBookInfo);
if ($this->addressBookInfo['{DAV:}displayname'] === CardDavBackend::PERSONAL_ADDRESSBOOK_NAME &&
$this->getName() === CardDavBackend::PERSONAL_ADDRESSBOOK_URI) {
if ($this->addressBookInfo['{DAV:}displayname'] === CardDavBackend::PERSONAL_ADDRESSBOOK_NAME
&& $this->getName() === CardDavBackend::PERSONAL_ADDRESSBOOK_URI) {
$this->addressBookInfo['{DAV:}displayname'] = $l10n->t('Contacts');
}
}

View file

@ -307,8 +307,8 @@ class AddressBookImpl implements IAddressBookEnabled {
*/
public function isSystemAddressBook(): bool {
return $this->addressBookInfo['principaluri'] === 'principals/system/system' && (
$this->addressBookInfo['uri'] === 'system' ||
$this->addressBookInfo['{DAV:}displayname'] === $this->urlGenerator->getBaseUrl()
$this->addressBookInfo['uri'] === 'system'
|| $this->addressBookInfo['{DAV:}displayname'] === $this->urlGenerator->getBaseUrl()
);
}
@ -324,7 +324,7 @@ class AddressBookImpl implements IAddressBookEnabled {
$user = str_replace('principals/users/', '', $this->addressBookInfo['principaluri']);
$uri = $this->addressBookInfo['uri'];
}
$path = 'addressbooks/users/' . $user . '/' . $uri;
$properties = $this->propertyMapper->findPropertyByPathAndName($user, $path, '{http://owncloud.org/ns}enabled');
if (count($properties) > 0) {

View file

@ -159,8 +159,8 @@ class CardDavBackend implements BackendInterface, SyncSupport {
// New share can not have more permissions then the old one.
continue;
}
if (isset($addressBooks[$row['id']][$readOnlyPropertyName]) &&
$addressBooks[$row['id']][$readOnlyPropertyName] === 0) {
if (isset($addressBooks[$row['id']][$readOnlyPropertyName])
&& $addressBooks[$row['id']][$readOnlyPropertyName] === 0) {
// Old share is already read-write, no more permissions can be gained
continue;
}

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -79,7 +79,7 @@ class ExportCalendar extends Command {
if ($handle === false) {
throw new InvalidArgumentException("Location <$location> is not valid. Can not open location for write operation.");
}
foreach ($this->exportService->export($calendar, $options) as $chunk) {
fwrite($handle, $chunk);
}

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -55,8 +55,8 @@ class Auth extends AbstractBasic {
* @see https://github.com/owncloud/core/issues/13245
*/
public function isDavAuthenticated(string $username): bool {
return !is_null($this->session->get(self::DAV_AUTHENTICATED)) &&
$this->session->get(self::DAV_AUTHENTICATED) === $username;
return !is_null($this->session->get(self::DAV_AUTHENTICATED))
&& $this->session->get(self::DAV_AUTHENTICATED) === $username;
}
/**
@ -71,8 +71,8 @@ class Auth extends AbstractBasic {
* @throws PasswordLoginForbidden
*/
protected function validateUserPass($username, $password) {
if ($this->userSession->isLoggedIn() &&
$this->isDavAuthenticated($this->userSession->getUser()->getUID())
if ($this->userSession->isLoggedIn()
&& $this->isDavAuthenticated($this->userSession->getUser()->getUID())
) {
$this->session->close();
return true;
@ -118,7 +118,7 @@ class Auth extends AbstractBasic {
* Checks whether a CSRF check is required on the request
*/
private function requiresCSRFCheck(): bool {
$methodsWithoutCsrf = ['GET', 'HEAD', 'OPTIONS'];
if (in_array($this->request->getMethod(), $methodsWithoutCsrf)) {
return false;
@ -144,8 +144,8 @@ class Auth extends AbstractBasic {
}
// If logged-in AND DAV authenticated no check is required
if ($this->userSession->isLoggedIn() &&
$this->isDavAuthenticated($this->userSession->getUser()->getUID())) {
if ($this->userSession->isLoggedIn()
&& $this->isDavAuthenticated($this->userSession->getUser()->getUID())) {
return false;
}
@ -159,8 +159,8 @@ class Auth extends AbstractBasic {
private function auth(RequestInterface $request, ResponseInterface $response): array {
$forcedLogout = false;
if (!$this->request->passesCSRFCheck() &&
$this->requiresCSRFCheck()) {
if (!$this->request->passesCSRFCheck()
&& $this->requiresCSRFCheck()) {
// In case of a fail with POST we need to recheck the credentials
if ($this->request->getMethod() === 'POST') {
$forcedLogout = true;
@ -178,10 +178,10 @@ class Auth extends AbstractBasic {
}
if (
//Fix for broken webdav clients
($this->userSession->isLoggedIn() && is_null($this->session->get(self::DAV_AUTHENTICATED))) ||
($this->userSession->isLoggedIn() && is_null($this->session->get(self::DAV_AUTHENTICATED)))
//Well behaved clients that only send the cookie are allowed
($this->userSession->isLoggedIn() && $this->session->get(self::DAV_AUTHENTICATED) === $this->userSession->getUser()->getUID() && empty($request->getHeader('Authorization'))) ||
\OC_User::handleApacheAuth()
|| ($this->userSession->isLoggedIn() && $this->session->get(self::DAV_AUTHENTICATED) === $this->userSession->getUser()->getUID() && empty($request->getHeader('Authorization')))
|| \OC_User::handleApacheAuth()
) {
$user = $this->userSession->getUser()->getUID();
$this->currentUser = $user;

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -62,7 +62,7 @@ class DavAclPlugin extends \Sabre\DAVACL\Plugin {
)
);
}
}
return $access;

View file

@ -43,8 +43,8 @@ class DummyGetResponsePlugin extends \Sabre\DAV\ServerPlugin {
* @return false
*/
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.';
$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+');
fwrite($stream, $string);
rewind($stream);

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only

View file

@ -117,8 +117,8 @@ class FakeLockerPlugin extends ServerPlugin {
$lockInfo->timeout = 1800;
$body = $this->server->xml->write('{DAV:}prop', [
'{DAV:}lockdiscovery' =>
new LockDiscovery([$lockInfo])
'{DAV:}lockdiscovery'
=> new LockDiscovery([$lockInfo])
]);
$response->setStatus(Http::STATUS_OK);

View file

@ -257,8 +257,8 @@ class FilesPlugin extends ServerPlugin {
// adds a 'Content-Disposition: attachment' header in case no disposition
// header has been set before
if ($this->downloadAttachment &&
$response->getHeader('Content-Disposition') === null) {
if ($this->downloadAttachment
&& $response->getHeader('Content-Disposition') === null) {
$filename = $node->getName();
if ($this->request->isUserAgent(
[
@ -541,8 +541,8 @@ class FilesPlugin extends ServerPlugin {
$ocmPermissions[] = 'read';
}
if (($ncPermissions & Constants::PERMISSION_CREATE) ||
($ncPermissions & Constants::PERMISSION_UPDATE)) {
if (($ncPermissions & Constants::PERMISSION_CREATE)
|| ($ncPermissions & Constants::PERMISSION_UPDATE)) {
$ocmPermissions[] = 'write';
}

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.

View file

@ -176,8 +176,8 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin {
if ($sabreNode instanceof Directory
&& $propFind->getDepth() !== 0
&& (
!is_null($propFind->getStatus(self::SHARETYPES_PROPERTYNAME)) ||
!is_null($propFind->getStatus(self::SHAREES_PROPERTYNAME))
!is_null($propFind->getStatus(self::SHARETYPES_PROPERTYNAME))
|| !is_null($propFind->getStatus(self::SHAREES_PROPERTYNAME))
)
) {
$folderNode = $sabreNode->getNode();

View file

@ -281,8 +281,8 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin {
public function handlePreloadProperties(array $nodes, array $requestProperties): void {
if (
!in_array(self::FAVORITE_PROPERTYNAME, $requestProperties, true) &&
!in_array(self::TAGS_PROPERTYNAME, $requestProperties, true)
!in_array(self::FAVORITE_PROPERTYNAME, $requestProperties, true)
&& !in_array(self::TAGS_PROPERTYNAME, $requestProperties, true)
) {
return;
}

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@ -282,8 +283,8 @@ class CustomPropertiesBackend implements BackendInterface {
*/
public function move($source, $destination) {
$statement = $this->connection->prepare(
'UPDATE `*PREFIX*properties` SET `propertypath` = ?' .
' WHERE `userid` = ? AND `propertypath` = ?'
'UPDATE `*PREFIX*properties` SET `propertypath` = ?'
. ' WHERE `userid` = ? AND `propertypath` = ?'
);
$statement->execute([$this->formatPath($destination), $this->user->getUID(), $this->formatPath($source)]);
$statement->closeCursor();

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.

View file

@ -64,8 +64,8 @@ abstract class Backend {
}
$principalparts[2] = urldecode($principalparts[2]);
if (($principalparts[1] === 'users' && !$this->userManager->userExists($principalparts[2])) ||
($principalparts[1] === 'groups' && !$this->groupManager->groupExists($principalparts[2]))) {
if (($principalparts[1] === 'users' && !$this->userManager->userExists($principalparts[2]))
|| ($principalparts[1] === 'groups' && !$this->groupManager->groupExists($principalparts[2]))) {
// User or group does not exist
continue;
}
@ -199,7 +199,7 @@ abstract class Backend {
public function unshare(IShareable $shareable, string $principalUri): bool {
$this->shareCache->clear();
$principal = $this->principalBackend->findByUri($principalUri, '');
if (empty($principal)) {
return false;

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -42,11 +42,11 @@ class DavAdminSettingsListener implements IEventListener {
$this->handleSetValue($event);
return;
}
}
private function handleGetValue(DeclarativeSettingsGetValueEvent $event): void {
if ($event->getFieldId() === 'system_addressbook_enabled') {
$event->setValue((int)$this->config->getValueBool('dav', 'system_addressbook_exposed', true));
}

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only

View file

@ -1,4 +1,5 @@
<?php
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later

Some files were not shown because too many files have changed in this diff Show more