aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-03-28 16:13:19 +0100
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-04-02 14:16:21 +0200
commitec5133b739eabc76271789504b4dbb91a534f552 (patch)
tree880b81f5ebd11b289c67e4bcdd1ecaa41aedbcb4 /apps/dav
parentb074399a87e764f506550d64f6379738186355c6 (diff)
downloadnextcloud-server-ec5133b739eabc76271789504b4dbb91a534f552.tar.gz
nextcloud-server-ec5133b739eabc76271789504b4dbb91a534f552.zip
fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/appinfo/v2/direct.php2
-rw-r--r--apps/dav/lib/CalDAV/Activity/Provider/Calendar.php2
-rw-r--r--apps/dav/lib/CalDAV/Activity/Provider/Event.php2
-rw-r--r--apps/dav/lib/CalDAV/Activity/Provider/Todo.php2
-rw-r--r--apps/dav/lib/CalDAV/BirthdayService.php2
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php2
-rw-r--r--apps/dav/lib/CalDAV/Reminder/ReminderService.php4
-rw-r--r--apps/dav/lib/CalDAV/Schedule/Plugin.php4
-rw-r--r--apps/dav/lib/CalDAV/Status/StatusService.php2
-rw-r--r--apps/dav/lib/CardDAV/Activity/Provider/Addressbook.php2
-rw-r--r--apps/dav/lib/CardDAV/Activity/Provider/Card.php2
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php2
-rw-r--r--apps/dav/lib/CardDAV/SyncService.php2
-rw-r--r--apps/dav/lib/Command/MoveCalendar.php6
-rw-r--r--apps/dav/lib/Comments/EntityCollection.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/CachingTree.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/Directory.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/Exception/FileLocked.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/Exception/Forbidden.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/Node.php2
-rw-r--r--apps/dav/lib/DAV/Sharing/Xml/Invite.php2
-rw-r--r--apps/dav/lib/HookManager.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php2
-rw-r--r--apps/dav/tests/unit/CardDAV/CardDavBackendTest.php46
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FileTest.php6
-rw-r--r--apps/dav/tests/unit/Files/MultipartRequestParserTest.php2
29 files changed, 59 insertions, 59 deletions
diff --git a/apps/dav/appinfo/v2/direct.php b/apps/dav/appinfo/v2/direct.php
index c4676e62c4f..37e4feeb6e0 100644
--- a/apps/dav/appinfo/v2/direct.php
+++ b/apps/dav/appinfo/v2/direct.php
@@ -24,7 +24,7 @@ declare(strict_types=1);
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-use \OCA\DAV\Direct\ServerFactory;
+use OCA\DAV\Direct\ServerFactory;
// no php execution timeout for webdav
if (!str_contains(@ini_get('disable_functions'), 'set_time_limit')) {
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) {
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php
index fb985525078..f5a2890207a 100644
--- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php
+++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/EmailProviderTest.php
@@ -367,7 +367,7 @@ class EmailProviderTest extends AbstractNotificationProviderTest {
* @param array|null $replyTo
* @return IMessage
*/
- private function getMessageMock(string $toMail, IEMailTemplate $templateMock, array $replyTo = null):IMessage {
+ private function getMessageMock(string $toMail, IEMailTemplate $templateMock, ?array $replyTo = null):IMessage {
$message = $this->createMock(IMessage::class);
$i = 0;
diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
index 942718f7ce5..4cd65a341b0 100644
--- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
+++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
@@ -99,35 +99,35 @@ class CardDavBackendTest extends TestCase {
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.
- 'END:VCARD';
+ '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.
- 'END:VCARD';
+ '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.
- 'END:VCARD';
+ '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.
- 'END:VCARD';
+ '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 {
parent::setUp();
diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php
index 36dc550a8a3..688b1ac6b44 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php
@@ -318,7 +318,7 @@ class FileTest extends TestCase {
*
* @return null|string of the PUT operation which is usually the etag
*/
- private function doPut($path, $viewRoot = null, Request $request = null) {
+ private function doPut($path, $viewRoot = null, ?Request $request = null) {
$view = \OC\Files\Filesystem::getView();
if (!is_null($viewRoot)) {
$view = new \OC\Files\View($viewRoot);
@@ -1124,7 +1124,7 @@ class FileTest extends TestCase {
*
* @return array list of part files
*/
- private function listPartFiles(\OC\Files\View $userView = null, $path = '') {
+ private function listPartFiles(?\OC\Files\View $userView = null, $path = '') {
if ($userView === null) {
$userView = \OC\Files\Filesystem::getView();
}
@@ -1150,7 +1150,7 @@ class FileTest extends TestCase {
* @param View $userView
* @return array
*/
- private function getFileInfos($path = '', View $userView = null) {
+ private function getFileInfos($path = '', ?View $userView = null) {
if ($userView === null) {
$userView = Filesystem::getView();
}
diff --git a/apps/dav/tests/unit/Files/MultipartRequestParserTest.php b/apps/dav/tests/unit/Files/MultipartRequestParserTest.php
index 745a568b8ad..0edf68e6c09 100644
--- a/apps/dav/tests/unit/Files/MultipartRequestParserTest.php
+++ b/apps/dav/tests/unit/Files/MultipartRequestParserTest.php
@@ -22,7 +22,7 @@
namespace OCA\DAV\Tests\unit\DAV;
-use \OCA\DAV\BulkUpload\MultipartRequestParser;
+use OCA\DAV\BulkUpload\MultipartRequestParser;
use Psr\Log\LoggerInterface;
use Test\TestCase;