diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-08-19 17:54:00 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-08-19 18:16:35 +0200 |
commit | fedf9c69d9c84fc0399badef39ed765de72c08f1 (patch) | |
tree | bfaae1e7efb907cb236769fada35a9cd05ebf29e /apps/dav/lib | |
parent | 60be722ee8781d9e94ecc66d62c0e5fcb7e3934e (diff) | |
download | nextcloud-server-fedf9c69d9c84fc0399badef39ed765de72c08f1.tar.gz nextcloud-server-fedf9c69d9c84fc0399badef39ed765de72c08f1.zip |
Use matching parameter names form interfaces and implementations
Found by Psalm 3.14.1
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/CalDAV/CalDavBackend.php | 26 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/ObjectTree.php | 18 | ||||
-rw-r--r-- | apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php | 3 |
3 files changed, 24 insertions, 23 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 159f5c71673..885d128807f 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -905,15 +905,15 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * used/fetched to determine these numbers. If both are specified the * amount of times this is needed is reduced by a great degree. * - * @param mixed $id + * @param mixed $calendarId * @param int $calendarType * @return array */ - public function getCalendarObjects($id, $calendarType=self::CALENDAR_TYPE_CALENDAR):array { + public function getCalendarObjects($calendarId, $calendarType=self::CALENDAR_TYPE_CALENDAR):array { $query = $this->db->getQueryBuilder(); $query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'componenttype', 'classification']) ->from('calendarobjects') - ->where($query->expr()->eq('calendarid', $query->createNamedParameter($id))) + ->where($query->expr()->eq('calendarid', $query->createNamedParameter($calendarId))) ->andWhere($query->expr()->eq('calendartype', $query->createNamedParameter($calendarType))); $stmt = $query->execute(); @@ -946,16 +946,16 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * * This method must return null if the object did not exist. * - * @param mixed $id + * @param mixed $calendarId * @param string $objectUri * @param int $calendarType * @return array|null */ - public function getCalendarObject($id, $objectUri, $calendarType=self::CALENDAR_TYPE_CALENDAR) { + public function getCalendarObject($calendarId, $objectUri, $calendarType=self::CALENDAR_TYPE_CALENDAR) { $query = $this->db->getQueryBuilder(); $query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype', 'classification']) ->from('calendarobjects') - ->where($query->expr()->eq('calendarid', $query->createNamedParameter($id))) + ->where($query->expr()->eq('calendarid', $query->createNamedParameter($calendarId))) ->andWhere($query->expr()->eq('uri', $query->createNamedParameter($objectUri))) ->andWhere($query->expr()->eq('calendartype', $query->createNamedParameter($calendarType))); $stmt = $query->execute(); @@ -991,7 +991,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * @param int $calendarType * @return array */ - public function getMultipleCalendarObjects($id, array $uris, $calendarType=self::CALENDAR_TYPE_CALENDAR):array { + public function getMultipleCalendarObjects($calendarId, array $uris, $calendarType=self::CALENDAR_TYPE_CALENDAR):array { if (empty($uris)) { return []; } @@ -1002,7 +1002,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $query = $this->db->getQueryBuilder(); $query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype', 'classification']) ->from('calendarobjects') - ->where($query->expr()->eq('calendarid', $query->createNamedParameter($id))) + ->where($query->expr()->eq('calendarid', $query->createNamedParameter($calendarId))) ->andWhere($query->expr()->in('uri', $query->createParameter('uri'))) ->andWhere($query->expr()->eq('calendartype', $query->createNamedParameter($calendarType))); @@ -1288,12 +1288,12 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription * as possible, so it gives you a good idea on what type of stuff you need * to think of. * - * @param mixed $id + * @param mixed $calendarId * @param array $filters * @param int $calendarType * @return array */ - public function calendarQuery($id, array $filters, $calendarType=self::CALENDAR_TYPE_CALENDAR):array { + public function calendarQuery($calendarId, array $filters, $calendarType=self::CALENDAR_TYPE_CALENDAR):array { $componentType = null; $requirePostFilter = true; $timeRange = null; @@ -1329,7 +1329,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $query = $this->db->getQueryBuilder(); $query->select($columns) ->from('calendarobjects') - ->where($query->expr()->eq('calendarid', $query->createNamedParameter($id))) + ->where($query->expr()->eq('calendarid', $query->createNamedParameter($calendarId))) ->andWhere($query->expr()->eq('calendartype', $query->createNamedParameter($calendarType))); if ($componentType) { @@ -1355,13 +1355,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription } catch (ParseException $ex) { $this->logger->logException($ex, [ 'app' => 'dav', - 'message' => 'Caught parsing exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$id.' uri:'.$row['uri'] + 'message' => 'Caught parsing exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$calendarId.' uri:'.$row['uri'] ]); continue; } catch (InvalidDataException $ex) { $this->logger->logException($ex, [ 'app' => 'dav', - 'message' => 'Caught invalid data exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$id.' uri:'.$row['uri'] + 'message' => 'Caught invalid data exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$calendarId.' uri:'.$row['uri'] ]); continue; } diff --git a/apps/dav/lib/Connector/Sabre/ObjectTree.php b/apps/dav/lib/Connector/Sabre/ObjectTree.php index e292744cd2f..680c0e84fca 100644 --- a/apps/dav/lib/Connector/Sabre/ObjectTree.php +++ b/apps/dav/lib/Connector/Sabre/ObjectTree.php @@ -189,8 +189,8 @@ class ObjectTree extends CachingTree { * This method must work recursively and delete the destination * if it exists * - * @param string $source - * @param string $destination + * @param string $sourcePath + * @param string $destinationPath * @throws FileLocked * @throws Forbidden * @throws InvalidPath @@ -201,14 +201,14 @@ class ObjectTree extends CachingTree { * @throws \Sabre\DAV\Exception\ServiceUnavailable * @return void */ - public function copy($source, $destination) { + public function copy($sourcePath, $destinationPath) { if (!$this->fileView) { throw new \Sabre\DAV\Exception\ServiceUnavailable('filesystem not setup'); } - $info = $this->fileView->getFileInfo(dirname($destination)); - if ($this->fileView->file_exists($destination)) { + $info = $this->fileView->getFileInfo(dirname($destinationPath)); + if ($this->fileView->file_exists($destinationPath)) { $destinationPermission = $info && $info->isUpdateable(); } else { $destinationPermission = $info && $info->isCreatable(); @@ -218,9 +218,9 @@ class ObjectTree extends CachingTree { } // this will trigger existence check - $this->getNodeForPath($source); + $this->getNodeForPath($sourcePath); - list($destinationDir, $destinationName) = \Sabre\Uri\split($destination); + list($destinationDir, $destinationName) = \Sabre\Uri\split($destinationPath); try { $this->fileView->verifyPath($destinationDir, $destinationName); } catch (\OCP\Files\InvalidPathException $ex) { @@ -228,7 +228,7 @@ class ObjectTree extends CachingTree { } try { - $this->fileView->copy($source, $destination); + $this->fileView->copy($sourcePath, $destinationPath); } catch (StorageNotAvailableException $e) { throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage()); } catch (ForbiddenException $ex) { @@ -237,7 +237,7 @@ class ObjectTree extends CachingTree { throw new FileLocked($e->getMessage(), $e->getCode(), $e); } - list($destinationDir,) = \Sabre\Uri\split($destination); + list($destinationDir,) = \Sabre\Uri\split($destinationPath); $this->markDirty($destinationDir); } } diff --git a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php index 911448e3498..f3bed7887f7 100644 --- a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php @@ -93,7 +93,8 @@ class SystemTagsObjectMappingCollection implements ICollection { $this->user = $user; } - public function createFile($tagId, $data = null) { + public function createFile($name, $data = null) { + $tagId = $name; try { $tags = $this->tagManager->getTagsByIds([$tagId]); $tag = current($tags); |