From ef823dcf31489481332d52c68f9dc0c46319f642 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 2 Sep 2023 12:25:33 +0200 Subject: [PATCH 1/5] enh: Strict types everywhere Signed-off-by: Marcel Klehr --- lib/AppInfo/Application.php | 2 +- lib/BackgroundJobs/ClassifierJob.php | 2 +- lib/BackgroundJobs/ClassifyFacesJob.php | 2 +- lib/BackgroundJobs/ClassifyImagenetJob.php | 2 +- lib/BackgroundJobs/ClassifyLandmarksJob.php | 2 +- lib/BackgroundJobs/ClassifyMovinetJob.php | 2 +- lib/BackgroundJobs/ClassifyMusicnnJob.php | 2 +- lib/BackgroundJobs/ClusterFacesJob.php | 2 +- lib/BackgroundJobs/SchedulerJob.php | 2 +- lib/BackgroundJobs/StorageCrawlJob.php | 2 +- lib/Classifiers/Audio/MusicnnClassifier.php | 2 +- lib/Classifiers/Classifier.php | 2 +- lib/Classifiers/Images/ClusteringFaceClassifier.php | 2 +- lib/Classifiers/Images/ImagenetClassifier.php | 2 +- lib/Classifiers/Images/LandmarksClassifier.php | 2 +- lib/Classifiers/Video/MovinetClassifier.php | 2 +- lib/Clustering/DualTreeBall.php | 2 +- lib/Clustering/DualTreeClique.php | 2 +- lib/Clustering/HDBSCAN.php | 2 +- lib/Clustering/MrdBallTree.php | 2 +- lib/Clustering/MstClusterer.php | 2 +- lib/Clustering/MstSolver.php | 2 +- lib/Clustering/SquaredDistance.php | 2 +- lib/Command/Classify.php | 2 +- lib/Command/CleanupTags.php | 2 +- lib/Command/ClearBackgroundJobs.php | 2 +- lib/Command/ClusterFaces.php | 2 +- lib/Command/DownloadModels.php | 2 +- lib/Command/Recrawl.php | 2 +- lib/Command/RemoveLegacyTags.php | 2 +- lib/Command/ResetFaceClusters.php | 2 +- lib/Command/ResetFaces.php | 2 +- lib/Command/ResetTags.php | 2 +- lib/Constants.php | 2 +- lib/Dav/Faces/FacePhoto.php | 2 +- lib/Dav/Faces/FaceRoot.php | 2 +- lib/Dav/Faces/FacesHome.php | 2 +- lib/Dav/Faces/PropFindPlugin.php | 2 +- lib/Dav/Faces/UnassignedFacePhoto.php | 2 +- lib/Dav/Faces/UnassignedFacesHome.php | 2 +- lib/Dav/RecognizeHome.php | 2 +- lib/Dav/RootCollection.php | 2 +- lib/Db/FaceCluster.php | 2 +- lib/Db/FaceClusterMapper.php | 2 +- lib/Db/FaceDetection.php | 2 +- lib/Db/FaceDetectionMapper.php | 2 +- lib/Db/FaceDetectionWithTitle.php | 2 +- lib/Db/QueueFile.php | 2 +- lib/Db/QueueMapper.php | 2 +- lib/Exception/Exception.php | 2 +- lib/Helper/Archive.php | 2 +- lib/Helper/TAR.php | 2 +- lib/Hooks/FileListener.php | 2 +- lib/Migration/InstallDeps.php | 2 +- lib/Migration/Version002002000Date20220614094721.php | 2 +- lib/Migration/Version002003000Date20220713094721.php | 2 +- lib/Migration/Version003001000Date20221017094721.php | 2 +- lib/Migration/Version003004000Date20230107094721.php | 2 +- lib/Service/DownloadModelsService.php | 2 +- lib/Service/FaceClusterAnalyzer.php | 2 +- lib/Service/IgnoreService.php | 2 +- lib/Service/Logger.php | 2 +- lib/Service/QueueService.php | 2 +- lib/Service/StorageService.php | 2 +- lib/Service/TagManager.php | 2 +- lib/Settings/AdminSection.php | 2 +- lib/Settings/AdminSettings.php | 2 +- package-lock.json | 4 ++-- 68 files changed, 69 insertions(+), 69 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 90e3c099..81d5b5f3 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -4,7 +4,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\AppInfo; use OCA\DAV\Connector\Sabre\Principal; diff --git a/lib/BackgroundJobs/ClassifierJob.php b/lib/BackgroundJobs/ClassifierJob.php index 84d88b69..8e4a8c75 100644 --- a/lib/BackgroundJobs/ClassifierJob.php +++ b/lib/BackgroundJobs/ClassifierJob.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\BackgroundJobs; use OCA\Recognize\Service\QueueService; diff --git a/lib/BackgroundJobs/ClassifyFacesJob.php b/lib/BackgroundJobs/ClassifyFacesJob.php index 016fcaaf..40671267 100644 --- a/lib/BackgroundJobs/ClassifyFacesJob.php +++ b/lib/BackgroundJobs/ClassifyFacesJob.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\BackgroundJobs; use OCA\Recognize\Classifiers\Images\ClusteringFaceClassifier; diff --git a/lib/BackgroundJobs/ClassifyImagenetJob.php b/lib/BackgroundJobs/ClassifyImagenetJob.php index f48bf8f4..e3d5c0a8 100644 --- a/lib/BackgroundJobs/ClassifyImagenetJob.php +++ b/lib/BackgroundJobs/ClassifyImagenetJob.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\BackgroundJobs; use OCA\Recognize\Classifiers\Images\ImagenetClassifier; diff --git a/lib/BackgroundJobs/ClassifyLandmarksJob.php b/lib/BackgroundJobs/ClassifyLandmarksJob.php index d53a6cee..23942d56 100644 --- a/lib/BackgroundJobs/ClassifyLandmarksJob.php +++ b/lib/BackgroundJobs/ClassifyLandmarksJob.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\BackgroundJobs; use OCA\Recognize\Classifiers\Images\LandmarksClassifier; diff --git a/lib/BackgroundJobs/ClassifyMovinetJob.php b/lib/BackgroundJobs/ClassifyMovinetJob.php index 88bb0b52..e83bca2c 100644 --- a/lib/BackgroundJobs/ClassifyMovinetJob.php +++ b/lib/BackgroundJobs/ClassifyMovinetJob.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\BackgroundJobs; use OCA\Recognize\Classifiers\Video\MovinetClassifier; diff --git a/lib/BackgroundJobs/ClassifyMusicnnJob.php b/lib/BackgroundJobs/ClassifyMusicnnJob.php index 6c48d947..eeee5248 100644 --- a/lib/BackgroundJobs/ClassifyMusicnnJob.php +++ b/lib/BackgroundJobs/ClassifyMusicnnJob.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\BackgroundJobs; use OCA\Recognize\Classifiers\Audio\MusicnnClassifier; diff --git a/lib/BackgroundJobs/ClusterFacesJob.php b/lib/BackgroundJobs/ClusterFacesJob.php index c7a019d9..51d8e6fc 100644 --- a/lib/BackgroundJobs/ClusterFacesJob.php +++ b/lib/BackgroundJobs/ClusterFacesJob.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\BackgroundJobs; use OCA\Recognize\Service\FaceClusterAnalyzer; diff --git a/lib/BackgroundJobs/SchedulerJob.php b/lib/BackgroundJobs/SchedulerJob.php index db262642..dc277d65 100644 --- a/lib/BackgroundJobs/SchedulerJob.php +++ b/lib/BackgroundJobs/SchedulerJob.php @@ -3,7 +3,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\BackgroundJobs; use OCA\Recognize\Classifiers\Audio\MusicnnClassifier; diff --git a/lib/BackgroundJobs/StorageCrawlJob.php b/lib/BackgroundJobs/StorageCrawlJob.php index 4e791945..3da81826 100644 --- a/lib/BackgroundJobs/StorageCrawlJob.php +++ b/lib/BackgroundJobs/StorageCrawlJob.php @@ -3,7 +3,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\BackgroundJobs; use OCA\Recognize\Classifiers\Audio\MusicnnClassifier; diff --git a/lib/Classifiers/Audio/MusicnnClassifier.php b/lib/Classifiers/Audio/MusicnnClassifier.php index d6e1c514..bf80ca07 100644 --- a/lib/Classifiers/Audio/MusicnnClassifier.php +++ b/lib/Classifiers/Audio/MusicnnClassifier.php @@ -3,7 +3,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Classifiers\Audio; use OCA\Recognize\Classifiers\Classifier; diff --git a/lib/Classifiers/Classifier.php b/lib/Classifiers/Classifier.php index 6651ab16..e447fe68 100644 --- a/lib/Classifiers/Classifier.php +++ b/lib/Classifiers/Classifier.php @@ -3,7 +3,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Classifiers; use OCA\Recognize\Classifiers\Images\ClusteringFaceClassifier; diff --git a/lib/Classifiers/Images/ClusteringFaceClassifier.php b/lib/Classifiers/Images/ClusteringFaceClassifier.php index 4ec93512..f871900f 100644 --- a/lib/Classifiers/Images/ClusteringFaceClassifier.php +++ b/lib/Classifiers/Images/ClusteringFaceClassifier.php @@ -3,7 +3,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Classifiers\Images; use OCA\Recognize\BackgroundJobs\ClusterFacesJob; diff --git a/lib/Classifiers/Images/ImagenetClassifier.php b/lib/Classifiers/Images/ImagenetClassifier.php index 1e2fe997..e526e1b1 100644 --- a/lib/Classifiers/Images/ImagenetClassifier.php +++ b/lib/Classifiers/Images/ImagenetClassifier.php @@ -3,7 +3,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Classifiers\Images; use OCA\Recognize\Classifiers\Classifier; diff --git a/lib/Classifiers/Images/LandmarksClassifier.php b/lib/Classifiers/Images/LandmarksClassifier.php index 51898a7c..8f992749 100644 --- a/lib/Classifiers/Images/LandmarksClassifier.php +++ b/lib/Classifiers/Images/LandmarksClassifier.php @@ -3,7 +3,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Classifiers\Images; use OCA\Recognize\Classifiers\Classifier; diff --git a/lib/Classifiers/Video/MovinetClassifier.php b/lib/Classifiers/Video/MovinetClassifier.php index 05cd9265..3e50416d 100644 --- a/lib/Classifiers/Video/MovinetClassifier.php +++ b/lib/Classifiers/Video/MovinetClassifier.php @@ -3,7 +3,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Classifiers\Video; use OCA\Recognize\Classifiers\Classifier; diff --git a/lib/Clustering/DualTreeBall.php b/lib/Clustering/DualTreeBall.php index 3e7bbaad..6333c09e 100644 --- a/lib/Clustering/DualTreeBall.php +++ b/lib/Clustering/DualTreeBall.php @@ -3,7 +3,7 @@ * Copyright (c) 2023 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Clustering; use \Rubix\ML\Datasets\Labeled; diff --git a/lib/Clustering/DualTreeClique.php b/lib/Clustering/DualTreeClique.php index 01d3b96e..478907cc 100644 --- a/lib/Clustering/DualTreeClique.php +++ b/lib/Clustering/DualTreeClique.php @@ -3,7 +3,7 @@ * Copyright (c) 2023 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Clustering; use \Rubix\ML\Datasets\Labeled; diff --git a/lib/Clustering/HDBSCAN.php b/lib/Clustering/HDBSCAN.php index 45a42567..e7ecb9e6 100644 --- a/lib/Clustering/HDBSCAN.php +++ b/lib/Clustering/HDBSCAN.php @@ -3,7 +3,7 @@ * Copyright (c) 2023 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Clustering; use \Rubix\ML\Datasets\Labeled; diff --git a/lib/Clustering/MrdBallTree.php b/lib/Clustering/MrdBallTree.php index e849f588..365175ad 100644 --- a/lib/Clustering/MrdBallTree.php +++ b/lib/Clustering/MrdBallTree.php @@ -3,7 +3,7 @@ * Copyright (c) 2023 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Clustering; use \Rubix\ML\Datasets\Labeled; diff --git a/lib/Clustering/MstClusterer.php b/lib/Clustering/MstClusterer.php index 3c2f4b07..b3e23c21 100644 --- a/lib/Clustering/MstClusterer.php +++ b/lib/Clustering/MstClusterer.php @@ -3,7 +3,7 @@ * Copyright (c) 2023 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Clustering; // TODO: store vertex lambda length (relative to cluster lambda length) for all vertices for improved soft clustering (see https://hdbscan.readthedocs.io/en/latest/soft_clustering.html) diff --git a/lib/Clustering/MstSolver.php b/lib/Clustering/MstSolver.php index 9a8ed1cb..470270ea 100644 --- a/lib/Clustering/MstSolver.php +++ b/lib/Clustering/MstSolver.php @@ -3,7 +3,7 @@ * Copyright (c) 2023 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Clustering; use \Rubix\ML\Datasets\Labeled; diff --git a/lib/Clustering/SquaredDistance.php b/lib/Clustering/SquaredDistance.php index bba0fd2f..71c8bea7 100644 --- a/lib/Clustering/SquaredDistance.php +++ b/lib/Clustering/SquaredDistance.php @@ -3,7 +3,7 @@ * Copyright (c) 2023 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Clustering; use \Rubix\ML\DataType; diff --git a/lib/Command/Classify.php b/lib/Command/Classify.php index 669c1464..65665165 100644 --- a/lib/Command/Classify.php +++ b/lib/Command/Classify.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Command; use OCA\Recognize\Classifiers\Audio\MusicnnClassifier; diff --git a/lib/Command/CleanupTags.php b/lib/Command/CleanupTags.php index d1f5b97d..fcd5fe57 100644 --- a/lib/Command/CleanupTags.php +++ b/lib/Command/CleanupTags.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Command; use OCA\Recognize\Service\TagManager; diff --git a/lib/Command/ClearBackgroundJobs.php b/lib/Command/ClearBackgroundJobs.php index 0023069e..64188acb 100644 --- a/lib/Command/ClearBackgroundJobs.php +++ b/lib/Command/ClearBackgroundJobs.php @@ -3,7 +3,7 @@ * Copyright (c) 2023 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Command; use OCA\Recognize\BackgroundJobs\ClassifyFacesJob; diff --git a/lib/Command/ClusterFaces.php b/lib/Command/ClusterFaces.php index abc0ebce..e1c200f5 100644 --- a/lib/Command/ClusterFaces.php +++ b/lib/Command/ClusterFaces.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Command; use OCA\Recognize\Db\FaceDetectionMapper; diff --git a/lib/Command/DownloadModels.php b/lib/Command/DownloadModels.php index d5553167..7871b857 100644 --- a/lib/Command/DownloadModels.php +++ b/lib/Command/DownloadModels.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Command; use OCA\Recognize\Service\DownloadModelsService; diff --git a/lib/Command/Recrawl.php b/lib/Command/Recrawl.php index 793f5025..c9e4984d 100644 --- a/lib/Command/Recrawl.php +++ b/lib/Command/Recrawl.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Command; use OCA\Recognize\BackgroundJobs\ClassifyFacesJob; diff --git a/lib/Command/RemoveLegacyTags.php b/lib/Command/RemoveLegacyTags.php index ed8ae5f6..3f27617c 100644 --- a/lib/Command/RemoveLegacyTags.php +++ b/lib/Command/RemoveLegacyTags.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Command; use OCA\Recognize\Service\TagManager; diff --git a/lib/Command/ResetFaceClusters.php b/lib/Command/ResetFaceClusters.php index 339e1cb9..a7c7142e 100644 --- a/lib/Command/ResetFaceClusters.php +++ b/lib/Command/ResetFaceClusters.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Command; use OCA\Recognize\Db\FaceClusterMapper; diff --git a/lib/Command/ResetFaces.php b/lib/Command/ResetFaces.php index ebdfd86d..6cba242c 100644 --- a/lib/Command/ResetFaces.php +++ b/lib/Command/ResetFaces.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Command; use OCA\Recognize\Db\FaceClusterMapper; diff --git a/lib/Command/ResetTags.php b/lib/Command/ResetTags.php index 7a1511ee..08b8e5b0 100644 --- a/lib/Command/ResetTags.php +++ b/lib/Command/ResetTags.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Command; use OCA\Recognize\Service\TagManager; diff --git a/lib/Constants.php b/lib/Constants.php index c20f3416..729730d7 100644 --- a/lib/Constants.php +++ b/lib/Constants.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize; class Constants { diff --git a/lib/Dav/Faces/FacePhoto.php b/lib/Dav/Faces/FacePhoto.php index b274f05b..47482382 100644 --- a/lib/Dav/Faces/FacePhoto.php +++ b/lib/Dav/Faces/FacePhoto.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Dav\Faces; use \Rubix\ML\Kernels\Distance\Euclidean; diff --git a/lib/Dav/Faces/FaceRoot.php b/lib/Dav/Faces/FaceRoot.php index 19e7c2ad..234ef0e3 100644 --- a/lib/Dav/Faces/FaceRoot.php +++ b/lib/Dav/Faces/FaceRoot.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Dav\Faces; use OC\Metadata\IMetadataManager; diff --git a/lib/Dav/Faces/FacesHome.php b/lib/Dav/Faces/FacesHome.php index ebe2dda3..a7a89c1b 100644 --- a/lib/Dav/Faces/FacesHome.php +++ b/lib/Dav/Faces/FacesHome.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Dav\Faces; use OC\Metadata\IMetadataManager; diff --git a/lib/Dav/Faces/PropFindPlugin.php b/lib/Dav/Faces/PropFindPlugin.php index 1f6c7efc..805060f7 100644 --- a/lib/Dav/Faces/PropFindPlugin.php +++ b/lib/Dav/Faces/PropFindPlugin.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Dav\Faces; use \OCA\DAV\Connector\Sabre\FilesPlugin; diff --git a/lib/Dav/Faces/UnassignedFacePhoto.php b/lib/Dav/Faces/UnassignedFacePhoto.php index 3f5d27f3..3d080647 100644 --- a/lib/Dav/Faces/UnassignedFacePhoto.php +++ b/lib/Dav/Faces/UnassignedFacePhoto.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Dav\Faces; use OC\Metadata\IMetadataManager; diff --git a/lib/Dav/Faces/UnassignedFacesHome.php b/lib/Dav/Faces/UnassignedFacesHome.php index bd7920ae..0497ad5f 100644 --- a/lib/Dav/Faces/UnassignedFacesHome.php +++ b/lib/Dav/Faces/UnassignedFacesHome.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Dav\Faces; use OC\Metadata\IMetadataManager; diff --git a/lib/Dav/RecognizeHome.php b/lib/Dav/RecognizeHome.php index 393e2ae3..1992c67f 100644 --- a/lib/Dav/RecognizeHome.php +++ b/lib/Dav/RecognizeHome.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Dav; use OC\Metadata\IMetadataManager; diff --git a/lib/Dav/RootCollection.php b/lib/Dav/RootCollection.php index dc8eea7d..5883e01a 100644 --- a/lib/Dav/RootCollection.php +++ b/lib/Dav/RootCollection.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Dav; use \Sabre\DAVACL\AbstractPrincipalCollection; diff --git a/lib/Db/FaceCluster.php b/lib/Db/FaceCluster.php index 6d64febc..3328ad05 100644 --- a/lib/Db/FaceCluster.php +++ b/lib/Db/FaceCluster.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Db; use OCP\AppFramework\Db\Entity; diff --git a/lib/Db/FaceClusterMapper.php b/lib/Db/FaceClusterMapper.php index d74dbf75..ed03cfb4 100644 --- a/lib/Db/FaceClusterMapper.php +++ b/lib/Db/FaceClusterMapper.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Db; use OCP\AppFramework\Db\Entity; diff --git a/lib/Db/FaceDetection.php b/lib/Db/FaceDetection.php index a1319dc8..8c30533e 100644 --- a/lib/Db/FaceDetection.php +++ b/lib/Db/FaceDetection.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Db; use OCP\AppFramework\Db\Entity; diff --git a/lib/Db/FaceDetectionMapper.php b/lib/Db/FaceDetectionMapper.php index 3a8da900..32a7fbb9 100644 --- a/lib/Db/FaceDetectionMapper.php +++ b/lib/Db/FaceDetectionMapper.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Db; use OCA\Recognize\Service\FaceClusterAnalyzer; diff --git a/lib/Db/FaceDetectionWithTitle.php b/lib/Db/FaceDetectionWithTitle.php index 982309e2..13ac575c 100644 --- a/lib/Db/FaceDetectionWithTitle.php +++ b/lib/Db/FaceDetectionWithTitle.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Db; /** diff --git a/lib/Db/QueueFile.php b/lib/Db/QueueFile.php index 2ff0c2ed..8f620dd7 100644 --- a/lib/Db/QueueFile.php +++ b/lib/Db/QueueFile.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Db; use OCP\AppFramework\Db\Entity; diff --git a/lib/Db/QueueMapper.php b/lib/Db/QueueMapper.php index e589dd19..23cb6fbc 100644 --- a/lib/Db/QueueMapper.php +++ b/lib/Db/QueueMapper.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Db; use OCA\Recognize\Classifiers\Audio\MusicnnClassifier; diff --git a/lib/Exception/Exception.php b/lib/Exception/Exception.php index 3603aaf4..4199af2a 100644 --- a/lib/Exception/Exception.php +++ b/lib/Exception/Exception.php @@ -3,7 +3,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Exception; class Exception extends \Exception { diff --git a/lib/Helper/Archive.php b/lib/Helper/Archive.php index 6a6370f2..fad1d5b3 100644 --- a/lib/Helper/Archive.php +++ b/lib/Helper/Archive.php @@ -26,7 +26,7 @@ * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see * - */ + */declare(strict_types=1); namespace OCA\Recognize\Helper; abstract class Archive { diff --git a/lib/Helper/TAR.php b/lib/Helper/TAR.php index 6e1d3d5f..2d60b00c 100644 --- a/lib/Helper/TAR.php +++ b/lib/Helper/TAR.php @@ -29,7 +29,7 @@ * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see * - */ + */declare(strict_types=1); namespace OCA\Recognize\Helper; use Icewind\Streams\CallbackWrapper; diff --git a/lib/Hooks/FileListener.php b/lib/Hooks/FileListener.php index 1d0d7810..25a6773b 100644 --- a/lib/Hooks/FileListener.php +++ b/lib/Hooks/FileListener.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Hooks; use OCA\Recognize\Classifiers\Audio\MusicnnClassifier; diff --git a/lib/Migration/InstallDeps.php b/lib/Migration/InstallDeps.php index 82340454..c267e369 100644 --- a/lib/Migration/InstallDeps.php +++ b/lib/Migration/InstallDeps.php @@ -27,7 +27,7 @@ * along with this program. If not, see . * */ - +declare(strict_types=1); namespace OCA\Recognize\Migration; use OCA\Recognize\Helper\TAR; diff --git a/lib/Migration/Version002002000Date20220614094721.php b/lib/Migration/Version002002000Date20220614094721.php index 259d6579..a5b97351 100644 --- a/lib/Migration/Version002002000Date20220614094721.php +++ b/lib/Migration/Version002002000Date20220614094721.php @@ -3,7 +3,7 @@ * Copyright (c) 2020-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Migration; use Closure; diff --git a/lib/Migration/Version002003000Date20220713094721.php b/lib/Migration/Version002003000Date20220713094721.php index 5e1c5a37..bf45da1a 100644 --- a/lib/Migration/Version002003000Date20220713094721.php +++ b/lib/Migration/Version002003000Date20220713094721.php @@ -3,7 +3,7 @@ * Copyright (c) 2020-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Migration; use Closure; diff --git a/lib/Migration/Version003001000Date20221017094721.php b/lib/Migration/Version003001000Date20221017094721.php index 5ed4df0e..3934dc61 100644 --- a/lib/Migration/Version003001000Date20221017094721.php +++ b/lib/Migration/Version003001000Date20221017094721.php @@ -3,7 +3,7 @@ * Copyright (c) 2020-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Migration; use Closure; diff --git a/lib/Migration/Version003004000Date20230107094721.php b/lib/Migration/Version003004000Date20230107094721.php index b2d0e9d2..69bd562c 100644 --- a/lib/Migration/Version003004000Date20230107094721.php +++ b/lib/Migration/Version003004000Date20230107094721.php @@ -3,7 +3,7 @@ * Copyright (c) 2020-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Migration; use Closure; diff --git a/lib/Service/DownloadModelsService.php b/lib/Service/DownloadModelsService.php index b519f5b2..137a80b1 100644 --- a/lib/Service/DownloadModelsService.php +++ b/lib/Service/DownloadModelsService.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Service; use FilesystemIterator; diff --git a/lib/Service/FaceClusterAnalyzer.php b/lib/Service/FaceClusterAnalyzer.php index 841ef414..11d87948 100644 --- a/lib/Service/FaceClusterAnalyzer.php +++ b/lib/Service/FaceClusterAnalyzer.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Service; use \Rubix\ML\Datasets\Labeled; diff --git a/lib/Service/IgnoreService.php b/lib/Service/IgnoreService.php index 2cbf7d83..96694cce 100644 --- a/lib/Service/IgnoreService.php +++ b/lib/Service/IgnoreService.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Service; use OC\Files\Cache\CacheQueryBuilder; diff --git a/lib/Service/Logger.php b/lib/Service/Logger.php index 5df11502..1346beb7 100644 --- a/lib/Service/Logger.php +++ b/lib/Service/Logger.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Service; use Psr\Log\LoggerInterface; diff --git a/lib/Service/QueueService.php b/lib/Service/QueueService.php index 756e3e60..f5e522e3 100644 --- a/lib/Service/QueueService.php +++ b/lib/Service/QueueService.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Service; use OCA\Recognize\BackgroundJobs\ClassifyFacesJob; diff --git a/lib/Service/StorageService.php b/lib/Service/StorageService.php index 10d80168..304b0013 100644 --- a/lib/Service/StorageService.php +++ b/lib/Service/StorageService.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Service; use OC\Files\Cache\CacheQueryBuilder; diff --git a/lib/Service/TagManager.php b/lib/Service/TagManager.php index 13708b91..21ebd10f 100644 --- a/lib/Service/TagManager.php +++ b/lib/Service/TagManager.php @@ -3,7 +3,7 @@ * Copyright (c) 2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Service; use OCP\SystemTag\ISystemTag; diff --git a/lib/Settings/AdminSection.php b/lib/Settings/AdminSection.php index 7ff1505f..66669eba 100644 --- a/lib/Settings/AdminSection.php +++ b/lib/Settings/AdminSection.php @@ -3,7 +3,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Settings; use OCP\IL10N; diff --git a/lib/Settings/AdminSettings.php b/lib/Settings/AdminSettings.php index 64a954b4..3a6e027b 100644 --- a/lib/Settings/AdminSettings.php +++ b/lib/Settings/AdminSettings.php @@ -3,7 +3,7 @@ * Copyright (c) 2021-2022 The Recognize contributors. * This file is licensed under the Affero General Public License version 3 or later. See the COPYING file. */ - +declare(strict_types=1); namespace OCA\Recognize\Settings; use OCA\Recognize\Service\SettingsService; diff --git a/package-lock.json b/package-lock.json index b6187204..f8c8574f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "recognize", - "version": "4.3.1", + "version": "4.3.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "recognize", - "version": "4.3.1", + "version": "4.3.2", "license": "MIT", "dependencies": { "@exifer/gps": "^1.0.0-beta.2", From cc3507533b671e60549de2d45215e32d93db8bd3 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 2 Sep 2023 12:32:13 +0200 Subject: [PATCH 2/5] Fix(FaceClusterAnalyzer) Type error Signed-off-by: Marcel Klehr --- lib/Service/FaceClusterAnalyzer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/FaceClusterAnalyzer.php b/lib/Service/FaceClusterAnalyzer.php index 11d87948..44fd0f1e 100644 --- a/lib/Service/FaceClusterAnalyzer.php +++ b/lib/Service/FaceClusterAnalyzer.php @@ -48,7 +48,7 @@ public function calculateClusters(string $userId, int $batchSize = 0): void { $this->logger->debug('ClusterDebug: Retrieving face detections for user ' . $userId); if ($batchSize === 0) { - ini_set('memory_limit', -1); + ini_set('memory_limit', '-1'); } From 8203e76a674cac86c147e4283323d6a2d8e64fa1 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 2 Sep 2023 13:07:09 +0200 Subject: [PATCH 3/5] Fix(StorageService) Type error Signed-off-by: Marcel Klehr --- lib/Service/StorageService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/StorageService.php b/lib/Service/StorageService.php index 304b0013..29486f05 100644 --- a/lib/Service/StorageService.php +++ b/lib/Service/StorageService.php @@ -179,7 +179,7 @@ public function getFilesInMount(int $storageId, int $rootId, array $models, int $file = $files->fetch() ) { yield [ - 'fileid' => $file['fileid'], + 'fileid' => (int) $file['fileid'], 'image' => in_array($file['mimetype'], $imageTypes), 'video' => in_array($file['mimetype'], $videoTypes), 'audio' => in_array($file['mimetype'], $audioTypes), From 3f5c528fbeb063a57b818bce9ce9c257c2e2ef00 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 2 Sep 2023 13:11:56 +0200 Subject: [PATCH 4/5] Fix(StorageService) Type error Signed-off-by: Marcel Klehr --- lib/Service/StorageService.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/Service/StorageService.php b/lib/Service/StorageService.php index 29486f05..1c32c100 100644 --- a/lib/Service/StorageService.php +++ b/lib/Service/StorageService.php @@ -174,15 +174,12 @@ public function getFilesInMount(int $storageId, int $rootId, array $models, int return; } - while ( - /** @var array{fileid:int,mimetype:int} $file */ - $file = $files->fetch() - ) { + while ($file = $files->fetch()) { yield [ 'fileid' => (int) $file['fileid'], - 'image' => in_array($file['mimetype'], $imageTypes), - 'video' => in_array($file['mimetype'], $videoTypes), - 'audio' => in_array($file['mimetype'], $audioTypes), + 'image' => in_array((int) $file['mimetype'], $imageTypes), + 'video' => in_array((int) $file['mimetype'], $videoTypes), + 'audio' => in_array((int) $file['mimetype'], $audioTypes), ]; } From 8bda16c00fbff96c858768220e7e02cafcf78ccd Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 2 Sep 2023 13:46:21 +0200 Subject: [PATCH 5/5] Fix(StorageService) Type error Signed-off-by: Marcel Klehr --- lib/Service/StorageService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Service/StorageService.php b/lib/Service/StorageService.php index 1c32c100..2f937358 100644 --- a/lib/Service/StorageService.php +++ b/lib/Service/StorageService.php @@ -174,7 +174,10 @@ public function getFilesInMount(int $storageId, int $rootId, array $models, int return; } - while ($file = $files->fetch()) { + while ( + /** @var array */ + $file = $files->fetch() + ) { yield [ 'fileid' => (int) $file['fileid'], 'image' => in_array((int) $file['mimetype'], $imageTypes),