From 5ce70faee1524a95964ac16f209957366cb10fe1 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 6 Nov 2022 20:49:33 -0800 Subject: [PATCH] php-lint --- lib/Controller/DaysController.php | 2 +- lib/Controller/FoldersTrait.php | 25 ++++++++++++++----------- lib/Db/TimelineQuery.php | 2 +- lib/Db/TimelineQueryFolders.php | 1 - 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/Controller/DaysController.php b/lib/Controller/DaysController.php index b45ebe6c..9c579d82 100644 --- a/lib/Controller/DaysController.php +++ b/lib/Controller/DaysController.php @@ -33,8 +33,8 @@ class DaysController extends ApiBase /** * @NoAdminRequired - * @NoCSRFRequired * + * @NoCSRFRequired * * @PublicPage */ diff --git a/lib/Controller/FoldersTrait.php b/lib/Controller/FoldersTrait.php index 633a9afb..847e9fb8 100644 --- a/lib/Controller/FoldersTrait.php +++ b/lib/Controller/FoldersTrait.php @@ -2,21 +2,14 @@ namespace OCA\Memories\Controller; +use OCA\Memories\Db\TimelineQuery; use OCP\Files\FileInfo; use OCP\Files\Folder; -use OCA\Memories\Db\TimelineQuery; -trait FoldersTrait { +trait FoldersTrait +{ protected TimelineQuery $timelineQuery; - private function getFolderPreviews(Folder &$parent, FileInfo &$fileInfo) { - $folder = $parent->getById($fileInfo->getId()); - if (count($folder) === 0) { - return []; - } - return $this->timelineQuery->getFolderPreviews($folder[0]); - } - /** * Get subfolders entry for days response. */ @@ -52,4 +45,14 @@ trait FoldersTrait { }, $folders, []), ]; } -} \ No newline at end of file + + private function getFolderPreviews(Folder &$parent, FileInfo &$fileInfo) + { + $folder = $parent->getById($fileInfo->getId()); + if (0 === \count($folder)) { + return []; + } + + return $this->timelineQuery->getFolderPreviews($folder[0]); + } +} diff --git a/lib/Db/TimelineQuery.php b/lib/Db/TimelineQuery.php index f500fc84..8974e541 100644 --- a/lib/Db/TimelineQuery.php +++ b/lib/Db/TimelineQuery.php @@ -13,8 +13,8 @@ class TimelineQuery use TimelineQueryDays; use TimelineQueryFaces; use TimelineQueryFilters; - use TimelineQueryTags; use TimelineQueryFolders; + use TimelineQueryTags; protected IDBConnection $connection; diff --git a/lib/Db/TimelineQueryFolders.php b/lib/Db/TimelineQueryFolders.php index e514a366..26910ece 100644 --- a/lib/Db/TimelineQueryFolders.php +++ b/lib/Db/TimelineQueryFolders.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace OCA\Memories\Db; -use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Files\Folder; use OCP\IDBConnection;