Skip to content

Commit

Permalink
Try to fix some psalm things. No change to the code apart from that.
Browse files Browse the repository at this point in the history
Signed-off-by: Claus-Justus Heine <himself@claus-justus-heine.de>
  • Loading branch information
rotdrop committed Feb 17, 2023
1 parent 76b5ba8 commit 5219c61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/dav/lib/CalDAV/CalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -2178,6 +2178,11 @@ public function getCalendarObjectByUID($principalUri, $uid) {
$stmt->closeCursor();
if ($row) {
if ($row['principaluri'] != $principalUri) {
/**
* This seeems to be a false positive: we have "use Sabre\Uri" and Uri\split() IS defined.
*
* @psalm-suppress UndefinedFunction
*/
[, $name] = Uri\split($row['principaluri']);
$calendarUri = $row['calendaruri'] . '_shared_by_' . $name;
} else {
Expand Down
10 changes: 10 additions & 0 deletions apps/dav/lib/CalDAV/Schedule/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public function calendarObjectChange(RequestInterface $request, ResponseInterfac
return;
}

/** @var Calendar $calendarNode */
$calendarNode = $this->server->tree->getNodeForPath($calendarPath);

// Original code in parent class:
Expand All @@ -181,13 +182,22 @@ public function calendarObjectChange(RequestInterface $request, ResponseInterfac
$calendarNode->getPrincipalURI()
);

/** @var VCalendar $oldObj */
if (!$isNew) {
/** @var \Sabre\CalDAV\CalendarObject $node */
$node = $this->server->tree->getNodeForPath($request->getPath());
$oldObj = Reader::read($node->get());
} else {
$oldObj = null;
}

/**
* Sabre has several issues with faulty argument type specifications
* in its doc-block comments. Passing null is ok here.
*
* @psalm-suppress PossiblyNullArgument
* @psalm-suppress ArgumentTypeCoercion
*/
$this->processICalendarChange($oldObj, $vCal, $addresses, [], $modified);

if ($oldObj) {
Expand Down

0 comments on commit 5219c61

Please sign in to comment.