From a1bff4a1e1d798badcff819f9f4cbbf374139a3f Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Tue, 7 Oct 2025 15:48:00 +0530 Subject: [PATCH 1/3] Version Bump to NC 31 compatible --- appinfo/info.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index dc8f67f3..f880a30c 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -10,14 +10,14 @@ - 12.0.0 + 13.0.0 agpl Murena SAS EcloudAccounts tools https://gitlab.e.foundation/e/management/issues - + OCA\EcloudAccounts\Settings\DeleteShopAccountSetting -- GitLab From 980432b753d4f65fa6450831ff8993f74cb68ac8 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 9 Oct 2025 00:33:28 +0530 Subject: [PATCH 2/3] Update to Psr\Log\LoggerInterface as OCP\ILogger is depricated --- lib/Command/MapActiveAttributetoLDAP.php | 8 ++++---- lib/Controller/AccountController.php | 16 ++++++++-------- lib/Controller/ShopAccountController.php | 6 +++--- lib/Controller/UserController.php | 6 +++--- lib/Cron/TwoFactorStateChangeJob.php | 8 ++++---- lib/Db/MailUsageMapper.php | 6 +++--- lib/Db/MailboxMapper.php | 6 +++--- lib/Db/WebmailMapper.php | 6 +++--- lib/Listeners/BeforeUserDeletedListener.php | 6 +++--- lib/Listeners/PasswordUpdatedListener.php | 8 ++++---- lib/Listeners/TwoFactorStateChangedListener.php | 8 ++++---- lib/Listeners/UserChangedListener.php | 8 ++++---- lib/Service/NewsLetterService.php | 8 ++++---- lib/Service/SSOService.php | 6 +++--- lib/Service/ShopAccountService.php | 14 ++++++-------- lib/Service/UserService.php | 8 ++++---- lib/Settings/BetaUserSetting.php | 6 +++--- 17 files changed, 66 insertions(+), 68 deletions(-) diff --git a/lib/Command/MapActiveAttributetoLDAP.php b/lib/Command/MapActiveAttributetoLDAP.php index 6d918d92..c8982590 100644 --- a/lib/Command/MapActiveAttributetoLDAP.php +++ b/lib/Command/MapActiveAttributetoLDAP.php @@ -7,7 +7,7 @@ namespace OCA\EcloudAccounts\Command; use Exception; use OCA\EcloudAccounts\AppInfo\Application; use OCA\EcloudAccounts\Service\UserService; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\IUser; use OCP\IUserManager; use Symfony\Component\Console\Command\Command; @@ -18,9 +18,9 @@ class MapActiveAttributetoLDAP extends Command { private OutputInterface $commandOutput; private IUserManager $userManager; private $userService; - private $logger; + private LoggerInterface $logger; - public function __construct(IUserManager $userManager, ILogger $logger, UserService $userService) { + public function __construct(IUserManager $userManager, LoggerInterface $logger, UserService $userService) { $this->userManager = $userManager; $this->userService = $userService; $this->logger = $logger; @@ -42,7 +42,7 @@ class MapActiveAttributetoLDAP extends Command { try { $this->userService->mapActiveAttributesInLDAP($username, $isEnabled); } catch (Exception $e) { - $this->logger->logException('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); + $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); } } }); diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index 8b23dad6..01070958 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -22,7 +22,7 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; use OCP\Files\IAppData; use OCP\IConfig; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\IRequest; use OCP\ISession; use OCP\IURLGenerator; @@ -53,7 +53,7 @@ class AccountController extends Controller { private const HCAPTCHA_DOMAINS = ['https://hcaptcha.com', 'https://*.hcaptcha.com']; private const BLACKLISTED_USERNAMES_FILE_NAME = 'blacklisted_usernames'; - private ILogger $logger; + private LoggerInterface $logger; public function __construct( $AppName, IRequest $request, @@ -66,7 +66,7 @@ class AccountController extends Controller { IURLGenerator $urlGenerator, ISession $session, IConfig $config, - ILogger $logger, + LoggerInterface $logger, IInitialState $initialState, IAppData $appData, ) { @@ -199,7 +199,7 @@ class AccountController extends Controller { $ipAddress = $this->request->getRemoteAddress(); $this->userService->addUsernameToCommonDataStore($username, $ipAddress, $recoveryEmail); } catch (\Throwable $e) { - $this->logger->logException($e, ['app' => Application::APP_ID]); + $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]); } $this->userService->setAccountDataLocally($username, $userEmail); $this->userService->createHMEAlias($username, $userEmail); @@ -222,15 +222,15 @@ class AccountController extends Controller { $response->setData(['success' => true]); } catch (LDAPUserCreationException | Error $e) { - $this->logger->logException($e, ['app' => Application::APP_ID]); + $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]); $response->setData(['message' => 'A server-side error occurred while processing your request! Please try again later.', 'success' => false]); $response->setStatus(500); } catch (RecoveryEmailValidationException $e) { - $this->logger->logException($e, ['app' => Application::APP_ID]); + $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]); $response->setData(['message' => $e->getMessage(), 'success' => false]); $response->setStatus(400); } catch (Exception $e) { - $this->logger->logException($e, ['app' => Application::APP_ID]); + $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]); $response->setData(['message' => 'An error occurred while creating your account!', 'success' => false]); $response->setStatus(500); } @@ -330,7 +330,7 @@ class AccountController extends Controller { $response->setData(['message' => 'Username is already taken.', 'field' => 'username', 'success' => false]); } } catch (Exception $e) { - $this->logger->logException($e, ['app' => Application::APP_ID ]); + $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]); $response->setStatus(500); } diff --git a/lib/Controller/ShopAccountController.php b/lib/Controller/ShopAccountController.php index bba48631..73fb1e24 100644 --- a/lib/Controller/ShopAccountController.php +++ b/lib/Controller/ShopAccountController.php @@ -8,7 +8,7 @@ use Exception; use OCA\EcloudAccounts\Service\ShopAccountService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataResponse; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\IRequest; use OCP\IUserSession; @@ -16,10 +16,10 @@ class ShopAccountController extends Controller { private ShopAccountService $shopAccountService; private IUserSession $userSession; - private ILogger $logger; + private LoggerInterface $logger; - public function __construct($appName, IRequest $request, IUserSession $userSession, ShopAccountService $shopAccountService, ILogger $logger) { + public function __construct($appName, IRequest $request, IUserSession $userSession, ShopAccountService $shopAccountService, LoggerInterface $logger) { parent::__construct($appName, $request); $this->shopAccountService = $shopAccountService; $this->userSession = $userSession; diff --git a/lib/Controller/UserController.php b/lib/Controller/UserController.php index 9871ba50..b9c44b52 100644 --- a/lib/Controller/UserController.php +++ b/lib/Controller/UserController.php @@ -10,7 +10,7 @@ use OCA\EcloudAccounts\Service\UserService; use OCP\AppFramework\ApiController; use OCP\AppFramework\Http\DataResponse; use OCP\IConfig; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\IRequest; use OCP\L10N\IFactory; @@ -20,11 +20,11 @@ class UserController extends ApiController { private $mailUsageMapper; - private $logger; + private LoggerInterface $logger; private $config; protected $l10nFactory; - public function __construct($appName, IRequest $request, ILogger $logger, IConfig $config, UserService $userService, MailUsageMapper $mailUsageMapper, IFactory $l10nFactory) { + public function __construct($appName, IRequest $request, LoggerInterface $logger, IConfig $config, UserService $userService, MailUsageMapper $mailUsageMapper, IFactory $l10nFactory) { parent::__construct($appName, $request); $this->userService = $userService; $this->mailUsageMapper = $mailUsageMapper; diff --git a/lib/Cron/TwoFactorStateChangeJob.php b/lib/Cron/TwoFactorStateChangeJob.php index dbdd32ae..06dede5f 100644 --- a/lib/Cron/TwoFactorStateChangeJob.php +++ b/lib/Cron/TwoFactorStateChangeJob.php @@ -9,7 +9,7 @@ use OCA\EcloudAccounts\Service\SSOService; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJobList; use OCP\BackgroundJob\QueuedJob; -use OCP\ILogger; +use Psr\Log\LoggerInterface; // This class retry 2FA state sync with SSO provider. // It is called from TwoFactorStateChangedListerner when it faced exception on its try. @@ -24,9 +24,9 @@ class TwoFactorStateChangeJob extends QueuedJob { private SSOService $ssoService; private IJobList $jobList; - private ILogger $logger; + private LoggerInterface $logger; - public function __construct(ITimeFactory $time, IJobList $jobList, SSOService $ssoService, ILogger $logger) { + public function __construct(ITimeFactory $time, IJobList $jobList, SSOService $ssoService, LoggerInterface $logger) { parent::__construct($time); $this->jobList = $jobList; @@ -45,7 +45,7 @@ class TwoFactorStateChangeJob extends QueuedJob { $this->ssoService->handle2FAStateChange($enabled, $username); } catch (Exception $e) { if ($tryCount > 2) { - $this->logger->logException($e, ['app' => Application::APP_ID]); + $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]); return; } diff --git a/lib/Db/MailUsageMapper.php b/lib/Db/MailUsageMapper.php index 8b2da108..31dee63f 100644 --- a/lib/Db/MailUsageMapper.php +++ b/lib/Db/MailUsageMapper.php @@ -5,14 +5,14 @@ namespace OCA\EcloudAccounts\Db; use Exception; use OCP\IConfig; use OCP\IDBConnection; -use OCP\ILogger; +use Psr\Log\LoggerInterface; class MailUsageMapper { private $db; private $config; - private $logger; + private LoggerInterface $logger; - public function __construct(IDBConnection $db, IConfig $config, ILogger $logger) { + public function __construct(IDBConnection $db, IConfig $config, LoggerInterface $logger) { $this->db = $db; $this->config = $config; $this->logger = $logger; diff --git a/lib/Db/MailboxMapper.php b/lib/Db/MailboxMapper.php index ff74ab5d..abaeee0f 100644 --- a/lib/Db/MailboxMapper.php +++ b/lib/Db/MailboxMapper.php @@ -5,15 +5,15 @@ namespace OCA\EcloudAccounts\Db; use Doctrine\DBAL\DriverManager; use OCA\EcloudAccounts\Exception\DbConnectionParamsException; use OCP\IConfig; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use Throwable; class MailboxMapper { private $config; private $conn; - private $logger; + private LoggerInterface $logger; - public function __construct(IConfig $config, ILogger $logger) { + public function __construct(IConfig $config, LoggerInterface $logger) { $this->config = $config; $this->logger = $logger; $this->initConnection(); diff --git a/lib/Db/WebmailMapper.php b/lib/Db/WebmailMapper.php index 67e6b3c9..64482fc6 100644 --- a/lib/Db/WebmailMapper.php +++ b/lib/Db/WebmailMapper.php @@ -9,7 +9,7 @@ use OCA\EcloudAccounts\Exception\DbConnectionParamsException; use OCA\SnappyMail\Util\SnappyMailHelper; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IConfig; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\IUser; use OCP\IUserManager; use RainLoop\Providers\AddressBook\PdoAddressBook; @@ -19,7 +19,7 @@ use Throwable; class WebmailMapper { private IConfig $config; - private ILogger $logger; + private LoggerInterface $logger; private Connection $conn; private CardDavBackend $cardDavBackend; private IUserManager $userManager; @@ -28,7 +28,7 @@ class WebmailMapper { private const WEBMAIL_DB_CONFIG_KEY = 'webmail_db'; private const USERS_TABLE = 'rainloop_users'; - public function __construct(IConfig $config, ILogger $logger, CardDavBackend $cardDavBackend, IUserManager $userManager) { + public function __construct(IConfig $config, LoggerInterface $logger, CardDavBackend $cardDavBackend, IUserManager $userManager) { $this->config = $config; $this->logger = $logger; $this->cardDavBackend = $cardDavBackend; diff --git a/lib/Listeners/BeforeUserDeletedListener.php b/lib/Listeners/BeforeUserDeletedListener.php index a2ab5007..ad715c8b 100644 --- a/lib/Listeners/BeforeUserDeletedListener.php +++ b/lib/Listeners/BeforeUserDeletedListener.php @@ -12,17 +12,17 @@ use OCA\EcloudAccounts\Service\UserService; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\IConfig; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\User\Events\BeforeUserDeletedEvent; class BeforeUserDeletedListener implements IEventListener { - private $logger; + private LoggerInterface $logger; private $config; private $LDAPConnectionService; private $shopAccountService; private $userService; - public function __construct(ILogger $logger, IConfig $config, LDAPConnectionService $LDAPConnectionService, UserService $userService, ShopAccountService $shopAccountService) { + public function __construct(LoggerInterface $logger, IConfig $config, LDAPConnectionService $LDAPConnectionService, UserService $userService, ShopAccountService $shopAccountService) { $this->logger = $logger; $this->config = $config; $this->LDAPConnectionService = $LDAPConnectionService; diff --git a/lib/Listeners/PasswordUpdatedListener.php b/lib/Listeners/PasswordUpdatedListener.php index 8d1dd8f8..79662871 100644 --- a/lib/Listeners/PasswordUpdatedListener.php +++ b/lib/Listeners/PasswordUpdatedListener.php @@ -9,7 +9,7 @@ use OCA\EcloudAccounts\AppInfo\Application; use OCA\EcloudAccounts\Service\SSOService; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\ISession; use OCP\IUserSession; use OCP\User\Events\PasswordUpdatedEvent; @@ -18,11 +18,11 @@ class PasswordUpdatedListener implements IEventListener { private SSOService $ssoService; - private ILogger $logger; + private LoggerInterface $logger; private ISession $session; private IUserSession $userSession; - public function __construct(SSOService $ssoService, ILogger $logger, ISession $session, IUserSession $userSession) { + public function __construct(SSOService $ssoService, LoggerInterface $logger, ISession $session, IUserSession $userSession) { $this->ssoService = $ssoService; $this->logger = $logger; $this->session = $session; @@ -44,7 +44,7 @@ class PasswordUpdatedListener implements IEventListener { try { $this->ssoService->logout($username); } catch (Exception $e) { - $this->logger->logException($e, ['app' => Application::APP_ID]); + $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]); } } } diff --git a/lib/Listeners/TwoFactorStateChangedListener.php b/lib/Listeners/TwoFactorStateChangedListener.php index 0ae5e8e3..7c1011fc 100644 --- a/lib/Listeners/TwoFactorStateChangedListener.php +++ b/lib/Listeners/TwoFactorStateChangedListener.php @@ -12,17 +12,17 @@ use OCP\App\IAppManager; use OCP\BackgroundJob\IJobList; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -use OCP\ILogger; +use Psr\Log\LoggerInterface; class TwoFactorStateChangedListener implements IEventListener { private IAppManager $appManager; private SSOService $ssoService; private IJobList $jobList; - private ILogger $logger; + private LoggerInterface $logger; private const TWOFACTOR_APP_ID = 'twofactor_totp'; - public function __construct(IAppManager $appManager, IJobList $jobList, SSOService $ssoService, ILogger $logger) { + public function __construct(IAppManager $appManager, IJobList $jobList, SSOService $ssoService, LoggerInterface $logger) { $this->appManager = $appManager; $this->ssoService = $ssoService; $this->jobList = $jobList; @@ -41,7 +41,7 @@ class TwoFactorStateChangedListener implements IEventListener { try { $this->ssoService->handle2FAStateChange($enabled, $username); } catch (Exception $e) { - $this->logger->logException($e, ['app' => Application::APP_ID]); + $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]); // faced exception. Initiate BG job to retry again. $arguments = [ diff --git a/lib/Listeners/UserChangedListener.php b/lib/Listeners/UserChangedListener.php index d211224e..68a08f9c 100644 --- a/lib/Listeners/UserChangedListener.php +++ b/lib/Listeners/UserChangedListener.php @@ -10,7 +10,7 @@ use OCA\EcloudAccounts\Service\LDAPConnectionService; use OCA\EcloudAccounts\Service\UserService; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\User\Events\UserChangedEvent; use OCP\Util; @@ -20,14 +20,14 @@ class UserChangedListener implements IEventListener { private $util; - private $logger; + private LoggerInterface $logger; private $mailboxMapper; private $userService; private $LDAPConnectionService; - public function __construct(Util $util, ILogger $logger, MailboxMapper $mailboxMapper, UserService $userService, LDAPConnectionService $LDAPConnectionService) { + public function __construct(Util $util, LoggerInterface $logger, MailboxMapper $mailboxMapper, UserService $userService, LDAPConnectionService $LDAPConnectionService) { $this->util = $util; $this->mailboxMapper = $mailboxMapper; $this->logger = $logger; @@ -57,7 +57,7 @@ class UserChangedListener implements IEventListener { try { $this->userService->mapActiveAttributesInLDAP($username, $newValue); } catch (Exception $e) { - $this->logger->logException('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); + $this->logger->error('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); } } } diff --git a/lib/Service/NewsLetterService.php b/lib/Service/NewsLetterService.php index e40b4326..9b84583d 100644 --- a/lib/Service/NewsLetterService.php +++ b/lib/Service/NewsLetterService.php @@ -8,7 +8,7 @@ require __DIR__ . '/../../vendor/autoload.php'; use Exception; use OCP\IConfig; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\IUserManager; class NewsLetterService { @@ -18,10 +18,10 @@ class NewsLetterService { private $config; /** @var CurlService */ private $curl; - /** @var ILogger */ - private $logger; + /** @var LoggerInterface */ + private LoggerInterface $logger; - public function __construct($appName, IUserManager $userManager, IConfig $config, CurlService $curlService, ILogger $logger) { + public function __construct($appName, IUserManager $userManager, IConfig $config, CurlService $curlService, LoggerInterface $logger) { $this->userManager = $userManager; $this->config = $config; $this->curl = $curlService; diff --git a/lib/Service/SSOService.php b/lib/Service/SSOService.php index 03acaf21..792f7418 100644 --- a/lib/Service/SSOService.php +++ b/lib/Service/SSOService.php @@ -9,7 +9,7 @@ use OCA\EcloudAccounts\Exception\SSOAdminAccessTokenException; use OCA\EcloudAccounts\Exception\SSOAdminAPIException; use OCP\ICacheFactory; use OCP\IConfig; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\IUserManager; use OCP\L10N\IFactory; use OCP\Security\ICrypto; @@ -18,7 +18,7 @@ class SSOService { private IConfig $config; private string $appName; private CurlService $curl; - private ILogger $logger; + private LoggerInterface $logger; private array $ssoConfig = []; private string $adminAccessToken = ''; private int $adminAccessTokenExpiresAt = 0; @@ -38,7 +38,7 @@ class SSOService { private const CREDENTIALS_ENDPOINT = '/users/{USER_ID}/credentials'; private const CLIENTS_CACHE_TTL = 6 * 3600; // 6 hours - public function __construct($appName, IConfig $config, CurlService $curlService, ICrypto $crypto, IFactory $l10nFactory, IUserManager $userManager, TwoFactorMapper $twoFactorMapper, ILogger $logger, ICacheFactory $cacheFactory) { + public function __construct($appName, IConfig $config, CurlService $curlService, ICrypto $crypto, IFactory $l10nFactory, IUserManager $userManager, TwoFactorMapper $twoFactorMapper, LoggerInterface $logger, ICacheFactory $cacheFactory) { $this->appName = $appName; $this->config = $config; diff --git a/lib/Service/ShopAccountService.php b/lib/Service/ShopAccountService.php index ce601ca9..cb25ac8f 100644 --- a/lib/Service/ShopAccountService.php +++ b/lib/Service/ShopAccountService.php @@ -6,13 +6,13 @@ namespace OCA\EcloudAccounts\Service; use Exception; use OCA\EcloudAccounts\AppInfo\Application; use OCP\IConfig; -use OCP\ILogger; +use Psr\Log\LoggerInterface; class ShopAccountService { private IConfig $config; private string $appName; private CurlService $curl; - private ILogger $logger; + private LoggerInterface $logger; private array $shops = []; private const OIDC_USERS_ENDPOINT = '/wp-json/openid-connect-generic/users/get_by_email'; @@ -21,7 +21,7 @@ class ShopAccountService { private const MULTISITE_KEY = 'is_multisite'; private const MULTISITE_DELETE_USERS_ENDPOINT = '/wp-json/wp/v2/multisite/users'; - public function __construct($appName, IConfig $config, CurlService $curlService, ILogger $logger) { + public function __construct($appName, IConfig $config, CurlService $curlService, LoggerInterface $logger) { $this->config = $config; $this->appName = $appName; @@ -89,7 +89,7 @@ class ShopAccountService { return $users; } catch (Exception $e) { - $this->logger->logException($e, ['app' => Application::APP_ID]); + $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => Application::APP_ID]); return null; } } @@ -127,8 +127,7 @@ class ShopAccountService { throw new Exception('Unknown error while deleting!'); } } catch (Exception $e) { - $this->logger->error('Error deleting user at WP with ID ' . $userId); - $this->logger->logException($e, ['app' => Application::APP_ID]); + $this->logger->error('Error deleting user at WP with ID ' . $userId, ['exception' => $e, 'app' => Application::APP_ID]); } } @@ -148,8 +147,7 @@ class ShopAccountService { throw new Exception('Unknown error while updating!'); } } catch (Exception $e) { - $this->logger->error('Error updating user email at WP with ID ' . $userId . ' and new email ' . $email); - $this->logger->logException($e, ['app' => Application::APP_ID]); + $this->logger->error('Error updating user email at WP with ID ' . $userId . ' and new email ' . $email, ['exception' => $e, 'app' => Application::APP_ID]); } } diff --git a/lib/Service/UserService.php b/lib/Service/UserService.php index 04966466..a6cd0e16 100644 --- a/lib/Service/UserService.php +++ b/lib/Service/UserService.php @@ -14,7 +14,7 @@ use OCA\EcloudAccounts\Exception\LDAPUserCreationException; use OCP\Defaults; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\IUser; use OCP\IUserManager; use OCP\L10N\IFactory; @@ -33,8 +33,8 @@ class UserService { private $curl; /** @var Defaults */ private $defaults; - /** @var ILogger */ - private $logger; + /** @var LoggerInterface */ + private LoggerInterface $logger; /** @var IFactory */ protected $l10nFactory; /** @var array */ @@ -42,7 +42,7 @@ class UserService { /** @var LDAPConnectionService */ private $LDAPConnectionService; private IEventDispatcher $dispatcher; - public function __construct($appName, IUserManager $userManager, IConfig $config, CurlService $curlService, ILogger $logger, Defaults $defaults, IFactory $l10nFactory, LDAPConnectionService $LDAPConnectionService, IEventDispatcher $dispatcher) { + public function __construct($appName, IUserManager $userManager, IConfig $config, CurlService $curlService, LoggerInterface $logger, Defaults $defaults, IFactory $l10nFactory, LDAPConnectionService $LDAPConnectionService, IEventDispatcher $dispatcher) { $this->userManager = $userManager; $this->config = $config; $this->appConfig = $this->config->getSystemValue($appName); diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php index 2703f87f..e41a1a74 100644 --- a/lib/Settings/BetaUserSetting.php +++ b/lib/Settings/BetaUserSetting.php @@ -9,12 +9,12 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; use OCP\IConfig; use OCP\IGroupManager; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use OCP\Settings\ISettings; class BetaUserSetting implements ISettings { protected $groupManager; - private $logger; + private LoggerInterface $logger; private $initialState; private $config; private $appName; @@ -24,7 +24,7 @@ class BetaUserSetting implements ISettings { $appName, IGroupManager $groupManager, IConfig $config, - ILogger $logger, + LoggerInterface $logger, IInitialState $initialState, BetaUserService $betaUserService ) { -- GitLab From c824f5335f5d2b4ffe8a59ba5f0a673e15655176 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 9 Oct 2025 00:37:17 +0530 Subject: [PATCH 3/3] PHP lint:fix --- lib/Command/MapActiveAttributetoLDAP.php | 2 +- lib/Controller/AccountController.php | 2 +- lib/Controller/ShopAccountController.php | 2 +- lib/Controller/UserController.php | 2 +- lib/Db/WebmailMapper.php | 2 +- lib/Listeners/BeforeUserDeletedListener.php | 2 +- lib/Listeners/PasswordUpdatedListener.php | 2 +- lib/Listeners/UserChangedListener.php | 2 +- lib/Service/NewsLetterService.php | 2 +- lib/Service/SSOService.php | 2 +- lib/Service/UserService.php | 2 +- lib/Settings/BetaUserSetting.php | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/Command/MapActiveAttributetoLDAP.php b/lib/Command/MapActiveAttributetoLDAP.php index c8982590..073ee9c0 100644 --- a/lib/Command/MapActiveAttributetoLDAP.php +++ b/lib/Command/MapActiveAttributetoLDAP.php @@ -7,9 +7,9 @@ namespace OCA\EcloudAccounts\Command; use Exception; use OCA\EcloudAccounts\AppInfo\Application; use OCA\EcloudAccounts\Service\UserService; -use Psr\Log\LoggerInterface; use OCP\IUser; use OCP\IUserManager; +use Psr\Log\LoggerInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/lib/Controller/AccountController.php b/lib/Controller/AccountController.php index 01070958..b9e0d16b 100644 --- a/lib/Controller/AccountController.php +++ b/lib/Controller/AccountController.php @@ -22,12 +22,12 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; use OCP\Files\IAppData; use OCP\IConfig; -use Psr\Log\LoggerInterface; use OCP\IRequest; use OCP\ISession; use OCP\IURLGenerator; use OCP\IUserSession; use OCP\L10N\IFactory; +use Psr\Log\LoggerInterface; class AccountController extends Controller { protected $appName; diff --git a/lib/Controller/ShopAccountController.php b/lib/Controller/ShopAccountController.php index 73fb1e24..fcaf9159 100644 --- a/lib/Controller/ShopAccountController.php +++ b/lib/Controller/ShopAccountController.php @@ -8,9 +8,9 @@ use Exception; use OCA\EcloudAccounts\Service\ShopAccountService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataResponse; -use Psr\Log\LoggerInterface; use OCP\IRequest; use OCP\IUserSession; +use Psr\Log\LoggerInterface; class ShopAccountController extends Controller { private ShopAccountService $shopAccountService; diff --git a/lib/Controller/UserController.php b/lib/Controller/UserController.php index b9c44b52..1fd0d683 100644 --- a/lib/Controller/UserController.php +++ b/lib/Controller/UserController.php @@ -10,9 +10,9 @@ use OCA\EcloudAccounts\Service\UserService; use OCP\AppFramework\ApiController; use OCP\AppFramework\Http\DataResponse; use OCP\IConfig; -use Psr\Log\LoggerInterface; use OCP\IRequest; use OCP\L10N\IFactory; +use Psr\Log\LoggerInterface; class UserController extends ApiController { /** @var UserService */ diff --git a/lib/Db/WebmailMapper.php b/lib/Db/WebmailMapper.php index 64482fc6..fdc3bbd8 100644 --- a/lib/Db/WebmailMapper.php +++ b/lib/Db/WebmailMapper.php @@ -9,9 +9,9 @@ use OCA\EcloudAccounts\Exception\DbConnectionParamsException; use OCA\SnappyMail\Util\SnappyMailHelper; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IConfig; -use Psr\Log\LoggerInterface; use OCP\IUser; use OCP\IUserManager; +use Psr\Log\LoggerInterface; use RainLoop\Providers\AddressBook\PdoAddressBook; use Sabre\VObject\UUIDUtil; diff --git a/lib/Listeners/BeforeUserDeletedListener.php b/lib/Listeners/BeforeUserDeletedListener.php index ad715c8b..a33c760f 100644 --- a/lib/Listeners/BeforeUserDeletedListener.php +++ b/lib/Listeners/BeforeUserDeletedListener.php @@ -12,8 +12,8 @@ use OCA\EcloudAccounts\Service\UserService; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\IConfig; -use Psr\Log\LoggerInterface; use OCP\User\Events\BeforeUserDeletedEvent; +use Psr\Log\LoggerInterface; class BeforeUserDeletedListener implements IEventListener { private LoggerInterface $logger; diff --git a/lib/Listeners/PasswordUpdatedListener.php b/lib/Listeners/PasswordUpdatedListener.php index 79662871..c3193640 100644 --- a/lib/Listeners/PasswordUpdatedListener.php +++ b/lib/Listeners/PasswordUpdatedListener.php @@ -9,10 +9,10 @@ use OCA\EcloudAccounts\AppInfo\Application; use OCA\EcloudAccounts\Service\SSOService; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -use Psr\Log\LoggerInterface; use OCP\ISession; use OCP\IUserSession; use OCP\User\Events\PasswordUpdatedEvent; +use Psr\Log\LoggerInterface; class PasswordUpdatedListener implements IEventListener { diff --git a/lib/Listeners/UserChangedListener.php b/lib/Listeners/UserChangedListener.php index 68a08f9c..f720dc38 100644 --- a/lib/Listeners/UserChangedListener.php +++ b/lib/Listeners/UserChangedListener.php @@ -10,9 +10,9 @@ use OCA\EcloudAccounts\Service\LDAPConnectionService; use OCA\EcloudAccounts\Service\UserService; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -use Psr\Log\LoggerInterface; use OCP\User\Events\UserChangedEvent; use OCP\Util; +use Psr\Log\LoggerInterface; class UserChangedListener implements IEventListener { private const QUOTA_FEATURE = 'quota'; diff --git a/lib/Service/NewsLetterService.php b/lib/Service/NewsLetterService.php index 9b84583d..3aca33a6 100644 --- a/lib/Service/NewsLetterService.php +++ b/lib/Service/NewsLetterService.php @@ -8,8 +8,8 @@ require __DIR__ . '/../../vendor/autoload.php'; use Exception; use OCP\IConfig; -use Psr\Log\LoggerInterface; use OCP\IUserManager; +use Psr\Log\LoggerInterface; class NewsLetterService { /** @var IUserManager */ diff --git a/lib/Service/SSOService.php b/lib/Service/SSOService.php index 792f7418..76d77a29 100644 --- a/lib/Service/SSOService.php +++ b/lib/Service/SSOService.php @@ -9,10 +9,10 @@ use OCA\EcloudAccounts\Exception\SSOAdminAccessTokenException; use OCA\EcloudAccounts\Exception\SSOAdminAPIException; use OCP\ICacheFactory; use OCP\IConfig; -use Psr\Log\LoggerInterface; use OCP\IUserManager; use OCP\L10N\IFactory; use OCP\Security\ICrypto; +use Psr\Log\LoggerInterface; class SSOService { private IConfig $config; diff --git a/lib/Service/UserService.php b/lib/Service/UserService.php index a6cd0e16..b2962bf1 100644 --- a/lib/Service/UserService.php +++ b/lib/Service/UserService.php @@ -14,11 +14,11 @@ use OCA\EcloudAccounts\Exception\LDAPUserCreationException; use OCP\Defaults; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; -use Psr\Log\LoggerInterface; use OCP\IUser; use OCP\IUserManager; use OCP\L10N\IFactory; use OCP\Util; +use Psr\Log\LoggerInterface; use Throwable; use UnexpectedValueException; diff --git a/lib/Settings/BetaUserSetting.php b/lib/Settings/BetaUserSetting.php index e41a1a74..4449ecef 100644 --- a/lib/Settings/BetaUserSetting.php +++ b/lib/Settings/BetaUserSetting.php @@ -9,8 +9,8 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; use OCP\IConfig; use OCP\IGroupManager; -use Psr\Log\LoggerInterface; use OCP\Settings\ISettings; +use Psr\Log\LoggerInterface; class BetaUserSetting implements ISettings { protected $groupManager; -- GitLab