diff options
3 files changed, 8 insertions, 12 deletions
diff --git a/apps/dav/lib/CalDAV/CalendarImpl.php b/apps/dav/lib/CalDAV/CalendarImpl.php index f9e9c584808..3fb28a631a7 100644 --- a/apps/dav/lib/CalDAV/CalendarImpl.php +++ b/apps/dav/lib/CalDAV/CalendarImpl.php @@ -42,7 +42,6 @@ use Sabre\VObject\Reader; use function Sabre\Uri\split as uriSplit; class CalendarImpl implements ICreateFromString, IHandleImipMessage { - private CalDavBackend $backend; private Calendar $calendar; /** @var array<string, mixed> */ @@ -204,25 +203,25 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { /** @var VEvent $vEvent */ $vEvent = $vObject->{'VEVENT'}; - if($vObject->{'METHOD'} === null) { + if ($vObject->{'METHOD'} === null) { throw new CalendarException('No Method provided for scheduling data. Could not process message'); } - if(!isset($vEvent->{'ORGANIZER'}) || !isset($vEvent->{'ATTENDEE'})) { + if (!isset($vEvent->{'ORGANIZER'}) || !isset($vEvent->{'ATTENDEE'})) { throw new CalendarException('Could not process scheduling data, neccessary data missing from ICAL'); } $organizer = $vEvent->{'ORGANIZER'}->getValue(); $attendee = $vEvent->{'ATTENDEE'}->getValue(); $iTipMessage->method = $vObject->{'METHOD'}->getValue(); - if($iTipMessage->method === 'REPLY') { + if ($iTipMessage->method === 'REPLY') { if ($server->isExternalAttendee($vEvent->{'ATTENDEE'}->getValue())) { $iTipMessage->recipient = $organizer; } else { $iTipMessage->recipient = $attendee; } $iTipMessage->sender = $attendee; - } else if($iTipMessage->method === 'CANCEL') { + } elseif ($iTipMessage->method === 'CANCEL') { $iTipMessage->recipient = $attendee; $iTipMessage->sender = $organizer; } @@ -233,7 +232,7 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { $schedulingPlugin->scheduleLocalDelivery($iTipMessage); } - public function getInvitationResponseServer() { + public function getInvitationResponseServer(): InvitationResponseServer { return new InvitationResponseServer(false); } } diff --git a/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php b/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php index c2e31f7bdc4..e64c815753b 100644 --- a/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php +++ b/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php @@ -39,7 +39,6 @@ use Psr\Log\LoggerInterface; use Sabre\VObject\ITip\Message; class InvitationResponseServer { - /** @var \OCA\DAV\Connector\Sabre\Server */ public $server; @@ -131,7 +130,7 @@ class InvitationResponseServer { return $aclPlugin->getPrincipalByUri($principalUri) === null; } - public function getServer() { + public function getServer(): \OCA\DAV\Connector\Sabre\Server { return $this->server; } } diff --git a/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php b/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php index 295949bdc91..ee43bae5355 100644 --- a/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php +++ b/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php @@ -32,12 +32,10 @@ namespace OCA\DAV\Tests\unit\BackgroundJob; use OCA\DAV\BackgroundJob\CleanupInvitationTokenJob; use OCP\AppFramework\Utility\ITimeFactory; use OCP\DB\QueryBuilder\IQueryBuilder; -use OCP\DB\QueryBuilder\IQueryFunction; use OCP\IDBConnection; use Test\TestCase; class CleanupInvitationTokenJobTest extends TestCase { - /** @var IDBConnection | \PHPUnit\Framework\MockObject\MockObject */ private $dbConnection; @@ -78,11 +76,11 @@ class CleanupInvitationTokenJobTest extends TestCase { [1337, \PDO::PARAM_STR, null, 'namedParameter1337'] ]); - $function = $this->createMock(IQueryFunction::class); + $function = 'fakefunction'; $expr->expects($this->once()) ->method('lt') ->with('expiration', 'namedParameter1337') - ->willReturn((string)$function); + ->willReturn($function); $this->dbConnection->expects($this->once()) ->method('getQueryBuilder') |