From df4c2508d64822e448bf2f8b9e4c84d4877c4725 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 15 Feb 2021 20:50:28 +0100 Subject: [PATCH] Fix some RedundantCast in dav code For #25641 Signed-off-by: Roeland Jago Douma --- apps/dav/lib/CalDAV/CalDavBackend.php | 4 ++-- apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 0cceeae12d..6b84512fc9 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -2158,10 +2158,10 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription ->values($valuesToInsert) ->execute(); - $subscriptionId = $this->db->lastInsertId('*PREFIX*calendarsubscriptions'); + $subscriptionId = $query->getLastInsertId(); $subscriptionRow = $this->getSubscriptionById($subscriptionId); - $this->dispatcher->dispatchTyped(new SubscriptionCreatedEvent((int)$subscriptionId, $subscriptionRow)); + $this->dispatcher->dispatchTyped(new SubscriptionCreatedEvent($subscriptionId, $subscriptionRow)); $this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::createSubscription', new GenericEvent( '\OCA\DAV\CalDAV\CalDavBackend::createSubscription', [ diff --git a/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php b/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php index 6e45affb3f..e25f42c31e 100644 --- a/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php +++ b/apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php @@ -130,7 +130,7 @@ class AppleProvisioningPlugin extends ServerPlugin { $absoluteURL = $this->urlGenerator->getBaseUrl(); $parsedUrl = parse_url($absoluteURL); if (isset($parsedUrl['port'])) { - $serverPort = (int) $parsedUrl['port']; + $serverPort = $parsedUrl['port']; } else { $serverPort = 443; }