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 May 5, 2023
1 parent d0ec954 commit b303189
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 @@ -2203,6 +2203,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 @@ -167,6 +167,7 @@ public function calendarObjectChange(RequestInterface $request, ResponseInterfac
return;
}

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

// Original code in parent class:
Expand All @@ -180,13 +181,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 b303189

Please sign in to comment.