From d8248cf7bc0bd5d42c6cb397b8412c47f7081c74 Mon Sep 17 00:00:00 2001 From: Josua Hunziker Date: Sat, 21 Sep 2024 13:46:51 +0200 Subject: [PATCH] Switch to new logger implementation (#79) --- CHANGELOG.md | 4 ++++ appinfo/info.xml | 4 ++-- lib/AutoGroupsManager.php | 5 +++-- tests/Unit/AutoGroupsManagerTest.php | 5 +++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e20e45b..6bf5f92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Use PSR Logger Interface (#79) +- Compatibility up to NC31 + ## 1.6.0 - 2024-09-21 ### Changed - Support SAML Logins (#77) - shout out to @elainabialkowski diff --git a/appinfo/info.xml b/appinfo/info.xml index e03bdeb..65cec8b 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -24,7 +24,7 @@ Note that this app prevents group deletions for groups referenced as Auto Groups In addition, I plan to add some more features over time, e.g., "Union Groups" - see the [Milestone Plans](https://github.com/stjosh/auto_groups/milestones) for more details. - 1.6.0 + 1.6.1 agpl Josua Hunziker AutoGroups @@ -34,7 +34,7 @@ In addition, I plan to add some more features over time, e.g., "Union Groups" - https://github.com/stjosh/auto_groups.git https://raw.githubusercontent.com/stjosh/auto_groups/master/screenshots/settings.png - + OCA\AutoGroups\Settings\Admin diff --git a/lib/AutoGroupsManager.php b/lib/AutoGroupsManager.php index a0bbcc5..8aa2dd4 100644 --- a/lib/AutoGroupsManager.php +++ b/lib/AutoGroupsManager.php @@ -36,11 +36,12 @@ use OCP\IGroupManager; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; -use OCP\ILogger; use OCP\IL10N; use OCP\AppFramework\OCS\OCSBadRequestException; +use Psr\Log\LoggerInterface; + class AutoGroupsManager { private $groupManager; @@ -51,7 +52,7 @@ class AutoGroupsManager /** * Listener manager constructor. */ - public function __construct(IGroupManager $groupManager, IEventDispatcher $eventDispatcher, IConfig $config, ILogger $logger, IL10N $l) + public function __construct(IGroupManager $groupManager, IEventDispatcher $eventDispatcher, IConfig $config, LoggerInterface $logger, IL10N $l) { $this->groupManager = $groupManager; $this->logger = $logger; diff --git a/tests/Unit/AutoGroupsManagerTest.php b/tests/Unit/AutoGroupsManagerTest.php index 69550ca..e7e17ff 100644 --- a/tests/Unit/AutoGroupsManagerTest.php +++ b/tests/Unit/AutoGroupsManagerTest.php @@ -35,7 +35,6 @@ use OCP\IGroupManager; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; -use OCP\ILogger; use OCP\IL10N; use OCP\AppFramework\OCS\OCSBadRequestException; @@ -45,6 +44,8 @@ use OCA\AutoGroups\AutoGroupsManager; +use Psr\Log\LoggerInterface; + use Test\TestCase; @@ -63,7 +64,7 @@ protected function setUp(): void $this->groupManager = $this->createMock(IGroupManager::class); $this->eventDispatcher = $this->createMock(IEventDispatcher::class); $this->config = $this->createMock(IConfig::class); - $this->logger = $this->createMock(ILogger::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->il10n = $this->createMock(IL10N::class); $this->testUser = $this->createMock(IUser::class);