mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
8c60ffa0f2
commit
9836e9b164
595 changed files with 1657 additions and 1526 deletions
|
|
@ -32,13 +32,13 @@ class Action {
|
|||
if (!isset($params[$element])) {
|
||||
if ($obfuscateParameters) {
|
||||
$this->logger->critical(
|
||||
'$params["'.$element.'"] was missing.',
|
||||
'$params["' . $element . '"] was missing.',
|
||||
['app' => 'admin_audit']
|
||||
);
|
||||
} else {
|
||||
$this->logger->critical(
|
||||
sprintf(
|
||||
'$params["'.$element.'"] was missing. Transferred value: %s',
|
||||
'$params["' . $element . '"] was missing. Transferred value: %s',
|
||||
print_r($params, true)
|
||||
),
|
||||
['app' => 'admin_audit']
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class Files extends Action {
|
|||
];
|
||||
} catch (InvalidPathException|NotFoundException $e) {
|
||||
\OCP\Server::get(LoggerInterface::class)->error(
|
||||
'Exception thrown in file read: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
'Exception thrown in file read: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -64,7 +64,7 @@ class Files extends Action {
|
|||
$this->renamedNodes[$source->getId()] = $source;
|
||||
} catch (InvalidPathException|NotFoundException $e) {
|
||||
\OCP\Server::get(LoggerInterface::class)->error(
|
||||
'Exception thrown in file rename: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
'Exception thrown in file rename: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -86,7 +86,7 @@ class Files extends Action {
|
|||
];
|
||||
} catch (InvalidPathException|NotFoundException $e) {
|
||||
\OCP\Server::get(LoggerInterface::class)->error(
|
||||
'Exception thrown in file rename: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
'Exception thrown in file rename: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -112,7 +112,7 @@ class Files extends Action {
|
|||
];
|
||||
} catch (InvalidPathException|NotFoundException $e) {
|
||||
\OCP\Server::get(LoggerInterface::class)->error(
|
||||
'Exception thrown in file create: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
'Exception thrown in file create: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@ class Files extends Action {
|
|||
];
|
||||
} catch (InvalidPathException|NotFoundException $e) {
|
||||
\OCP\Server::get(LoggerInterface::class)->error(
|
||||
'Exception thrown in file copy: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
'Exception thrown in file copy: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -166,7 +166,7 @@ class Files extends Action {
|
|||
];
|
||||
} catch (InvalidPathException|NotFoundException $e) {
|
||||
\OCP\Server::get(LoggerInterface::class)->error(
|
||||
'Exception thrown in file write: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
'Exception thrown in file write: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -194,7 +194,7 @@ class Files extends Action {
|
|||
];
|
||||
} catch (InvalidPathException|NotFoundException $e) {
|
||||
\OCP\Server::get(LoggerInterface::class)->error(
|
||||
'Exception thrown in file update: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
'Exception thrown in file update: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -218,7 +218,7 @@ class Files extends Action {
|
|||
];
|
||||
} catch (InvalidPathException|NotFoundException $e) {
|
||||
\OCP\Server::get(LoggerInterface::class)->error(
|
||||
'Exception thrown in file delete: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
'Exception thrown in file delete: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class FileEventListener extends Action implements IEventListener {
|
|||
);
|
||||
} catch (InvalidPathException|NotFoundException $e) {
|
||||
\OCP\Server::get(LoggerInterface::class)->error(
|
||||
'Exception thrown in file preview: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
'Exception thrown in file preview: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class RequestHandlerController extends Controller {
|
|||
private ICloudFederationProviderManager $cloudFederationProviderManager,
|
||||
private Config $config,
|
||||
private ICloudFederationFactory $factory,
|
||||
private ICloudIdManager $cloudIdManager
|
||||
private ICloudIdManager $cloudIdManager,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class NotificationsController extends Controller {
|
|||
protected IRootFolder $rootFolder,
|
||||
protected IURLGenerator $urlGenerator,
|
||||
protected IManager $notificationManager,
|
||||
protected IUserSession $userSession
|
||||
protected IUserSession $userSession,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use OCP\Notification\INotification;
|
|||
class Listener {
|
||||
public function __construct(
|
||||
protected IManager $notificationManager,
|
||||
protected IUserManager $userManager
|
||||
protected IUserManager $userManager,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class Notifier implements INotifier {
|
|||
protected IRootFolder $rootFolder,
|
||||
protected ICommentsManager $commentsManager,
|
||||
protected IURLGenerator $url,
|
||||
protected IUserManager $userManager
|
||||
protected IUserManager $userManager,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class BuildReminderIndexBackgroundJob extends QueuedJob {
|
|||
$offset = (int)$argument['offset'];
|
||||
$stopAt = (int)$argument['stopAt'];
|
||||
|
||||
$this->logger->info('Building calendar reminder index (' . $offset .'/' . $stopAt . ')');
|
||||
$this->logger->info('Building calendar reminder index (' . $offset . '/' . $stopAt . ')');
|
||||
|
||||
$offset = $this->buildIndex($offset, $stopAt);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,14 +28,16 @@ use Sabre\VObject\Reader;
|
|||
use Sabre\VObject\Recur\RRuleIterator;
|
||||
|
||||
class UserStatusAutomation extends TimedJob {
|
||||
public function __construct(private ITimeFactory $timeFactory,
|
||||
public function __construct(
|
||||
private ITimeFactory $timeFactory,
|
||||
private IDBConnection $connection,
|
||||
private IJobList $jobList,
|
||||
private LoggerInterface $logger,
|
||||
private IManager $manager,
|
||||
private IConfig $config,
|
||||
private IAvailabilityCoordinator $coordinator,
|
||||
private IUserManager $userManager) {
|
||||
private IUserManager $userManager,
|
||||
) {
|
||||
parent::__construct($timeFactory);
|
||||
|
||||
// Interval 0 might look weird, but the last_checked is always moved
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class BulkUploadPlugin extends ServerPlugin {
|
|||
|
||||
public function __construct(
|
||||
Folder $userFolder,
|
||||
LoggerInterface $logger
|
||||
LoggerInterface $logger,
|
||||
) {
|
||||
$this->userFolder = $userFolder;
|
||||
$this->logger = $logger;
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ class MultipartRequestParser {
|
|||
$this->stream = $stream;
|
||||
|
||||
$boundary = $this->parseBoundaryFromHeaders($contentType);
|
||||
$this->boundary = '--'.$boundary."\r\n";
|
||||
$this->lastBoundary = '--'.$boundary."--\r\n";
|
||||
$this->boundary = '--' . $boundary . "\r\n";
|
||||
$this->lastBoundary = '--' . $boundary . "--\r\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class EnablePlugin extends ServerPlugin {
|
|||
|
||||
$requestBody = $request->getBodyAsString();
|
||||
$this->server->xml->parse($requestBody, $request->getUrl(), $documentType);
|
||||
if ($documentType !== '{'.self::NS_Nextcloud.'}enable-birthday-calendar') {
|
||||
if ($documentType !== '{' . self::NS_Nextcloud . '}enable-birthday-calendar') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class BirthdayService {
|
|||
|
||||
$calendar = $this->ensureCalendarExists($principalUri);
|
||||
foreach (['', '-death', '-anniversary'] as $tag) {
|
||||
$objectUri = $book['uri'] . '-' . $cardUri . $tag .'.ics';
|
||||
$objectUri = $book['uri'] . '-' . $cardUri . $tag . '.ics';
|
||||
$this->calDavBackEnd->deleteCalendarObject($calendar['id'], $objectUri, CalDavBackend::CALENDAR_TYPE_CALENDAR, true);
|
||||
}
|
||||
}
|
||||
|
|
@ -264,7 +264,7 @@ class BirthdayService {
|
|||
* @param string $user
|
||||
*/
|
||||
public function resetForUser(string $user):void {
|
||||
$principal = 'principals/users/'.$user;
|
||||
$principal = 'principals/users/' . $user;
|
||||
$calendar = $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI);
|
||||
if (!$calendar) {
|
||||
return; // The user's birthday calendar doesn't exist, no need to purge it
|
||||
|
|
@ -281,7 +281,7 @@ class BirthdayService {
|
|||
* @throws \Sabre\DAV\Exception\BadRequest
|
||||
*/
|
||||
public function syncUser(string $user):void {
|
||||
$principal = 'principals/users/'.$user;
|
||||
$principal = 'principals/users/' . $user;
|
||||
$this->ensureCalendarExists($principal);
|
||||
$books = $this->cardDavBackEnd->getAddressBooksForUser($principal);
|
||||
foreach ($books as $book) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class CachedSubscriptionImpl implements ICalendar {
|
|||
public function __construct(
|
||||
CachedSubscription $calendar,
|
||||
array $calendarInfo,
|
||||
CalDavBackend $backend
|
||||
CalDavBackend $backend,
|
||||
) {
|
||||
$this->calendar = $calendar;
|
||||
$this->calendarInfo = $calendarInfo;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ use OCP\Calendar\ICalendarProvider;
|
|||
class CachedSubscriptionProvider implements ICalendarProvider {
|
||||
|
||||
public function __construct(
|
||||
private CalDavBackend $calDavBackend
|
||||
private CalDavBackend $calDavBackend,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
|
||||
$fields = array_column($this->propertyMap, 0);
|
||||
$fields = array_map(function (string $field) {
|
||||
return 'a.'.$field;
|
||||
return 'a.' . $field;
|
||||
}, $fields);
|
||||
$fields[] = 'a.id';
|
||||
$fields[] = 'a.uri';
|
||||
|
|
@ -1713,19 +1713,19 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
try {
|
||||
$matches = $this->validateFilterForObject($row, $filters);
|
||||
} catch (ParseException $ex) {
|
||||
$this->logger->error('Caught parsing exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$calendarId.' uri:'.$row['uri'], [
|
||||
$this->logger->error('Caught parsing exception for calendar data. This usually indicates invalid calendar data. calendar-id:' . $calendarId . ' uri:' . $row['uri'], [
|
||||
'app' => 'dav',
|
||||
'exception' => $ex,
|
||||
]);
|
||||
continue;
|
||||
} catch (InvalidDataException $ex) {
|
||||
$this->logger->error('Caught invalid data exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$calendarId.' uri:'.$row['uri'], [
|
||||
$this->logger->error('Caught invalid data exception for calendar data. This usually indicates invalid calendar data. calendar-id:' . $calendarId . ' uri:' . $row['uri'], [
|
||||
'app' => 'dav',
|
||||
'exception' => $ex,
|
||||
]);
|
||||
continue;
|
||||
} catch (MaxInstancesExceededException $ex) {
|
||||
$this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: '.$row['uri'], [
|
||||
$this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: ' . $row['uri'], [
|
||||
'app' => 'dav',
|
||||
'exception' => $ex,
|
||||
]);
|
||||
|
|
@ -1848,7 +1848,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
->andWhere($compExpr)
|
||||
->andWhere($propParamExpr)
|
||||
->andWhere($query->expr()->iLike('i.value',
|
||||
$query->createNamedParameter('%'.$this->db->escapeLikeParameter($filters['search-term']).'%')))
|
||||
$query->createNamedParameter('%' . $this->db->escapeLikeParameter($filters['search-term']) . '%')))
|
||||
->andWhere($query->expr()->isNull('deleted_at'));
|
||||
|
||||
if ($offset) {
|
||||
|
|
@ -1890,7 +1890,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
array $searchProperties,
|
||||
array $options,
|
||||
$limit,
|
||||
$offset
|
||||
$offset,
|
||||
) {
|
||||
$outerQuery = $this->db->getQueryBuilder();
|
||||
$innerQuery = $this->db->getQueryBuilder();
|
||||
|
|
@ -2066,7 +2066,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
return $calendarObjects;
|
||||
}
|
||||
|
||||
private function searchCalendarObjects(IQueryBuilder $query, DateTimeInterface|null $start, DateTimeInterface|null $end): array {
|
||||
private function searchCalendarObjects(IQueryBuilder $query, ?DateTimeInterface $start, ?DateTimeInterface $end): array {
|
||||
$calendarObjects = [];
|
||||
$filterByTimeRange = ($start instanceof DateTimeInterface) || ($end instanceof DateTimeInterface);
|
||||
|
||||
|
|
@ -2099,7 +2099,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
'time-range' => null,
|
||||
]);
|
||||
} catch (MaxInstancesExceededException $ex) {
|
||||
$this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: '.$row['uri'], [
|
||||
$this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: ' . $row['uri'], [
|
||||
'app' => 'dav',
|
||||
'exception' => $ex,
|
||||
]);
|
||||
|
|
@ -2196,7 +2196,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
array $componentTypes,
|
||||
array $searchProperties,
|
||||
array $searchParameters,
|
||||
array $options = []
|
||||
array $options = [],
|
||||
): array {
|
||||
return $this->atomic(function () use ($principalUri, $pattern, $componentTypes, $searchProperties, $searchParameters, $options) {
|
||||
$escapePattern = !\array_key_exists('escape_like_param', $options) || $options['escape_like_param'] !== false;
|
||||
|
|
|
|||
|
|
@ -189,8 +189,8 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IRestorable, IShareable
|
|||
$acl = $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl);
|
||||
$allowedPrincipals = [
|
||||
$this->getOwner(),
|
||||
$this->getOwner(). '/calendar-proxy-read',
|
||||
$this->getOwner(). '/calendar-proxy-write',
|
||||
$this->getOwner() . '/calendar-proxy-read',
|
||||
$this->getOwner() . '/calendar-proxy-write',
|
||||
parent::getOwner(),
|
||||
'principals/system/public'
|
||||
];
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class CalendarHome extends \Sabre\CalDAV\CalendarHome {
|
|||
BackendInterface $caldavBackend,
|
||||
array $principalInfo,
|
||||
LoggerInterface $logger,
|
||||
private bool $returnCachedSubscriptions
|
||||
private bool $returnCachedSubscriptions,
|
||||
) {
|
||||
parent::__construct($caldavBackend, $principalInfo);
|
||||
$this->l10n = \OC::$server->getL10N('dav');
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class CalendarRoot extends \Sabre\CalDAV\CalendarRoot {
|
|||
PrincipalBackend\BackendInterface $principalBackend,
|
||||
Backend\BackendInterface $caldavBackend,
|
||||
$principalPrefix,
|
||||
LoggerInterface $logger
|
||||
LoggerInterface $logger,
|
||||
) {
|
||||
parent::__construct($principalBackend, $caldavBackend, $principalPrefix);
|
||||
$this->logger = $logger;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class EventReader {
|
|||
$events = $input->getByUID($uid);
|
||||
// evaluate if any event where found
|
||||
if (count($events) === 0) {
|
||||
throw new InvalidArgumentException('This VCALENDAR did not have an event with UID: '.$uid);
|
||||
throw new InvalidArgumentException('This VCALENDAR did not have an event with UID: ' . $uid);
|
||||
}
|
||||
// extract calendar timezone
|
||||
if (isset($input->VTIMEZONE) && isset($input->VTIMEZONE->TZID)) {
|
||||
|
|
@ -297,7 +297,7 @@ class EventReader {
|
|||
*
|
||||
* @return string|null R - Relative or A - Absolute
|
||||
*/
|
||||
public function recurringPattern(): string|null {
|
||||
public function recurringPattern(): ?string {
|
||||
if ($this->rruleIterator === null && $this->rdateIterator === null) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -314,7 +314,7 @@ class EventReader {
|
|||
*
|
||||
* @return string|null daily, weekly, monthly, yearly, fixed
|
||||
*/
|
||||
public function recurringPrecision(): string|null {
|
||||
public function recurringPrecision(): ?string {
|
||||
if ($this->rruleIterator !== null) {
|
||||
return $this->rruleIterator->precision();
|
||||
}
|
||||
|
|
@ -331,7 +331,7 @@ class EventReader {
|
|||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function recurringInterval(): int|null {
|
||||
public function recurringInterval(): ?int {
|
||||
return $this->rruleIterator?->interval();
|
||||
}
|
||||
|
||||
|
|
@ -374,7 +374,7 @@ class EventReader {
|
|||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function recurringConcludesAfter(): int|null {
|
||||
public function recurringConcludesAfter(): ?int {
|
||||
|
||||
// construct count place holder
|
||||
$count = 0;
|
||||
|
|
@ -399,7 +399,7 @@ class EventReader {
|
|||
*
|
||||
* @return DateTime|null
|
||||
*/
|
||||
public function recurringConcludesOn(): DateTime|null {
|
||||
public function recurringConcludesOn(): ?DateTime {
|
||||
|
||||
if ($this->rruleIterator !== null) {
|
||||
// retrieve rrule conclusion date
|
||||
|
|
@ -626,7 +626,7 @@ class EventReader {
|
|||
*
|
||||
* @return DateTime
|
||||
*/
|
||||
public function recurrenceDate(): DateTime|null {
|
||||
public function recurrenceDate(): ?DateTime {
|
||||
if ($this->recurrenceCurrentDate !== null) {
|
||||
return DateTime::createFromInterface($this->recurrenceCurrentDate);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -13,15 +13,15 @@ use DateTime;
|
|||
|
||||
class EventReaderRDate extends \Sabre\VObject\Recur\RDateIterator {
|
||||
|
||||
public function concludes(): DateTime|null {
|
||||
public function concludes(): ?DateTime {
|
||||
return $this->concludesOn();
|
||||
}
|
||||
|
||||
public function concludesAfter(): int|null {
|
||||
public function concludesAfter(): ?int {
|
||||
return !empty($this->dates) ? count($this->dates) : null;
|
||||
}
|
||||
|
||||
public function concludesOn(): DateTime|null {
|
||||
public function concludesOn(): ?DateTime {
|
||||
if (count($this->dates) > 0) {
|
||||
return new DateTime(
|
||||
$this->dates[array_key_last($this->dates)],
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class EventReaderRRule extends \Sabre\VObject\Recur\RRuleIterator {
|
|||
return $this->interval;
|
||||
}
|
||||
|
||||
public function concludes(): DateTime|null {
|
||||
public function concludes(): ?DateTime {
|
||||
// evaluate if until value is a date
|
||||
if ($this->until instanceof DateTimeInterface) {
|
||||
return DateTime::createFromInterface($this->until);
|
||||
|
|
@ -48,11 +48,11 @@ class EventReaderRRule extends \Sabre\VObject\Recur\RRuleIterator {
|
|||
return null;
|
||||
}
|
||||
|
||||
public function concludesAfter(): int|null {
|
||||
public function concludesAfter(): ?int {
|
||||
return !empty($this->count) ? $this->count : null;
|
||||
}
|
||||
|
||||
public function concludesOn(): DateTime|null {
|
||||
public function concludesOn(): ?DateTime {
|
||||
return isset($this->until) ? DateTime::createFromInterface($this->until) : null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,17 +97,17 @@ class PublishPlugin extends ServerPlugin {
|
|||
|
||||
public function propFind(PropFind $propFind, INode $node) {
|
||||
if ($node instanceof Calendar) {
|
||||
$propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node) {
|
||||
$propFind->handle('{' . self::NS_CALENDARSERVER . '}publish-url', function () use ($node) {
|
||||
if ($node->getPublishStatus()) {
|
||||
// We return the publish-url only if the calendar is published.
|
||||
$token = $node->getPublishStatus();
|
||||
$publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri().'public-calendars/').$token;
|
||||
$publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri() . 'public-calendars/') . $token;
|
||||
|
||||
return new Publisher($publishUrl, true);
|
||||
}
|
||||
});
|
||||
|
||||
$propFind->handle('{'.self::NS_CALENDARSERVER.'}allowed-sharing-modes', function () use ($node) {
|
||||
$propFind->handle('{' . self::NS_CALENDARSERVER . '}allowed-sharing-modes', function () use ($node) {
|
||||
$canShare = (!$node->isSubscription() && $node->canWrite());
|
||||
$canPublish = (!$node->isSubscription() && $node->canWrite());
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ class PublishPlugin extends ServerPlugin {
|
|||
|
||||
switch ($documentType) {
|
||||
|
||||
case '{'.self::NS_CALENDARSERVER.'}publish-calendar':
|
||||
case '{' . self::NS_CALENDARSERVER . '}publish-calendar':
|
||||
|
||||
// We can only deal with IShareableCalendar objects
|
||||
if (!$node instanceof Calendar) {
|
||||
|
|
@ -195,7 +195,7 @@ class PublishPlugin extends ServerPlugin {
|
|||
// Breaking the event chain
|
||||
return false;
|
||||
|
||||
case '{'.self::NS_CALENDARSERVER.'}unpublish-calendar':
|
||||
case '{' . self::NS_CALENDARSERVER . '}unpublish-calendar':
|
||||
|
||||
// We can only deal with IShareableCalendar objects
|
||||
if (!$node instanceof Calendar) {
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@ class ReminderService {
|
|||
private function writeRemindersToDatabase(array $reminders): void {
|
||||
$uniqueReminders = [];
|
||||
foreach ($reminders as $reminder) {
|
||||
$key = $reminder['notification_date']. $reminder['event_hash'].$reminder['type'];
|
||||
$key = $reminder['notification_date'] . $reminder['event_hash'] . $reminder['type'];
|
||||
if (!isset($uniqueReminders[$key])) {
|
||||
$uniqueReminders[$key] = $reminder;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ use Psr\Log\LoggerInterface;
|
|||
|
||||
class Backend extends SharingBackend {
|
||||
|
||||
public function __construct(private IUserManager $userManager,
|
||||
public function __construct(
|
||||
private IUserManager $userManager,
|
||||
private IGroupManager $groupManager,
|
||||
private Principal $principalBackend,
|
||||
private ICacheFactory $cacheFactory,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ use OCA\DAV\DAV\Sharing\SharingService;
|
|||
|
||||
class Service extends SharingService {
|
||||
protected string $resourceType = 'calendar';
|
||||
public function __construct(protected SharingMapper $mapper) {
|
||||
public function __construct(
|
||||
protected SharingMapper $mapper,
|
||||
) {
|
||||
parent::__construct($mapper);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,13 +27,15 @@ use Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp;
|
|||
|
||||
class StatusService {
|
||||
private ICache $cache;
|
||||
public function __construct(private ITimeFactory $timeFactory,
|
||||
public function __construct(
|
||||
private ITimeFactory $timeFactory,
|
||||
private IManager $calendarManager,
|
||||
private IUserManager $userManager,
|
||||
private UserStatusService $userStatusService,
|
||||
private IAvailabilityCoordinator $availabilityCoordinator,
|
||||
private ICacheFactory $cacheFactory,
|
||||
private LoggerInterface $logger) {
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
$this->cache = $cacheFactory->createLocal('CalendarStatusService');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,11 @@ use function array_reduce;
|
|||
|
||||
class TimezoneService {
|
||||
|
||||
public function __construct(private IConfig $config,
|
||||
public function __construct(
|
||||
private IConfig $config,
|
||||
private PropertyMapper $propertyMapper,
|
||||
private IManager $calendarManager) {
|
||||
private IManager $calendarManager,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getUserTimezone(string $userId): ?string {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class DeletedCalendarObject implements IACL, ICalendarObject, IRestorable {
|
|||
public function getContentType() {
|
||||
$mime = 'text/calendar; charset=utf-8';
|
||||
if (isset($this->objectData['component']) && $this->objectData['component']) {
|
||||
$mime .= '; component='.$this->objectData['component'];
|
||||
$mime .= '; component=' . $this->objectData['component'];
|
||||
}
|
||||
|
||||
return $mime;
|
||||
|
|
|
|||
|
|
@ -13,13 +13,15 @@ use JsonSerializable;
|
|||
use OCA\DAV\ResponseDefinitions;
|
||||
|
||||
class UpcomingEvent implements JsonSerializable {
|
||||
public function __construct(private string $uri,
|
||||
public function __construct(
|
||||
private string $uri,
|
||||
private ?int $recurrenceId,
|
||||
private string $calendarUri,
|
||||
private ?int $start,
|
||||
private ?string $summary,
|
||||
private ?string $location,
|
||||
private ?string $calendarAppUrl) {
|
||||
private ?string $calendarAppUrl,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getUri(): string {
|
||||
|
|
|
|||
|
|
@ -17,11 +17,13 @@ use OCP\IUserManager;
|
|||
use function array_map;
|
||||
|
||||
class UpcomingEventsService {
|
||||
public function __construct(private IManager $calendarManager,
|
||||
public function __construct(
|
||||
private IManager $calendarManager,
|
||||
private ITimeFactory $timeFactory,
|
||||
private IUserManager $userManager,
|
||||
private IAppManager $appManager,
|
||||
private IURLGenerator $urlGenerator) {
|
||||
private IURLGenerator $urlGenerator,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use Sabre\HTTP\ResponseInterface;
|
|||
class CalDavValidatePlugin extends ServerPlugin {
|
||||
|
||||
public function __construct(
|
||||
private IAppConfig $config
|
||||
private IAppConfig $config,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,11 @@ use Sabre\DAV\Xml\Property\Href;
|
|||
use Sabre\VObject\Reader;
|
||||
|
||||
class Connection {
|
||||
public function __construct(private IClientService $clientService,
|
||||
public function __construct(
|
||||
private IClientService $clientService,
|
||||
private IAppConfig $config,
|
||||
private LoggerInterface $logger) {
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -30,10 +30,12 @@ class RefreshWebcalService {
|
|||
public const STRIP_ATTACHMENTS = '{http://calendarserver.org/ns/}subscribed-strip-attachments';
|
||||
public const STRIP_TODOS = '{http://calendarserver.org/ns/}subscribed-strip-todos';
|
||||
|
||||
public function __construct(private CalDavBackend $calDavBackend,
|
||||
public function __construct(
|
||||
private CalDavBackend $calDavBackend,
|
||||
private LoggerInterface $logger,
|
||||
private Connection $connection,
|
||||
private ITimeFactory $time) {
|
||||
private ITimeFactory $time,
|
||||
) {
|
||||
}
|
||||
|
||||
public function refreshSubscription(string $principalUri, string $uri) {
|
||||
|
|
|
|||
|
|
@ -25,12 +25,14 @@ use function explode;
|
|||
class CardDavRateLimitingPlugin extends ServerPlugin {
|
||||
private ?string $userId;
|
||||
|
||||
public function __construct(private Limiter $limiter,
|
||||
public function __construct(
|
||||
private Limiter $limiter,
|
||||
private IUserManager $userManager,
|
||||
private CardDavBackend $cardDavBackend,
|
||||
private LoggerInterface $logger,
|
||||
private IAppConfig $config,
|
||||
?string $userId) {
|
||||
?string $userId,
|
||||
) {
|
||||
$this->limiter = $limiter;
|
||||
$this->userManager = $userManager;
|
||||
$this->cardDavBackend = $cardDavBackend;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ use OCP\IUserManager;
|
|||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class Backend extends SharingBackend {
|
||||
public function __construct(private IUserManager $userManager,
|
||||
public function __construct(
|
||||
private IUserManager $userManager,
|
||||
private IGroupManager $groupManager,
|
||||
private Principal $principalBackend,
|
||||
private ICacheFactory $cacheFactory,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ use OCA\DAV\DAV\Sharing\SharingService;
|
|||
|
||||
class Service extends SharingService {
|
||||
protected string $resourceType = 'addressbook';
|
||||
public function __construct(protected SharingMapper $mapper) {
|
||||
public function __construct(
|
||||
protected SharingMapper $mapper,
|
||||
) {
|
||||
parent::__construct($mapper);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use Sabre\HTTP\ResponseInterface;
|
|||
class CardDavValidatePlugin extends ServerPlugin {
|
||||
|
||||
public function __construct(
|
||||
private IAppConfig $config
|
||||
private IAppConfig $config,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class DeleteCalendar extends Command {
|
|||
|
||||
protected function execute(
|
||||
InputInterface $input,
|
||||
OutputInterface $output
|
||||
OutputInterface $output,
|
||||
): int {
|
||||
/** @var string $user */
|
||||
$user = $input->getArgument('uid');
|
||||
|
|
|
|||
|
|
@ -20,8 +20,10 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||
|
||||
class FixCalendarSyncCommand extends Command {
|
||||
|
||||
public function __construct(private IUserManager $userManager,
|
||||
private CalDavBackend $calDavBackend) {
|
||||
public function __construct(
|
||||
private IUserManager $userManager,
|
||||
private CalDavBackend $calDavBackend,
|
||||
) {
|
||||
parent::__construct('dav:fix-missing-caldav-changes');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties {
|
|||
IComment $comment,
|
||||
IUserManager $userManager,
|
||||
IUserSession $userSession,
|
||||
LoggerInterface $logger
|
||||
LoggerInterface $logger,
|
||||
) {
|
||||
$this->commentsManager = $commentsManager;
|
||||
$this->comment = $comment;
|
||||
|
|
@ -69,7 +69,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties {
|
|||
if ($getter === 'getMentions') {
|
||||
continue; // special treatment
|
||||
}
|
||||
$name = '{'.self::NS_OWNCLOUD.'}' . lcfirst(substr($getter, 3));
|
||||
$name = '{' . self::NS_OWNCLOUD . '}' . lcfirst(substr($getter, 3));
|
||||
$this->properties[$name] = $getter;
|
||||
}
|
||||
$this->userManager = $userManager;
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ class CommentsPlugin extends ServerPlugin {
|
|||
}
|
||||
}
|
||||
if (is_null($actorId)) {
|
||||
throw new BadRequest('Invalid actor "' . $actorType .'"');
|
||||
throw new BadRequest('Invalid actor "' . $actorType . '"');
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class EntityCollection extends RootCollection implements IProperties {
|
|||
ICommentsManager $commentsManager,
|
||||
IUserManager $userManager,
|
||||
IUserSession $userSession,
|
||||
LoggerInterface $logger
|
||||
LoggerInterface $logger,
|
||||
) {
|
||||
foreach (['id', 'name'] as $property) {
|
||||
$$property = trim($$property);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class EntityTypeCollection extends RootCollection {
|
|||
IUserManager $userManager,
|
||||
IUserSession $userSession,
|
||||
LoggerInterface $logger,
|
||||
\Closure $childExistsFunction
|
||||
\Closure $childExistsFunction,
|
||||
) {
|
||||
$name = trim($name);
|
||||
if (empty($name)) {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class CommentPropertiesPlugin extends ServerPlugin {
|
|||
*/
|
||||
public function handleGetProperties(
|
||||
PropFind $propFind,
|
||||
\Sabre\DAV\INode $node
|
||||
\Sabre\DAV\INode $node,
|
||||
) {
|
||||
if (!($node instanceof File) && !($node instanceof Directory)) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class FilesReportPlugin extends ServerPlugin {
|
|||
IUserSession $userSession,
|
||||
IGroupManager $groupManager,
|
||||
Folder $userFolder,
|
||||
IAppManager $appManager
|
||||
IAppManager $appManager,
|
||||
) {
|
||||
$this->tree = $tree;
|
||||
$this->fileView = $view;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ abstract class Node implements \Sabre\DAV\INode {
|
|||
protected function refreshInfo(): void {
|
||||
$info = $this->fileView->getFileInfo($this->path);
|
||||
if ($info === false) {
|
||||
throw new \Sabre\DAV\Exception('Failed to get fileinfo for '. $this->path);
|
||||
throw new \Sabre\DAV\Exception('Failed to get fileinfo for ' . $this->path);
|
||||
}
|
||||
$this->info = $info;
|
||||
$root = \OC::$server->get(IRootFolder::class);
|
||||
|
|
@ -131,7 +131,7 @@ abstract class Node implements \Sabre\DAV\INode {
|
|||
$this->verifyPath($newPath);
|
||||
|
||||
if (!$this->fileView->rename($this->path, $newPath)) {
|
||||
throw new \Sabre\DAV\Exception('Failed to rename '. $this->path . ' to ' . $newPath);
|
||||
throw new \Sabre\DAV\Exception('Failed to rename ' . $this->path . ' to ' . $newPath);
|
||||
}
|
||||
|
||||
$this->path = $newPath;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class ServerFactory {
|
|||
IRequest $request,
|
||||
IPreview $previewManager,
|
||||
IEventDispatcher $eventDispatcher,
|
||||
IL10N $l10n
|
||||
IL10N $l10n,
|
||||
) {
|
||||
$this->config = $config;
|
||||
$this->logger = $logger;
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin {
|
|||
*/
|
||||
public function handleGetProperties(
|
||||
PropFind $propFind,
|
||||
\Sabre\DAV\INode $sabreNode
|
||||
\Sabre\DAV\INode $sabreNode,
|
||||
) {
|
||||
if (!($sabreNode instanceof DavNode)) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin {
|
|||
*/
|
||||
public function handleGetProperties(
|
||||
PropFind $propFind,
|
||||
\Sabre\DAV\INode $node
|
||||
\Sabre\DAV\INode $node,
|
||||
) {
|
||||
if (!($node instanceof \OCA\DAV\Connector\Sabre\Node)) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class DirectController extends OCSController {
|
|||
|
||||
$this->mapper->insert($direct);
|
||||
|
||||
$url = $this->urlGenerator->getAbsoluteURL('remote.php/direct/'.$token);
|
||||
$url = $this->urlGenerator->getAbsoluteURL('remote.php/direct/' . $token);
|
||||
|
||||
return new DataResponse([
|
||||
'url' => $url,
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class OutOfOfficeController extends OCSController {
|
|||
string $status,
|
||||
string $message,
|
||||
?string $replacementUserId,
|
||||
?string $replacementUserDisplayName
|
||||
?string $replacementUserDisplayName,
|
||||
|
||||
): DataResponse {
|
||||
$user = $this->userSession?->getUser();
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class GroupPrincipalBackend implements BackendInterface {
|
|||
IGroupManager $IGroupManager,
|
||||
IUserSession $userSession,
|
||||
IShareManager $shareManager,
|
||||
IConfig $config
|
||||
IConfig $config,
|
||||
) {
|
||||
$this->groupManager = $IGroupManager;
|
||||
$this->userSession = $userSession;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ abstract class Backend {
|
|||
|
||||
private ICache $shareCache;
|
||||
|
||||
public function __construct(private IUserManager $userManager,
|
||||
public function __construct(
|
||||
private IUserManager $userManager,
|
||||
private IGroupManager $groupManager,
|
||||
private Principal $principalBackend,
|
||||
private ICacheFactory $cacheFactory,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@ use OCP\DB\QueryBuilder\IQueryBuilder;
|
|||
use OCP\IDBConnection;
|
||||
|
||||
class SharingMapper {
|
||||
public function __construct(private IDBConnection $db) {
|
||||
public function __construct(
|
||||
private IDBConnection $db,
|
||||
) {
|
||||
}
|
||||
|
||||
protected function getSharesForIdByAccess(int $resourceId, string $resourceType, bool $sharesWithAccess): array {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ namespace OCA\DAV\DAV\Sharing;
|
|||
|
||||
abstract class SharingService {
|
||||
protected string $resourceType = '';
|
||||
public function __construct(protected SharingMapper $mapper) {
|
||||
public function __construct(
|
||||
protected SharingMapper $mapper,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getResourceType(): string {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class ShareRequest implements XmlDeserializable {
|
|||
|
||||
public static function xmlDeserialize(Reader $reader) {
|
||||
$elements = $reader->parseInnerTree([
|
||||
'{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue',
|
||||
'{' . Plugin::NS_OWNCLOUD . '}set' => 'Sabre\\Xml\\Element\\KeyValue',
|
||||
'{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue',
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class DirectHome implements ICollection {
|
|||
ITimeFactory $timeFactory,
|
||||
IThrottler $throttler,
|
||||
IRequest $request,
|
||||
IEventDispatcher $eventDispatcher
|
||||
IEventDispatcher $eventDispatcher,
|
||||
) {
|
||||
$this->rootFolder = $rootFolder;
|
||||
$this->mapper = $mapper;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class OutOfOfficeListener implements IEventListener {
|
|||
private ServerFactory $serverFactory,
|
||||
private IConfig $appConfig,
|
||||
private TimezoneService $timezoneService,
|
||||
private LoggerInterface $logger
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class BuildCalendarSearchIndexBackgroundJob extends QueuedJob {
|
|||
private CalDavBackend $calDavBackend,
|
||||
private LoggerInterface $logger,
|
||||
private IJobList $jobList,
|
||||
ITimeFactory $timeFactory
|
||||
ITimeFactory $timeFactory,
|
||||
) {
|
||||
parent::__construct($timeFactory);
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ class BuildCalendarSearchIndexBackgroundJob extends QueuedJob {
|
|||
$offset = (int)$arguments['offset'];
|
||||
$stopAt = (int)$arguments['stopAt'];
|
||||
|
||||
$this->logger->info('Building calendar index (' . $offset .'/' . $stopAt . ')');
|
||||
$this->logger->info('Building calendar index (' . $offset . '/' . $stopAt . ')');
|
||||
|
||||
$startTime = $this->time->getTime();
|
||||
while (($this->time->getTime() - $startTime) < 15) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class BuildSocialSearchIndexBackgroundJob extends QueuedJob {
|
|||
$offset = $arguments['offset'];
|
||||
$stopAt = $arguments['stopAt'];
|
||||
|
||||
$this->logger->info('Indexing social profile data (' . $offset .'/' . $stopAt . ')');
|
||||
$this->logger->info('Indexing social profile data (' . $offset . '/' . $stopAt . ')');
|
||||
|
||||
$offset = $this->buildIndex($offset, $stopAt);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,10 @@ use OCP\Migration\IOutput;
|
|||
use OCP\Migration\IRepairStep;
|
||||
|
||||
class DeleteSchedulingObjects implements IRepairStep {
|
||||
public function __construct(private IJobList $jobList,
|
||||
public function __construct(
|
||||
private IJobList $jobList,
|
||||
private ITimeFactory $time,
|
||||
private CalDavBackend $calDavBackend
|
||||
private CalDavBackend $calDavBackend,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,12 @@ use Psr\Log\LoggerInterface;
|
|||
use Throwable;
|
||||
|
||||
class Version1027Date20230504122946 extends SimpleMigrationStep {
|
||||
public function __construct(private SyncService $syncService,
|
||||
public function __construct(
|
||||
private SyncService $syncService,
|
||||
private LoggerInterface $logger,
|
||||
private IUserManager $userManager,
|
||||
private IConfig $config) {
|
||||
private IConfig $config,
|
||||
) {
|
||||
}
|
||||
/**
|
||||
* @param IOutput $output
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class AppleProvisioningPlugin extends ServerPlugin {
|
|||
\OC_Defaults $themingDefaults,
|
||||
IRequest $request,
|
||||
IL10N $l10n,
|
||||
\Closure $uuidClosure
|
||||
\Closure $uuidClosure,
|
||||
) {
|
||||
$this->userSession = $userSession;
|
||||
$this->urlGenerator = $urlGenerator;
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ class EventsSearchProvider extends ACalendarSearchProvider implements IFiltering
|
|||
protected function getDavUrlForCalendarObject(
|
||||
string $principalUri,
|
||||
string $calendarUri,
|
||||
string $calendarObjectUri
|
||||
string $calendarObjectUri,
|
||||
): string {
|
||||
[,, $principalId] = explode('/', $principalUri, 3);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,12 +24,14 @@ class AvailabilitySettings implements ISettings {
|
|||
protected IInitialState $initialState;
|
||||
protected ?string $userId;
|
||||
|
||||
public function __construct(IConfig $config,
|
||||
public function __construct(
|
||||
IConfig $config,
|
||||
IInitialState $initialState,
|
||||
?string $userId,
|
||||
private LoggerInterface $logger,
|
||||
private IAvailabilityCoordinator $coordinator,
|
||||
private AbsenceMapper $absenceMapper) {
|
||||
private AbsenceMapper $absenceMapper,
|
||||
) {
|
||||
$this->config = $config;
|
||||
$this->initialState = $initialState;
|
||||
$this->userId = $userId;
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin {
|
|||
*/
|
||||
public function handleGetProperties(
|
||||
PropFind $propFind,
|
||||
\Sabre\DAV\INode $node
|
||||
\Sabre\DAV\INode $node,
|
||||
) {
|
||||
if ($node instanceof Node) {
|
||||
$this->propfindForFile($propFind, $node);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class SystemTagsByIdCollection implements ICollection {
|
|||
public function __construct(
|
||||
ISystemTagManager $tagManager,
|
||||
IUserSession $userSession,
|
||||
IGroupManager $groupManager
|
||||
IGroupManager $groupManager,
|
||||
) {
|
||||
$this->tagManager = $tagManager;
|
||||
$this->userSession = $userSession;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class SystemTagsInUseCollection extends SimpleCollection {
|
|||
IRootFolder $rootFolder,
|
||||
ISystemTagManager $systemTagManager,
|
||||
SystemTagsInFilesDetector $systemTagsInFilesDetector,
|
||||
string $mediaType = ''
|
||||
string $mediaType = '',
|
||||
) {
|
||||
$this->userSession = $userSession;
|
||||
$this->rootFolder = $rootFolder;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class CalendarMigrator implements IMigrator, ISizeEstimationMigrator {
|
|||
ICalendarManager $calendarManager,
|
||||
ICSExportPlugin $icsExportPlugin,
|
||||
Defaults $defaults,
|
||||
IL10N $l10n
|
||||
IL10N $l10n,
|
||||
) {
|
||||
$this->calDavBackend = $calDavBackend;
|
||||
$this->calendarManager = $calendarManager;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator {
|
|||
|
||||
public function __construct(
|
||||
CardDavBackend $cardDavBackend,
|
||||
IL10N $l10n
|
||||
IL10N $l10n,
|
||||
) {
|
||||
$this->cardDavBackend = $cardDavBackend;
|
||||
$this->l10n = $l10n;
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ class PluginTest extends TestCase {
|
|||
|
||||
$this->server->expects($this->once())
|
||||
->method('getPropertiesForPath')
|
||||
->with($calendarHome .'/' . $calendarUri, [], 1)
|
||||
->with($calendarHome . '/' . $calendarUri, [], 1)
|
||||
->willReturn($properties);
|
||||
|
||||
$this->plugin->propFindDefaultCalendarUrl($propFind, $node);
|
||||
|
|
@ -392,7 +392,7 @@ class PluginTest extends TestCase {
|
|||
|
||||
/** @var LocalHref $result */
|
||||
$result = $propFind->get(Plugin::SCHEDULE_DEFAULT_CALENDAR_URL);
|
||||
$this->assertEquals('/remote.php/dav/'. $calendarHome . '/' . $calendarUri, $result->getHref());
|
||||
$this->assertEquals('/remote.php/dav/' . $calendarHome . '/' . $calendarUri, $result->getHref());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -72,35 +72,35 @@ class CardDavBackendTest extends TestCase {
|
|||
public const UNIT_TEST_USER1 = 'principals/users/carddav-unit-test1';
|
||||
public const UNIT_TEST_GROUP = 'principals/groups/carddav-unit-test-group';
|
||||
|
||||
private $vcardTest0 = 'BEGIN:VCARD'.PHP_EOL.
|
||||
'VERSION:3.0'.PHP_EOL.
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL.
|
||||
'UID:Test'.PHP_EOL.
|
||||
'FN:Test'.PHP_EOL.
|
||||
'N:Test;;;;'.PHP_EOL.
|
||||
private $vcardTest0 = 'BEGIN:VCARD' . PHP_EOL .
|
||||
'VERSION:3.0' . PHP_EOL .
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL .
|
||||
'UID:Test' . PHP_EOL .
|
||||
'FN:Test' . PHP_EOL .
|
||||
'N:Test;;;;' . PHP_EOL .
|
||||
'END:VCARD';
|
||||
|
||||
private $vcardTest1 = 'BEGIN:VCARD'.PHP_EOL.
|
||||
'VERSION:3.0'.PHP_EOL.
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL.
|
||||
'UID:Test2'.PHP_EOL.
|
||||
'FN:Test2'.PHP_EOL.
|
||||
'N:Test2;;;;'.PHP_EOL.
|
||||
private $vcardTest1 = 'BEGIN:VCARD' . PHP_EOL .
|
||||
'VERSION:3.0' . PHP_EOL .
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL .
|
||||
'UID:Test2' . PHP_EOL .
|
||||
'FN:Test2' . PHP_EOL .
|
||||
'N:Test2;;;;' . PHP_EOL .
|
||||
'END:VCARD';
|
||||
|
||||
private $vcardTest2 = 'BEGIN:VCARD'.PHP_EOL.
|
||||
'VERSION:3.0'.PHP_EOL.
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL.
|
||||
'UID:Test3'.PHP_EOL.
|
||||
'FN:Test3'.PHP_EOL.
|
||||
'N:Test3;;;;'.PHP_EOL.
|
||||
private $vcardTest2 = 'BEGIN:VCARD' . PHP_EOL .
|
||||
'VERSION:3.0' . PHP_EOL .
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL .
|
||||
'UID:Test3' . PHP_EOL .
|
||||
'FN:Test3' . PHP_EOL .
|
||||
'N:Test3;;;;' . PHP_EOL .
|
||||
'END:VCARD';
|
||||
|
||||
private $vcardTestNoUID = 'BEGIN:VCARD'.PHP_EOL.
|
||||
'VERSION:3.0'.PHP_EOL.
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL.
|
||||
'FN:TestNoUID'.PHP_EOL.
|
||||
'N:TestNoUID;;;;'.PHP_EOL.
|
||||
private $vcardTestNoUID = 'BEGIN:VCARD' . PHP_EOL .
|
||||
'VERSION:3.0' . PHP_EOL .
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL .
|
||||
'FN:TestNoUID' . PHP_EOL .
|
||||
'N:TestNoUID;;;;' . PHP_EOL .
|
||||
'END:VCARD';
|
||||
|
||||
protected function setUp(): void {
|
||||
|
|
@ -332,7 +332,7 @@ class CardDavBackendTest extends TestCase {
|
|||
$this->assertArrayHasKey('lastmodified', $card);
|
||||
$this->assertArrayHasKey('etag', $card);
|
||||
$this->assertArrayHasKey('size', $card);
|
||||
$this->assertEquals($this->{ 'vcardTest'.($index + 1) }, $card['carddata']);
|
||||
$this->assertEquals($this->{ 'vcardTest' . ($index + 1) }, $card['carddata']);
|
||||
}
|
||||
|
||||
// delete the card
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class DeleteCalendarTest extends TestCase {
|
|||
public function testInvalidCalendar(): void {
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage(
|
||||
'User <' . self::USER . '> has no calendar named <' . self::NAME . '>.');
|
||||
'User <' . self::USER . '> has no calendar named <' . self::NAME . '>.');
|
||||
|
||||
$this->userManager->expects($this->once())
|
||||
->method('userExists')
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class ObjectTreeTest extends \Test\TestCase {
|
|||
$inputFileName,
|
||||
$fileInfoQueryPath,
|
||||
$outputFileName,
|
||||
$type
|
||||
$type,
|
||||
): void {
|
||||
$rootNode = $this->getMockBuilder(Directory::class)
|
||||
->disableOriginalConstructor()
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class DirectControllerTest extends TestCase {
|
|||
|
||||
$this->urlGenerator->method('getAbsoluteURL')
|
||||
->willReturnCallback(function (string $url) {
|
||||
return 'https://my.nextcloud/'.$url;
|
||||
return 'https://my.nextcloud/' . $url;
|
||||
});
|
||||
|
||||
$result = $this->controller->getUrl(101);
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ class GroupPrincipalTest extends \Test\TestCase {
|
|||
$fooGroup
|
||||
->expects($this->exactly(1))
|
||||
->method('getDisplayName')
|
||||
->willReturn('Group '.$gid);
|
||||
->willReturn('Group ' . $gid);
|
||||
return $fooGroup;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class MultipartRequestParserTest extends TestCase {
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$headers = array_merge(['Content-Type' => 'multipart/related; boundary='.$boundary], $headers);
|
||||
$headers = array_merge(['Content-Type' => 'multipart/related; boundary=' . $boundary], $headers);
|
||||
$request->expects($this->any())
|
||||
->method('getHeader')
|
||||
->willReturnCallback(function (string $key) use (&$headers) {
|
||||
|
|
@ -45,17 +45,17 @@ class MultipartRequestParserTest extends TestCase {
|
|||
|
||||
$body = '';
|
||||
foreach ($parts as $part) {
|
||||
$body .= '--'.$boundary."\r\n";
|
||||
$body .= '--' . $boundary . "\r\n";
|
||||
|
||||
foreach ($part['headers'] as $headerKey => $headerPart) {
|
||||
$body .= $headerKey.': '.$headerPart."\r\n";
|
||||
$body .= $headerKey . ': ' . $headerPart . "\r\n";
|
||||
}
|
||||
|
||||
$body .= "\r\n";
|
||||
$body .= $part['content']."\r\n";
|
||||
$body .= $part['content'] . "\r\n";
|
||||
}
|
||||
|
||||
$body .= '--'.$boundary.'--';
|
||||
$body .= '--' . $boundary . '--';
|
||||
|
||||
$stream = fopen('php://temp', 'r+');
|
||||
fwrite($stream, $body);
|
||||
|
|
|
|||
|
|
@ -37,22 +37,22 @@ class ContactsSearchProviderTest extends TestCase {
|
|||
/** @var ContactsSearchProvider */
|
||||
private $provider;
|
||||
|
||||
private $vcardTest0 = 'BEGIN:VCARD'.PHP_EOL.
|
||||
'VERSION:3.0'.PHP_EOL.
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL.
|
||||
'UID:Test'.PHP_EOL.
|
||||
'FN:FN of Test'.PHP_EOL.
|
||||
'N:Test;;;;'.PHP_EOL.
|
||||
'EMAIL:forrestgump@example.com'.PHP_EOL.
|
||||
private $vcardTest0 = 'BEGIN:VCARD' . PHP_EOL .
|
||||
'VERSION:3.0' . PHP_EOL .
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL .
|
||||
'UID:Test' . PHP_EOL .
|
||||
'FN:FN of Test' . PHP_EOL .
|
||||
'N:Test;;;;' . PHP_EOL .
|
||||
'EMAIL:forrestgump@example.com' . PHP_EOL .
|
||||
'END:VCARD';
|
||||
|
||||
private $vcardTest1 = 'BEGIN:VCARD'.PHP_EOL.
|
||||
'VERSION:3.0'.PHP_EOL.
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN'.PHP_EOL.
|
||||
'PHOTO;ENCODING=b;TYPE=image/jpeg:'.PHP_EOL.
|
||||
'UID:Test2'.PHP_EOL.
|
||||
'FN:FN of Test2'.PHP_EOL.
|
||||
'N:Test2;;;;'.PHP_EOL.
|
||||
private $vcardTest1 = 'BEGIN:VCARD' . PHP_EOL .
|
||||
'VERSION:3.0' . PHP_EOL .
|
||||
'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL .
|
||||
'PHOTO;ENCODING=b;TYPE=image/jpeg:' . PHP_EOL .
|
||||
'UID:Test2' . PHP_EOL .
|
||||
'FN:FN of Test2' . PHP_EOL .
|
||||
'N:Test2;;;;' . PHP_EOL .
|
||||
'END:VCARD';
|
||||
|
||||
protected function setUp(): void {
|
||||
|
|
|
|||
|
|
@ -38,183 +38,183 @@ class EventsSearchProviderTest extends TestCase {
|
|||
private $provider;
|
||||
|
||||
// NO SUMMARY
|
||||
private $vEvent0 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL.
|
||||
'CALSCALE:GREGORIAN'.PHP_EOL.
|
||||
'BEGIN:VEVENT'.PHP_EOL.
|
||||
'CREATED:20161004T144433Z'.PHP_EOL.
|
||||
'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL.
|
||||
'DTEND;VALUE=DATE:20161008'.PHP_EOL.
|
||||
'TRANSP:TRANSPARENT'.PHP_EOL.
|
||||
'DTSTART;VALUE=DATE:20161005'.PHP_EOL.
|
||||
'DTSTAMP:20161004T144437Z'.PHP_EOL.
|
||||
'SEQUENCE:0'.PHP_EOL.
|
||||
'END:VEVENT'.PHP_EOL.
|
||||
private $vEvent0 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL .
|
||||
'CALSCALE:GREGORIAN' . PHP_EOL .
|
||||
'BEGIN:VEVENT' . PHP_EOL .
|
||||
'CREATED:20161004T144433Z' . PHP_EOL .
|
||||
'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL .
|
||||
'DTEND;VALUE=DATE:20161008' . PHP_EOL .
|
||||
'TRANSP:TRANSPARENT' . PHP_EOL .
|
||||
'DTSTART;VALUE=DATE:20161005' . PHP_EOL .
|
||||
'DTSTAMP:20161004T144437Z' . PHP_EOL .
|
||||
'SEQUENCE:0' . PHP_EOL .
|
||||
'END:VEVENT' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
// TIMED SAME DAY
|
||||
private $vEvent1 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'PRODID:-//Tests//'.PHP_EOL.
|
||||
'CALSCALE:GREGORIAN'.PHP_EOL.
|
||||
'BEGIN:VTIMEZONE'.PHP_EOL.
|
||||
'TZID:Europe/Berlin'.PHP_EOL.
|
||||
'BEGIN:DAYLIGHT'.PHP_EOL.
|
||||
'TZOFFSETFROM:+0100'.PHP_EOL.
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU'.PHP_EOL.
|
||||
'DTSTART:19810329T020000'.PHP_EOL.
|
||||
'TZNAME:GMT+2'.PHP_EOL.
|
||||
'TZOFFSETTO:+0200'.PHP_EOL.
|
||||
'END:DAYLIGHT'.PHP_EOL.
|
||||
'BEGIN:STANDARD'.PHP_EOL.
|
||||
'TZOFFSETFROM:+0200'.PHP_EOL.
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU'.PHP_EOL.
|
||||
'DTSTART:19961027T030000'.PHP_EOL.
|
||||
'TZNAME:GMT+1'.PHP_EOL.
|
||||
'TZOFFSETTO:+0100'.PHP_EOL.
|
||||
'END:STANDARD'.PHP_EOL.
|
||||
'END:VTIMEZONE'.PHP_EOL.
|
||||
'BEGIN:VEVENT'.PHP_EOL.
|
||||
'CREATED:20160809T163629Z'.PHP_EOL.
|
||||
'UID:0AD16F58-01B3-463B-A215-FD09FC729A02'.PHP_EOL.
|
||||
'DTEND;TZID=Europe/Berlin:20160816T100000'.PHP_EOL.
|
||||
'TRANSP:OPAQUE'.PHP_EOL.
|
||||
'SUMMARY:Test Europe Berlin'.PHP_EOL.
|
||||
'DTSTART;TZID=Europe/Berlin:20160816T090000'.PHP_EOL.
|
||||
'DTSTAMP:20160809T163632Z'.PHP_EOL.
|
||||
'SEQUENCE:0'.PHP_EOL.
|
||||
'END:VEVENT'.PHP_EOL.
|
||||
private $vEvent1 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'PRODID:-//Tests//' . PHP_EOL .
|
||||
'CALSCALE:GREGORIAN' . PHP_EOL .
|
||||
'BEGIN:VTIMEZONE' . PHP_EOL .
|
||||
'TZID:Europe/Berlin' . PHP_EOL .
|
||||
'BEGIN:DAYLIGHT' . PHP_EOL .
|
||||
'TZOFFSETFROM:+0100' . PHP_EOL .
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU' . PHP_EOL .
|
||||
'DTSTART:19810329T020000' . PHP_EOL .
|
||||
'TZNAME:GMT+2' . PHP_EOL .
|
||||
'TZOFFSETTO:+0200' . PHP_EOL .
|
||||
'END:DAYLIGHT' . PHP_EOL .
|
||||
'BEGIN:STANDARD' . PHP_EOL .
|
||||
'TZOFFSETFROM:+0200' . PHP_EOL .
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU' . PHP_EOL .
|
||||
'DTSTART:19961027T030000' . PHP_EOL .
|
||||
'TZNAME:GMT+1' . PHP_EOL .
|
||||
'TZOFFSETTO:+0100' . PHP_EOL .
|
||||
'END:STANDARD' . PHP_EOL .
|
||||
'END:VTIMEZONE' . PHP_EOL .
|
||||
'BEGIN:VEVENT' . PHP_EOL .
|
||||
'CREATED:20160809T163629Z' . PHP_EOL .
|
||||
'UID:0AD16F58-01B3-463B-A215-FD09FC729A02' . PHP_EOL .
|
||||
'DTEND;TZID=Europe/Berlin:20160816T100000' . PHP_EOL .
|
||||
'TRANSP:OPAQUE' . PHP_EOL .
|
||||
'SUMMARY:Test Europe Berlin' . PHP_EOL .
|
||||
'DTSTART;TZID=Europe/Berlin:20160816T090000' . PHP_EOL .
|
||||
'DTSTAMP:20160809T163632Z' . PHP_EOL .
|
||||
'SEQUENCE:0' . PHP_EOL .
|
||||
'END:VEVENT' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
// TIMED DIFFERENT DAY
|
||||
private $vEvent2 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'PRODID:-//Tests//'.PHP_EOL.
|
||||
'CALSCALE:GREGORIAN'.PHP_EOL.
|
||||
'BEGIN:VTIMEZONE'.PHP_EOL.
|
||||
'TZID:Europe/Berlin'.PHP_EOL.
|
||||
'BEGIN:DAYLIGHT'.PHP_EOL.
|
||||
'TZOFFSETFROM:+0100'.PHP_EOL.
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU'.PHP_EOL.
|
||||
'DTSTART:19810329T020000'.PHP_EOL.
|
||||
'TZNAME:GMT+2'.PHP_EOL.
|
||||
'TZOFFSETTO:+0200'.PHP_EOL.
|
||||
'END:DAYLIGHT'.PHP_EOL.
|
||||
'BEGIN:STANDARD'.PHP_EOL.
|
||||
'TZOFFSETFROM:+0200'.PHP_EOL.
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU'.PHP_EOL.
|
||||
'DTSTART:19961027T030000'.PHP_EOL.
|
||||
'TZNAME:GMT+1'.PHP_EOL.
|
||||
'TZOFFSETTO:+0100'.PHP_EOL.
|
||||
'END:STANDARD'.PHP_EOL.
|
||||
'END:VTIMEZONE'.PHP_EOL.
|
||||
'BEGIN:VEVENT'.PHP_EOL.
|
||||
'CREATED:20160809T163629Z'.PHP_EOL.
|
||||
'UID:0AD16F58-01B3-463B-A215-FD09FC729A02'.PHP_EOL.
|
||||
'DTEND;TZID=Europe/Berlin:20160817T100000'.PHP_EOL.
|
||||
'TRANSP:OPAQUE'.PHP_EOL.
|
||||
'SUMMARY:Test Europe Berlin'.PHP_EOL.
|
||||
'DTSTART;TZID=Europe/Berlin:20160816T090000'.PHP_EOL.
|
||||
'DTSTAMP:20160809T163632Z'.PHP_EOL.
|
||||
'SEQUENCE:0'.PHP_EOL.
|
||||
'END:VEVENT'.PHP_EOL.
|
||||
private $vEvent2 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'PRODID:-//Tests//' . PHP_EOL .
|
||||
'CALSCALE:GREGORIAN' . PHP_EOL .
|
||||
'BEGIN:VTIMEZONE' . PHP_EOL .
|
||||
'TZID:Europe/Berlin' . PHP_EOL .
|
||||
'BEGIN:DAYLIGHT' . PHP_EOL .
|
||||
'TZOFFSETFROM:+0100' . PHP_EOL .
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU' . PHP_EOL .
|
||||
'DTSTART:19810329T020000' . PHP_EOL .
|
||||
'TZNAME:GMT+2' . PHP_EOL .
|
||||
'TZOFFSETTO:+0200' . PHP_EOL .
|
||||
'END:DAYLIGHT' . PHP_EOL .
|
||||
'BEGIN:STANDARD' . PHP_EOL .
|
||||
'TZOFFSETFROM:+0200' . PHP_EOL .
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU' . PHP_EOL .
|
||||
'DTSTART:19961027T030000' . PHP_EOL .
|
||||
'TZNAME:GMT+1' . PHP_EOL .
|
||||
'TZOFFSETTO:+0100' . PHP_EOL .
|
||||
'END:STANDARD' . PHP_EOL .
|
||||
'END:VTIMEZONE' . PHP_EOL .
|
||||
'BEGIN:VEVENT' . PHP_EOL .
|
||||
'CREATED:20160809T163629Z' . PHP_EOL .
|
||||
'UID:0AD16F58-01B3-463B-A215-FD09FC729A02' . PHP_EOL .
|
||||
'DTEND;TZID=Europe/Berlin:20160817T100000' . PHP_EOL .
|
||||
'TRANSP:OPAQUE' . PHP_EOL .
|
||||
'SUMMARY:Test Europe Berlin' . PHP_EOL .
|
||||
'DTSTART;TZID=Europe/Berlin:20160816T090000' . PHP_EOL .
|
||||
'DTSTAMP:20160809T163632Z' . PHP_EOL .
|
||||
'SEQUENCE:0' . PHP_EOL .
|
||||
'END:VEVENT' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
// ALL-DAY ONE-DAY
|
||||
private $vEvent3 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL.
|
||||
'CALSCALE:GREGORIAN'.PHP_EOL.
|
||||
'BEGIN:VEVENT'.PHP_EOL.
|
||||
'CREATED:20161004T144433Z'.PHP_EOL.
|
||||
'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL.
|
||||
'DTEND;VALUE=DATE:20161006'.PHP_EOL.
|
||||
'TRANSP:TRANSPARENT'.PHP_EOL.
|
||||
'DTSTART;VALUE=DATE:20161005'.PHP_EOL.
|
||||
'DTSTAMP:20161004T144437Z'.PHP_EOL.
|
||||
'SEQUENCE:0'.PHP_EOL.
|
||||
'END:VEVENT'.PHP_EOL.
|
||||
private $vEvent3 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL .
|
||||
'CALSCALE:GREGORIAN' . PHP_EOL .
|
||||
'BEGIN:VEVENT' . PHP_EOL .
|
||||
'CREATED:20161004T144433Z' . PHP_EOL .
|
||||
'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL .
|
||||
'DTEND;VALUE=DATE:20161006' . PHP_EOL .
|
||||
'TRANSP:TRANSPARENT' . PHP_EOL .
|
||||
'DTSTART;VALUE=DATE:20161005' . PHP_EOL .
|
||||
'DTSTAMP:20161004T144437Z' . PHP_EOL .
|
||||
'SEQUENCE:0' . PHP_EOL .
|
||||
'END:VEVENT' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
// ALL-DAY MULTIPLE DAYS
|
||||
private $vEvent4 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL.
|
||||
'CALSCALE:GREGORIAN'.PHP_EOL.
|
||||
'BEGIN:VEVENT'.PHP_EOL.
|
||||
'CREATED:20161004T144433Z'.PHP_EOL.
|
||||
'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL.
|
||||
'DTEND;VALUE=DATE:20161008'.PHP_EOL.
|
||||
'TRANSP:TRANSPARENT'.PHP_EOL.
|
||||
'DTSTART;VALUE=DATE:20161005'.PHP_EOL.
|
||||
'DTSTAMP:20161004T144437Z'.PHP_EOL.
|
||||
'SEQUENCE:0'.PHP_EOL.
|
||||
'END:VEVENT'.PHP_EOL.
|
||||
private $vEvent4 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL .
|
||||
'CALSCALE:GREGORIAN' . PHP_EOL .
|
||||
'BEGIN:VEVENT' . PHP_EOL .
|
||||
'CREATED:20161004T144433Z' . PHP_EOL .
|
||||
'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL .
|
||||
'DTEND;VALUE=DATE:20161008' . PHP_EOL .
|
||||
'TRANSP:TRANSPARENT' . PHP_EOL .
|
||||
'DTSTART;VALUE=DATE:20161005' . PHP_EOL .
|
||||
'DTSTAMP:20161004T144437Z' . PHP_EOL .
|
||||
'SEQUENCE:0' . PHP_EOL .
|
||||
'END:VEVENT' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
// DURATION
|
||||
private $vEvent5 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL.
|
||||
'CALSCALE:GREGORIAN'.PHP_EOL.
|
||||
'BEGIN:VEVENT'.PHP_EOL.
|
||||
'CREATED:20161004T144433Z'.PHP_EOL.
|
||||
'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL.
|
||||
'DURATION:P5D'.PHP_EOL.
|
||||
'TRANSP:TRANSPARENT'.PHP_EOL.
|
||||
'DTSTART;VALUE=DATE:20161005'.PHP_EOL.
|
||||
'DTSTAMP:20161004T144437Z'.PHP_EOL.
|
||||
'SEQUENCE:0'.PHP_EOL.
|
||||
'END:VEVENT'.PHP_EOL.
|
||||
private $vEvent5 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL .
|
||||
'CALSCALE:GREGORIAN' . PHP_EOL .
|
||||
'BEGIN:VEVENT' . PHP_EOL .
|
||||
'CREATED:20161004T144433Z' . PHP_EOL .
|
||||
'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL .
|
||||
'DURATION:P5D' . PHP_EOL .
|
||||
'TRANSP:TRANSPARENT' . PHP_EOL .
|
||||
'DTSTART;VALUE=DATE:20161005' . PHP_EOL .
|
||||
'DTSTAMP:20161004T144437Z' . PHP_EOL .
|
||||
'SEQUENCE:0' . PHP_EOL .
|
||||
'END:VEVENT' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
// NO DTEND - DATE
|
||||
private $vEvent6 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN'.PHP_EOL.
|
||||
'CALSCALE:GREGORIAN'.PHP_EOL.
|
||||
'BEGIN:VEVENT'.PHP_EOL.
|
||||
'CREATED:20161004T144433Z'.PHP_EOL.
|
||||
'UID:85560E76-1B0D-47E1-A735-21625767FCA4'.PHP_EOL.
|
||||
'TRANSP:TRANSPARENT'.PHP_EOL.
|
||||
'DTSTART;VALUE=DATE:20161005'.PHP_EOL.
|
||||
'DTSTAMP:20161004T144437Z'.PHP_EOL.
|
||||
'SEQUENCE:0'.PHP_EOL.
|
||||
'END:VEVENT'.PHP_EOL.
|
||||
private $vEvent6 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL .
|
||||
'CALSCALE:GREGORIAN' . PHP_EOL .
|
||||
'BEGIN:VEVENT' . PHP_EOL .
|
||||
'CREATED:20161004T144433Z' . PHP_EOL .
|
||||
'UID:85560E76-1B0D-47E1-A735-21625767FCA4' . PHP_EOL .
|
||||
'TRANSP:TRANSPARENT' . PHP_EOL .
|
||||
'DTSTART;VALUE=DATE:20161005' . PHP_EOL .
|
||||
'DTSTAMP:20161004T144437Z' . PHP_EOL .
|
||||
'SEQUENCE:0' . PHP_EOL .
|
||||
'END:VEVENT' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
// NO DTEND - DATE-TIME
|
||||
private $vEvent7 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'PRODID:-//Tests//'.PHP_EOL.
|
||||
'CALSCALE:GREGORIAN'.PHP_EOL.
|
||||
'BEGIN:VTIMEZONE'.PHP_EOL.
|
||||
'TZID:Europe/Berlin'.PHP_EOL.
|
||||
'BEGIN:DAYLIGHT'.PHP_EOL.
|
||||
'TZOFFSETFROM:+0100'.PHP_EOL.
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU'.PHP_EOL.
|
||||
'DTSTART:19810329T020000'.PHP_EOL.
|
||||
'TZNAME:GMT+2'.PHP_EOL.
|
||||
'TZOFFSETTO:+0200'.PHP_EOL.
|
||||
'END:DAYLIGHT'.PHP_EOL.
|
||||
'BEGIN:STANDARD'.PHP_EOL.
|
||||
'TZOFFSETFROM:+0200'.PHP_EOL.
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU'.PHP_EOL.
|
||||
'DTSTART:19961027T030000'.PHP_EOL.
|
||||
'TZNAME:GMT+1'.PHP_EOL.
|
||||
'TZOFFSETTO:+0100'.PHP_EOL.
|
||||
'END:STANDARD'.PHP_EOL.
|
||||
'END:VTIMEZONE'.PHP_EOL.
|
||||
'BEGIN:VEVENT'.PHP_EOL.
|
||||
'CREATED:20160809T163629Z'.PHP_EOL.
|
||||
'UID:0AD16F58-01B3-463B-A215-FD09FC729A02'.PHP_EOL.
|
||||
'TRANSP:OPAQUE'.PHP_EOL.
|
||||
'SUMMARY:Test Europe Berlin'.PHP_EOL.
|
||||
'DTSTART;TZID=Europe/Berlin:20160816T090000'.PHP_EOL.
|
||||
'DTSTAMP:20160809T163632Z'.PHP_EOL.
|
||||
'SEQUENCE:0'.PHP_EOL.
|
||||
'END:VEVENT'.PHP_EOL.
|
||||
private $vEvent7 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'PRODID:-//Tests//' . PHP_EOL .
|
||||
'CALSCALE:GREGORIAN' . PHP_EOL .
|
||||
'BEGIN:VTIMEZONE' . PHP_EOL .
|
||||
'TZID:Europe/Berlin' . PHP_EOL .
|
||||
'BEGIN:DAYLIGHT' . PHP_EOL .
|
||||
'TZOFFSETFROM:+0100' . PHP_EOL .
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU' . PHP_EOL .
|
||||
'DTSTART:19810329T020000' . PHP_EOL .
|
||||
'TZNAME:GMT+2' . PHP_EOL .
|
||||
'TZOFFSETTO:+0200' . PHP_EOL .
|
||||
'END:DAYLIGHT' . PHP_EOL .
|
||||
'BEGIN:STANDARD' . PHP_EOL .
|
||||
'TZOFFSETFROM:+0200' . PHP_EOL .
|
||||
'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU' . PHP_EOL .
|
||||
'DTSTART:19961027T030000' . PHP_EOL .
|
||||
'TZNAME:GMT+1' . PHP_EOL .
|
||||
'TZOFFSETTO:+0100' . PHP_EOL .
|
||||
'END:STANDARD' . PHP_EOL .
|
||||
'END:VTIMEZONE' . PHP_EOL .
|
||||
'BEGIN:VEVENT' . PHP_EOL .
|
||||
'CREATED:20160809T163629Z' . PHP_EOL .
|
||||
'UID:0AD16F58-01B3-463B-A215-FD09FC729A02' . PHP_EOL .
|
||||
'TRANSP:OPAQUE' . PHP_EOL .
|
||||
'SUMMARY:Test Europe Berlin' . PHP_EOL .
|
||||
'DTSTART;TZID=Europe/Berlin:20160816T090000' . PHP_EOL .
|
||||
'DTSTAMP:20160809T163632Z' . PHP_EOL .
|
||||
'SEQUENCE:0' . PHP_EOL .
|
||||
'END:VEVENT' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
protected function setUp(): void {
|
||||
|
|
|
|||
|
|
@ -38,67 +38,67 @@ class TasksSearchProviderTest extends TestCase {
|
|||
private $provider;
|
||||
|
||||
// NO DUE NOR COMPLETED NOR SUMMARY
|
||||
private $vTodo0 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'PRODID:TEST'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'BEGIN:VTODO'.PHP_EOL.
|
||||
'UID:20070313T123432Z-456553@example.com'.PHP_EOL.
|
||||
'DTSTAMP:20070313T123432Z'.PHP_EOL.
|
||||
'STATUS:NEEDS-ACTION'.PHP_EOL.
|
||||
'END:VTODO'.PHP_EOL.
|
||||
private $vTodo0 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'PRODID:TEST' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'BEGIN:VTODO' . PHP_EOL .
|
||||
'UID:20070313T123432Z-456553@example.com' . PHP_EOL .
|
||||
'DTSTAMP:20070313T123432Z' . PHP_EOL .
|
||||
'STATUS:NEEDS-ACTION' . PHP_EOL .
|
||||
'END:VTODO' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
// DUE AND COMPLETED
|
||||
private $vTodo1 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'PRODID:TEST'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'BEGIN:VTODO'.PHP_EOL.
|
||||
'UID:20070313T123432Z-456553@example.com'.PHP_EOL.
|
||||
'DTSTAMP:20070313T123432Z'.PHP_EOL.
|
||||
'COMPLETED:20070707T100000Z'.PHP_EOL.
|
||||
'DUE;VALUE=DATE:20070501'.PHP_EOL.
|
||||
'SUMMARY:Task title'.PHP_EOL.
|
||||
'STATUS:NEEDS-ACTION'.PHP_EOL.
|
||||
'END:VTODO'.PHP_EOL.
|
||||
private $vTodo1 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'PRODID:TEST' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'BEGIN:VTODO' . PHP_EOL .
|
||||
'UID:20070313T123432Z-456553@example.com' . PHP_EOL .
|
||||
'DTSTAMP:20070313T123432Z' . PHP_EOL .
|
||||
'COMPLETED:20070707T100000Z' . PHP_EOL .
|
||||
'DUE;VALUE=DATE:20070501' . PHP_EOL .
|
||||
'SUMMARY:Task title' . PHP_EOL .
|
||||
'STATUS:NEEDS-ACTION' . PHP_EOL .
|
||||
'END:VTODO' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
// COMPLETED ONLY
|
||||
private $vTodo2 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'PRODID:TEST'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'BEGIN:VTODO'.PHP_EOL.
|
||||
'UID:20070313T123432Z-456553@example.com'.PHP_EOL.
|
||||
'DTSTAMP:20070313T123432Z'.PHP_EOL.
|
||||
'COMPLETED:20070707T100000Z'.PHP_EOL.
|
||||
'SUMMARY:Task title'.PHP_EOL.
|
||||
'STATUS:NEEDS-ACTION'.PHP_EOL.
|
||||
'END:VTODO'.PHP_EOL.
|
||||
private $vTodo2 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'PRODID:TEST' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'BEGIN:VTODO' . PHP_EOL .
|
||||
'UID:20070313T123432Z-456553@example.com' . PHP_EOL .
|
||||
'DTSTAMP:20070313T123432Z' . PHP_EOL .
|
||||
'COMPLETED:20070707T100000Z' . PHP_EOL .
|
||||
'SUMMARY:Task title' . PHP_EOL .
|
||||
'STATUS:NEEDS-ACTION' . PHP_EOL .
|
||||
'END:VTODO' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
// DUE DATE
|
||||
private $vTodo3 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'PRODID:TEST'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'BEGIN:VTODO'.PHP_EOL.
|
||||
'UID:20070313T123432Z-456553@example.com'.PHP_EOL.
|
||||
'DTSTAMP:20070313T123432Z'.PHP_EOL.
|
||||
'DUE;VALUE=DATE:20070501'.PHP_EOL.
|
||||
'SUMMARY:Task title'.PHP_EOL.
|
||||
'STATUS:NEEDS-ACTION'.PHP_EOL.
|
||||
'END:VTODO'.PHP_EOL.
|
||||
private $vTodo3 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'PRODID:TEST' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'BEGIN:VTODO' . PHP_EOL .
|
||||
'UID:20070313T123432Z-456553@example.com' . PHP_EOL .
|
||||
'DTSTAMP:20070313T123432Z' . PHP_EOL .
|
||||
'DUE;VALUE=DATE:20070501' . PHP_EOL .
|
||||
'SUMMARY:Task title' . PHP_EOL .
|
||||
'STATUS:NEEDS-ACTION' . PHP_EOL .
|
||||
'END:VTODO' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
// DUE DATETIME
|
||||
private $vTodo4 = 'BEGIN:VCALENDAR'.PHP_EOL.
|
||||
'PRODID:TEST'.PHP_EOL.
|
||||
'VERSION:2.0'.PHP_EOL.
|
||||
'BEGIN:VTODO'.PHP_EOL.
|
||||
'UID:20070313T123432Z-456553@example.com'.PHP_EOL.
|
||||
'DTSTAMP:20070313T123432Z'.PHP_EOL.
|
||||
'DUE:20070709T130000Z'.PHP_EOL.
|
||||
'SUMMARY:Task title'.PHP_EOL.
|
||||
'STATUS:NEEDS-ACTION'.PHP_EOL.
|
||||
'END:VTODO'.PHP_EOL.
|
||||
private $vTodo4 = 'BEGIN:VCALENDAR' . PHP_EOL .
|
||||
'PRODID:TEST' . PHP_EOL .
|
||||
'VERSION:2.0' . PHP_EOL .
|
||||
'BEGIN:VTODO' . PHP_EOL .
|
||||
'UID:20070313T123432Z-456553@example.com' . PHP_EOL .
|
||||
'DTSTAMP:20070313T123432Z' . PHP_EOL .
|
||||
'DUE:20070709T130000Z' . PHP_EOL .
|
||||
'SUMMARY:Task title' . PHP_EOL .
|
||||
'STATUS:NEEDS-ACTION' . PHP_EOL .
|
||||
'END:VTODO' . PHP_EOL .
|
||||
'END:VCALENDAR';
|
||||
|
||||
protected function setUp(): void {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ if (!defined('PHPUNIT_RUN')) {
|
|||
define('PHPUNIT_RUN', 1);
|
||||
}
|
||||
|
||||
require_once __DIR__.'/../../../../lib/base.php';
|
||||
require_once __DIR__ . '/../../../../lib/base.php';
|
||||
|
||||
\OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,10 +114,10 @@ class DropLegacyFileKey extends Command {
|
|||
$copyResource = $this->rootView->fopen($target, 'r');
|
||||
$sourceResource = $this->rootView->fopen($source, 'w');
|
||||
if ($copyResource === false || $sourceResource === false) {
|
||||
throw new DecryptionFailedException('Failed to open '.$source.' or '.$target);
|
||||
throw new DecryptionFailedException('Failed to open ' . $source . ' or ' . $target);
|
||||
}
|
||||
if (stream_copy_to_stream($copyResource, $sourceResource) === false) {
|
||||
$output->writeln('<error>Failed to copy '.$target.' data into '.$source.'</error>');
|
||||
$output->writeln('<error>Failed to copy ' . $target . ' data into ' . $source . '</error>');
|
||||
$output->writeln('<error>Leaving both files in there to avoid data loss</error>');
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class SettingsController extends Controller {
|
|||
Crypt $crypt,
|
||||
Session $session,
|
||||
ISession $ocSession,
|
||||
Util $util
|
||||
Util $util,
|
||||
) {
|
||||
parent::__construct($AppName, $request);
|
||||
$this->l = $l10n;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class StatusController extends Controller {
|
|||
IRequest $request,
|
||||
IL10N $l10n,
|
||||
Session $session,
|
||||
IManager $encryptionManager
|
||||
IManager $encryptionManager,
|
||||
) {
|
||||
parent::__construct($AppName, $request);
|
||||
$this->l = $l10n;
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ class Crypt {
|
|||
$this->getCipher());
|
||||
|
||||
// Create a signature based on the key as well as the current version
|
||||
$sig = $this->createSignature($encryptedContent, $passPhrase.'_'.$version.'_'.$position);
|
||||
$sig = $this->createSignature($encryptedContent, $passPhrase . '_' . $version . '_' . $position);
|
||||
|
||||
// combine content to encrypt the IV identifier and actual IV
|
||||
$catFile = $this->concatIV($encryptedContent, $iv);
|
||||
|
|
@ -760,7 +760,7 @@ class Crypt {
|
|||
$result = (strlen($output) === strlen($data));
|
||||
}
|
||||
} else {
|
||||
throw new DecryptionFailedException('Unsupported cipher '.$cipher_algo);
|
||||
throw new DecryptionFailedException('Unsupported cipher ' . $cipher_algo);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
|
@ -807,7 +807,7 @@ class Crypt {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
throw new EncryptionFailedException('Unsupported cipher '.$cipher_algo);
|
||||
throw new EncryptionFailedException('Unsupported cipher ' . $cipher_algo);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class DecryptAll {
|
|||
KeyManager $keyManager,
|
||||
Crypt $crypt,
|
||||
Session $session,
|
||||
QuestionHelper $questionHelper
|
||||
QuestionHelper $questionHelper,
|
||||
) {
|
||||
$this->util = $util;
|
||||
$this->keyManager = $keyManager;
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class EncryptAll {
|
|||
IL10N $l,
|
||||
IFactory $l10nFactory,
|
||||
QuestionHelper $questionHelper,
|
||||
ISecureRandom $secureRandom
|
||||
ISecureRandom $secureRandom,
|
||||
) {
|
||||
$this->userSetup = $userSetup;
|
||||
$this->userManager = $userManager;
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ class KeyManager {
|
|||
*/
|
||||
public function setRecoveryKey($password, $keyPair) {
|
||||
// Save Public Key
|
||||
$this->keyStorage->setSystemUserKey($this->getRecoveryKeyId().
|
||||
$this->keyStorage->setSystemUserKey($this->getRecoveryKeyId() .
|
||||
'.' . $this->publicKeyId,
|
||||
$keyPair['publicKey'],
|
||||
Encryption::ID);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class Admin implements ISettings {
|
|||
private IUserSession $userSession,
|
||||
private IConfig $config,
|
||||
private IUserManager $userManager,
|
||||
private ISession $session
|
||||
private ISession $session,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ Fixed the file: \"/$this->userId/files/world.txt\" with version 4", $output);
|
|||
$cacheInfo = ['encryptedVersion' => 1, 'encrypted' => 1];
|
||||
$cache1->put($fileCache1->getPath(), $cacheInfo);
|
||||
|
||||
$absPath = $storage1->getSourcePath('').$fileInfo1->getInternalPath();
|
||||
$absPath = $storage1->getSourcePath('') . $fileInfo1->getInternalPath();
|
||||
|
||||
// create unencrypted file on disk, the version stays
|
||||
file_put_contents($absPath, 'hello contents');
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class AddressHandler {
|
|||
public function __construct(
|
||||
IURLGenerator $urlGenerator,
|
||||
IL10N $il10n,
|
||||
ICloudIdManager $cloudIdManager
|
||||
ICloudIdManager $cloudIdManager,
|
||||
) {
|
||||
$this->l = $il10n;
|
||||
$this->urlGenerator = $urlGenerator;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class RequestHandlerController extends OCSController {
|
|||
LoggerInterface $logger,
|
||||
ICloudFederationFactory $cloudFederationFactory,
|
||||
ICloudFederationProviderManager $cloudFederationProviderManager,
|
||||
IEventDispatcher $eventDispatcher
|
||||
IEventDispatcher $eventDispatcher,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Admin implements IDelegatedSettings {
|
|||
IConfig $globalScaleConfig,
|
||||
IL10N $l,
|
||||
IURLGenerator $urlGenerator,
|
||||
IInitialState $initialState
|
||||
IInitialState $initialState,
|
||||
) {
|
||||
$this->fedShareProvider = $fedShareProvider;
|
||||
$this->gsConfig = $globalScaleConfig;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Personal implements ISettings {
|
|||
IUserSession $userSession,
|
||||
Defaults $defaults,
|
||||
IInitialState $initialState,
|
||||
IURLGenerator $urlGenerator
|
||||
IURLGenerator $urlGenerator,
|
||||
) {
|
||||
$this->federatedShareProvider = $federatedShareProvider;
|
||||
$this->userSession = $userSession;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class MountPublicLinkControllerTest extends \Test\TestCase {
|
|||
$validToken,
|
||||
$createSuccessful,
|
||||
$expectedReturnData,
|
||||
$permissions
|
||||
$permissions,
|
||||
): void {
|
||||
$this->federatedShareProvider->expects($this->any())
|
||||
->method('isOutgoingServer2serverShareEnabled')
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class NotificationsTest extends \Test\TestCase {
|
|||
$instance->expects($this->any())->method('getTimestamp')->willReturn($timestamp);
|
||||
|
||||
$instance->expects($this->once())->method('tryHttpPostToShareEndpoint')
|
||||
->with($remote, '/'.$id.'/unshare', ['token' => $token, 'data1Key' => 'data1Value', 'remoteId' => $id], $action)
|
||||
->with($remote, '/' . $id . '/unshare', ['token' => $token, 'data1Key' => 'data1Value', 'remoteId' => $id], $action)
|
||||
->willReturn($httpRequestResult);
|
||||
|
||||
// only add background job on first try
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class GetSharedSecret extends Job {
|
|||
TrustedServers $trustedServers,
|
||||
LoggerInterface $logger,
|
||||
IDiscoveryService $ocsDiscoveryService,
|
||||
ITimeFactory $timeFactory
|
||||
ITimeFactory $timeFactory,
|
||||
) {
|
||||
parent::__construct($timeFactory);
|
||||
$this->logger = $logger;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class OCSAuthAPIController extends OCSController {
|
|||
DbHandler $dbHandler,
|
||||
LoggerInterface $logger,
|
||||
ITimeFactory $timeFactory,
|
||||
IThrottler $throttler
|
||||
IThrottler $throttler,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ class OCSAuthAPIController extends OCSController {
|
|||
$this->throttler->registerAttempt('federationSharedSecret', $this->request->getRemoteAddress());
|
||||
$expectedToken = $this->dbHandler->getToken($url);
|
||||
$this->logger->error(
|
||||
'remote server (' . $url . ') didn\'t send a valid token (got "' . $token . '" but expected "'. $expectedToken . '") while getting shared secret',
|
||||
'remote server (' . $url . ') didn\'t send a valid token (got "' . $token . '" but expected "' . $expectedToken . '") while getting shared secret',
|
||||
['app' => 'federation']
|
||||
);
|
||||
throw new OCSForbiddenException();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class SettingsController extends Controller {
|
|||
public function __construct(string $AppName,
|
||||
IRequest $request,
|
||||
IL10N $l10n,
|
||||
TrustedServers $trustedServers
|
||||
TrustedServers $trustedServers,
|
||||
) {
|
||||
parent::__construct($AppName, $request);
|
||||
$this->l = $l10n;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue