From 52d098332268c5466d176ea96e5f96c461bd1b11 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Thu, 9 Nov 2023 11:57:48 +0100 Subject: [PATCH] Fix psalm Signed-off-by: Louis Chemineau --- lib/AppInfo/Application.php | 8 ++++---- lib/Listener/AlbumsManagementEventListener.php | 3 +++ .../ExifMetadataProvider.php | 4 ++-- .../OriginalDateTimeMetadataProvider.php | 4 ++-- .../PlaceMetadataProvider.php | 4 ++-- lib/Listener/SabrePluginAuthInitListener.php | 3 +++ .../SizeMetadataProvider.php | 4 ++-- lib/Listener/TagListener.php | 6 +++++- 8 files changed, 23 insertions(+), 13 deletions(-) rename lib/{MetadataProvider => Listener}/ExifMetadataProvider.php (98%) rename lib/{MetadataProvider => Listener}/OriginalDateTimeMetadataProvider.php (96%) rename lib/{MetadataProvider => Listener}/PlaceMetadataProvider.php (95%) rename lib/{MetadataProvider => Listener}/SizeMetadataProvider.php (94%) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 5c4523b72..f65dded0e 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -28,12 +28,12 @@ use OCA\DAV\Connector\Sabre\Principal; use OCA\DAV\Events\SabrePluginAuthInitEvent; use OCA\Photos\Listener\AlbumsManagementEventListener; +use OCA\Photos\Listener\ExifMetadataProvider; +use OCA\Photos\Listener\OriginalDateTimeMetadataProvider; +use OCA\Photos\Listener\PlaceMetadataProvider; use OCA\Photos\Listener\SabrePluginAuthInitListener; +use OCA\Photos\Listener\SizeMetadataProvider; use OCA\Photos\Listener\TagListener; -use OCA\Photos\MetadataProvider\ExifMetadataProvider; -use OCA\Photos\MetadataProvider\OriginalDateTimeMetadataProvider; -use OCA\Photos\MetadataProvider\PlaceMetadataProvider; -use OCA\Photos\MetadataProvider\SizeMetadataProvider; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; diff --git a/lib/Listener/AlbumsManagementEventListener.php b/lib/Listener/AlbumsManagementEventListener.php index 25c1f87af..63b6ce4dc 100644 --- a/lib/Listener/AlbumsManagementEventListener.php +++ b/lib/Listener/AlbumsManagementEventListener.php @@ -15,6 +15,9 @@ use OCP\User\Events\UserDeletedEvent; use Psr\Log\LoggerInterface; +/** + * @template-implements IEventListener + */ class AlbumsManagementEventListener implements IEventListener { private AlbumMapper $albumMapper; private LoggerInterface $logger; diff --git a/lib/MetadataProvider/ExifMetadataProvider.php b/lib/Listener/ExifMetadataProvider.php similarity index 98% rename from lib/MetadataProvider/ExifMetadataProvider.php rename to lib/Listener/ExifMetadataProvider.php index b28440a38..65b9ebd9a 100644 --- a/lib/MetadataProvider/ExifMetadataProvider.php +++ b/lib/Listener/ExifMetadataProvider.php @@ -20,7 +20,7 @@ * */ -namespace OCA\Photos\MetadataProvider; +namespace OCA\Photos\Listener; use OCA\Photos\AppInfo\Application; use OCP\EventDispatcher\Event; @@ -33,7 +33,7 @@ * Extract EXIF, IFD0, and GPS data from a picture file. * EXIF data reference: https://web.archive.org/web/20220428165430/exif.org/Exif2-2.PDF * - * @template-implements IEventListener + * @template-implements IEventListener */ class ExifMetadataProvider implements IEventListener { public function __construct( diff --git a/lib/MetadataProvider/OriginalDateTimeMetadataProvider.php b/lib/Listener/OriginalDateTimeMetadataProvider.php similarity index 96% rename from lib/MetadataProvider/OriginalDateTimeMetadataProvider.php rename to lib/Listener/OriginalDateTimeMetadataProvider.php index 592c75576..4e4f5c020 100644 --- a/lib/MetadataProvider/OriginalDateTimeMetadataProvider.php +++ b/lib/Listener/OriginalDateTimeMetadataProvider.php @@ -20,7 +20,7 @@ * */ -namespace OCA\Photos\MetadataProvider; +namespace OCA\Photos\Listener; use DateTime; use OCA\Photos\AppInfo\Application; @@ -30,7 +30,7 @@ use OCP\FilesMetadata\Event\MetadataLiveEvent; /** - * @template-implements IEventListener + * @template-implements IEventListener */ class OriginalDateTimeMetadataProvider implements IEventListener { public function __construct() { diff --git a/lib/MetadataProvider/PlaceMetadataProvider.php b/lib/Listener/PlaceMetadataProvider.php similarity index 95% rename from lib/MetadataProvider/PlaceMetadataProvider.php rename to lib/Listener/PlaceMetadataProvider.php index 7501b8d20..8bb3c4a6b 100644 --- a/lib/MetadataProvider/PlaceMetadataProvider.php +++ b/lib/Listener/PlaceMetadataProvider.php @@ -20,7 +20,7 @@ */ -namespace OCA\Photos\MetadataProvider; +namespace OCA\Photos\Listener; use OCA\Photos\AppInfo\Application; use OCA\Photos\Service\MediaPlaceManager; @@ -31,7 +31,7 @@ use OCP\FilesMetadata\Event\MetadataLiveEvent; /** - * @template-implements IEventListener + * @template-implements IEventListener */ class PlaceMetadataProvider implements IEventListener { public function __construct( diff --git a/lib/Listener/SabrePluginAuthInitListener.php b/lib/Listener/SabrePluginAuthInitListener.php index 634f1824a..43f62074d 100644 --- a/lib/Listener/SabrePluginAuthInitListener.php +++ b/lib/Listener/SabrePluginAuthInitListener.php @@ -30,6 +30,9 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; +/** + * @template-implements IEventListener + */ class SabrePluginAuthInitListener implements IEventListener { private PublicAlbumAuthBackend $publicAlbumAuthBackend; diff --git a/lib/MetadataProvider/SizeMetadataProvider.php b/lib/Listener/SizeMetadataProvider.php similarity index 94% rename from lib/MetadataProvider/SizeMetadataProvider.php rename to lib/Listener/SizeMetadataProvider.php index f57546a31..fce1663c0 100644 --- a/lib/MetadataProvider/SizeMetadataProvider.php +++ b/lib/Listener/SizeMetadataProvider.php @@ -20,7 +20,7 @@ * */ -namespace OCA\Photos\MetadataProvider; +namespace OCA\Photos\Listener; use OCA\Photos\AppInfo\Application; use OCP\EventDispatcher\Event; @@ -30,7 +30,7 @@ use Psr\Log\LoggerInterface; /** - * @template-implements IEventListener + * @template-implements IEventListener */ class SizeMetadataProvider implements IEventListener { public function __construct( diff --git a/lib/Listener/TagListener.php b/lib/Listener/TagListener.php index 6280909ad..66750c9d0 100644 --- a/lib/Listener/TagListener.php +++ b/lib/Listener/TagListener.php @@ -3,13 +3,17 @@ namespace OCA\Photos\Listener; use OCP\EventDispatcher\Event; +use OCP\EventDispatcher\IEventListener; use OCP\Files\Config\ICachedMountInfo; use OCP\Files\Config\IUserMountCache; use OCP\Files\IRootFolder; use OCP\ICacheFactory; use OCP\SystemTag\MapperEvent; -class TagListener implements \OCP\EventDispatcher\IEventListener { +/** + * @template-implements IEventListener + */ +class TagListener implements IEventListener { private \OCP\ICache $tagCountsCache; private IRootFolder $rootFolder; private IUserMountCache $userMountCache;