diff options
Diffstat (limited to 'apps/dav/lib')
24 files changed, 30 insertions, 30 deletions
diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php index daab7806e46..e4cc5fadf7c 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Calendar.php @@ -83,7 +83,7 @@ class Calendar extends Base { * @throws \InvalidArgumentException * @since 11.0.0 */ - public function parse($language, IEvent $event, IEvent $previousEvent = null) { + public function parse($language, IEvent $event, ?IEvent $previousEvent = null) { if ($event->getApp() !== 'dav' || $event->getType() !== 'calendar') { throw new \InvalidArgumentException(); } diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Event.php b/apps/dav/lib/CalDAV/Activity/Provider/Event.php index 13f0036b0b0..4dcb18fdb90 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Event.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Event.php @@ -121,7 +121,7 @@ class Event extends Base { * @throws \InvalidArgumentException * @since 11.0.0 */ - public function parse($language, IEvent $event, IEvent $previousEvent = null) { + public function parse($language, IEvent $event, ?IEvent $previousEvent = null) { if ($event->getApp() !== 'dav' || $event->getType() !== 'calendar_event') { throw new \InvalidArgumentException(); } diff --git a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php index e2ddb99a1af..0a8434b9595 100644 --- a/apps/dav/lib/CalDAV/Activity/Provider/Todo.php +++ b/apps/dav/lib/CalDAV/Activity/Provider/Todo.php @@ -36,7 +36,7 @@ class Todo extends Event { * @throws \InvalidArgumentException * @since 11.0.0 */ - public function parse($language, IEvent $event, IEvent $previousEvent = null) { + public function parse($language, IEvent $event, ?IEvent $previousEvent = null) { if ($event->getApp() !== 'dav' || $event->getType() !== 'calendar_todo') { throw new \InvalidArgumentException(); } diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index 5d1d55879ca..93344e33186 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -470,7 +470,7 @@ class BirthdayService { */ private function formatTitle(string $field, string $name, - int $year = null, + ?int $year = null, bool $supports4Byte = true):string { if ($supports4Byte) { switch ($field) { diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 3abb9d584c1..a6c00a59174 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -2169,7 +2169,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription ->andWhere($searchOr) ->andWhere($calendarObjectIdQuery->expr()->isNull('deleted_at')); - if ('' !== $pattern) { + if ($pattern !== '') { if (!$escapePattern) { $calendarObjectIdQuery->andWhere($calendarObjectIdQuery->expr()->ilike('cob.value', $calendarObjectIdQuery->createNamedParameter($pattern))); } else { diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php index 9ededb8d015..9f4b55824e8 100644 --- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php +++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php @@ -392,8 +392,8 @@ class ReminderService { private function getRemindersForVAlarm(VAlarm $valarm, array $objectData, DateTimeZone $calendarTimeZone, - string $eventHash = null, - string $alarmHash = null, + ?string $eventHash = null, + ?string $alarmHash = null, bool $isRecurring = false, bool $isRecurrenceException = false):array { if ($eventHash === null) { diff --git a/apps/dav/lib/CalDAV/Schedule/Plugin.php b/apps/dav/lib/CalDAV/Schedule/Plugin.php index 2ccecc8131c..a1297fd2cf1 100644 --- a/apps/dav/lib/CalDAV/Schedule/Plugin.php +++ b/apps/dav/lib/CalDAV/Schedule/Plugin.php @@ -57,7 +57,7 @@ use Sabre\VObject\ITip\SameOrganizerForAllComponentsException; use Sabre\VObject\Parameter; use Sabre\VObject\Property; use Sabre\VObject\Reader; -use function \Sabre\Uri\split; +use function Sabre\Uri\split; class Plugin extends \Sabre\CalDAV\Schedule\Plugin { @@ -457,7 +457,7 @@ EOF; * @param Property|null $attendee * @return bool */ - private function getAttendeeRSVP(Property $attendee = null):bool { + private function getAttendeeRSVP(?Property $attendee = null):bool { if ($attendee !== null) { $rsvp = $attendee->offsetGet('RSVP'); if (($rsvp instanceof Parameter) && (strcasecmp($rsvp->getValue(), 'TRUE') === 0)) { diff --git a/apps/dav/lib/CalDAV/Status/StatusService.php b/apps/dav/lib/CalDAV/Status/StatusService.php index 9dccd4e77a3..29129a3b073 100644 --- a/apps/dav/lib/CalDAV/Status/StatusService.php +++ b/apps/dav/lib/CalDAV/Status/StatusService.php @@ -154,7 +154,7 @@ class StatusService { } $sct = $calendarObject->getSchedulingTransparency(); - if ($sct !== null && ScheduleCalendarTransp::TRANSPARENT == strtolower($sct->getValue())) { + if ($sct !== null && strtolower($sct->getValue()) == ScheduleCalendarTransp::TRANSPARENT) { // If a calendar is marked as 'transparent', it means we must // ignore it for free-busy purposes. continue; diff --git a/apps/dav/lib/CardDAV/Activity/Provider/Addressbook.php b/apps/dav/lib/CardDAV/Activity/Provider/Addressbook.php index a9ed767ffc7..a404dde4448 100644 --- a/apps/dav/lib/CardDAV/Activity/Provider/Addressbook.php +++ b/apps/dav/lib/CardDAV/Activity/Provider/Addressbook.php @@ -71,7 +71,7 @@ class Addressbook extends Base { * @return IEvent * @throws \InvalidArgumentException */ - public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent { + public function parse($language, IEvent $event, ?IEvent $previousEvent = null): IEvent { if ($event->getApp() !== 'dav' || $event->getType() !== 'contacts') { throw new \InvalidArgumentException(); } diff --git a/apps/dav/lib/CardDAV/Activity/Provider/Card.php b/apps/dav/lib/CardDAV/Activity/Provider/Card.php index 8f205942d4b..7f49a428cae 100644 --- a/apps/dav/lib/CardDAV/Activity/Provider/Card.php +++ b/apps/dav/lib/CardDAV/Activity/Provider/Card.php @@ -73,7 +73,7 @@ class Card extends Base { * @return IEvent * @throws \InvalidArgumentException */ - public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent { + public function parse($language, IEvent $event, ?IEvent $previousEvent = null): IEvent { if ($event->getApp() !== 'dav' || $event->getType() !== 'contacts') { throw new \InvalidArgumentException(); } diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index e9ffe6f25e9..f887e3b32b7 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -1151,7 +1151,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { ->andWhere($query2->expr()->in('cp.name', $query2->createNamedParameter($searchProperties, IQueryBuilder::PARAM_STR_ARRAY))); // No need for like when the pattern is empty - if ('' !== $pattern) { + if ($pattern !== '') { if (!$useWildcards) { $query2->andWhere($query2->expr()->eq('cp.value', $query2->createNamedParameter($pattern))); } elseif (!$escapePattern) { diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php index 66927d35e04..52c8192a2fb 100644 --- a/apps/dav/lib/CardDAV/SyncService.php +++ b/apps/dav/lib/CardDAV/SyncService.php @@ -271,7 +271,7 @@ class SyncService { return $this->localSystemAddressBook; } - public function syncInstance(\Closure $progressCallback = null) { + public function syncInstance(?\Closure $progressCallback = null) { $systemAddressBook = $this->getLocalSystemAddressBook(); $this->userManager->callForAllUsers(function ($user) use ($systemAddressBook, $progressCallback) { $this->updateUser($user); diff --git a/apps/dav/lib/Command/MoveCalendar.php b/apps/dav/lib/Command/MoveCalendar.php index a3045797ff4..7269a5ad4f3 100644 --- a/apps/dav/lib/Command/MoveCalendar.php +++ b/apps/dav/lib/Command/MoveCalendar.php @@ -93,7 +93,7 @@ class MoveCalendar extends Command { $calendar = $this->calDav->getCalendarByUri(self::URI_USERS . $userOrigin, $name); - if (null === $calendar) { + if ($calendar === null) { throw new \InvalidArgumentException("User <$userOrigin> has no calendar named <$name>. You can run occ dav:list-calendars to list calendars URIs for this user."); } @@ -133,7 +133,7 @@ class MoveCalendar extends Command { * Check if the calendar exists for user */ protected function calendarExists(string $userDestination, string $name): bool { - return null !== $this->calDav->getCalendarByUri(self::URI_USERS . $userDestination, $name); + return $this->calDav->getCalendarByUri(self::URI_USERS . $userDestination, $name) !== null; } /** @@ -172,7 +172,7 @@ class MoveCalendar extends Command { * Check that user destination is member of the groups which whom the calendar was shared * If we ask to force the migration, the share with the group is dropped */ - if ($this->shareManager->shareWithGroupMembersOnly() === true && 'groups' === $prefix && !$this->groupManager->isInGroup($userDestination, $userOrGroup)) { + if ($this->shareManager->shareWithGroupMembersOnly() === true && $prefix === 'groups' && !$this->groupManager->isInGroup($userDestination, $userOrGroup)) { if ($force) { $this->calDav->updateShares(new Calendar($this->calDav, $calendar, $this->l10n, $this->config, $this->logger), [], ['principal:principals/groups/' . $userOrGroup]); } else { diff --git a/apps/dav/lib/Comments/EntityCollection.php b/apps/dav/lib/Comments/EntityCollection.php index 2581ff0c367..1b6139a34a2 100644 --- a/apps/dav/lib/Comments/EntityCollection.php +++ b/apps/dav/lib/Comments/EntityCollection.php @@ -130,7 +130,7 @@ class EntityCollection extends RootCollection implements IProperties { * @param \DateTime|null $datetime * @return CommentNode[] */ - public function findChildren($limit = 0, $offset = 0, \DateTime $datetime = null) { + public function findChildren($limit = 0, $offset = 0, ?\DateTime $datetime = null) { $comments = $this->commentsManager->getForObject($this->name, $this->id, $limit, $offset, $datetime); $result = []; foreach ($comments as $comment) { diff --git a/apps/dav/lib/Connector/Sabre/CachingTree.php b/apps/dav/lib/Connector/Sabre/CachingTree.php index b1bccce3620..54038468dc5 100644 --- a/apps/dav/lib/Connector/Sabre/CachingTree.php +++ b/apps/dav/lib/Connector/Sabre/CachingTree.php @@ -46,7 +46,7 @@ class CachingTree extends Tree { $path = trim($path, '/'); foreach ($this->cache as $nodePath => $node) { $nodePath = (string) $nodePath; - if ('' === $path || $nodePath == $path || str_starts_with($nodePath, $path . '/')) { + if ($path === '' || $nodePath == $path || str_starts_with($nodePath, $path . '/')) { unset($this->cache[$nodePath]); } } diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index 441e6ea8f57..e40b8d760eb 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -72,7 +72,7 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICol /** * Sets up the node, expects a full path name */ - public function __construct(View $view, FileInfo $info, ?CachingTree $tree = null, IShareManager $shareManager = null) { + public function __construct(View $view, FileInfo $info, ?CachingTree $tree = null, ?IShareManager $shareManager = null) { parent::__construct($view, $info, $shareManager); $this->tree = $tree; } @@ -202,7 +202,7 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICol * @throws \Sabre\DAV\Exception\NotFound * @throws \Sabre\DAV\Exception\ServiceUnavailable */ - public function getChild($name, $info = null, IRequest $request = null, IL10N $l10n = null) { + public function getChild($name, $info = null, ?IRequest $request = null, ?IL10N $l10n = null) { if (!$this->info->isReadable()) { // avoid detecting files through this way throw new NotFound(); diff --git a/apps/dav/lib/Connector/Sabre/Exception/FileLocked.php b/apps/dav/lib/Connector/Sabre/Exception/FileLocked.php index 36063da8d65..ce51a90eb27 100644 --- a/apps/dav/lib/Connector/Sabre/Exception/FileLocked.php +++ b/apps/dav/lib/Connector/Sabre/Exception/FileLocked.php @@ -29,7 +29,7 @@ namespace OCA\DAV\Connector\Sabre\Exception; use Exception; class FileLocked extends \Sabre\DAV\Exception { - public function __construct($message = "", $code = 0, Exception $previous = null) { + public function __construct($message = "", $code = 0, ?Exception $previous = null) { if ($previous instanceof \OCP\Files\LockNotAcquiredException) { $message = sprintf('Target file %s is locked by another process.', $previous->path); } diff --git a/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php b/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php index a5eed911701..d71b837ade2 100644 --- a/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php +++ b/apps/dav/lib/Connector/Sabre/Exception/Forbidden.php @@ -35,7 +35,7 @@ class Forbidden extends \Sabre\DAV\Exception\Forbidden { * @param bool $retry * @param \Exception $previous */ - public function __construct($message, $retry = false, \Exception $previous = null) { + public function __construct($message, $retry = false, ?\Exception $previous = null) { parent::__construct($message, 0, $previous); $this->retry = $retry; } diff --git a/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php b/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php index 9d1fda339a2..a8ca0aea97d 100644 --- a/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php +++ b/apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php @@ -38,7 +38,7 @@ class InvalidPath extends Exception { * @param bool $retry * @param \Exception|null $previous */ - public function __construct($message, $retry = false, \Exception $previous = null) { + public function __construct($message, $retry = false, ?\Exception $previous = null) { parent::__construct($message, 0, $previous); $this->retry = $retry; } diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index f188490fd93..f54fbbdd15a 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -89,7 +89,7 @@ class File extends Node implements IFile { * @param ?IRequest $request * @param ?IL10N $l10n */ - public function __construct(View $view, FileInfo $info, IManager $shareManager = null, IRequest $request = null, IL10N $l10n = null) { + public function __construct(View $view, FileInfo $info, ?IManager $shareManager = null, ?IRequest $request = null, ?IL10N $l10n = null) { parent::__construct($view, $info, $shareManager); if ($l10n) { diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index cd692602df8..73057dd76d1 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -563,7 +563,7 @@ class FilesPlugin extends ServerPlugin { */ private function handleUpdatePropertiesMetadata(PropPatch $propPatch, Node $node): void { $userId = $this->userSession->getUser()?->getUID(); - if (null === $userId) { + if ($userId === null) { return; } @@ -667,7 +667,7 @@ class FilesPlugin extends ServerPlugin { * @param \Sabre\DAV\INode $node * @throws \Sabre\DAV\Exception\BadRequest */ - public function sendFileIdHeader($filePath, \Sabre\DAV\INode $node = null) { + public function sendFileIdHeader($filePath, ?\Sabre\DAV\INode $node = null) { // chunked upload handling if (isset($_SERVER['HTTP_OC_CHUNKED'])) { [$path, $name] = \Sabre\Uri\split($filePath); diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php index 5237064b46f..2b77dc08e8d 100644 --- a/apps/dav/lib/Connector/Sabre/Node.php +++ b/apps/dav/lib/Connector/Sabre/Node.php @@ -79,7 +79,7 @@ abstract class Node implements \Sabre\DAV\INode { /** * Sets up the node, expects a full path name */ - public function __construct(View $view, FileInfo $info, IManager $shareManager = null) { + public function __construct(View $view, FileInfo $info, ?IManager $shareManager = null) { $this->fileView = $view; $this->path = $this->fileView->getRelativePath($info->getPath()); $this->info = $info; diff --git a/apps/dav/lib/DAV/Sharing/Xml/Invite.php b/apps/dav/lib/DAV/Sharing/Xml/Invite.php index e6219f2bbfe..3c03dfa5d25 100644 --- a/apps/dav/lib/DAV/Sharing/Xml/Invite.php +++ b/apps/dav/lib/DAV/Sharing/Xml/Invite.php @@ -85,7 +85,7 @@ class Invite implements XmlSerializable { * * @param array $users */ - public function __construct(array $users, array $organizer = null) { + public function __construct(array $users, ?array $organizer = null) { $this->users = $users; $this->organizer = $organizer; } diff --git a/apps/dav/lib/HookManager.php b/apps/dav/lib/HookManager.php index 1e7990af32f..f22e1ccf164 100644 --- a/apps/dav/lib/HookManager.php +++ b/apps/dav/lib/HookManager.php @@ -163,7 +163,7 @@ class HookManager { } } - public function firstLogin(IUser $user = null) { + public function firstLogin(?IUser $user = null) { if (!is_null($user)) { $principal = 'principals/users/' . $user->getUID(); if ($this->calDav->getCalendarsForUserCount($principal) === 0) { |