From 456c2dda08b478e067ab2971207505278adbb684 Mon Sep 17 00:00:00 2001 From: nextcloud-command Date: Sun, 24 May 2026 03:20:44 +0000 Subject: [PATCH 1/2] chore(dev-deps): Bump nextcloud/ocp package Signed-off-by: GitHub --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 8073a78b..12ae7b2a 100644 --- a/composer.lock +++ b/composer.lock @@ -234,12 +234,12 @@ "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "07722b9013ea9e57f79d3a75ccc68d4278bd7fd6" + "reference": "4ad82a34a00684e8051bd20e93b364fd07c9f0d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/07722b9013ea9e57f79d3a75ccc68d4278bd7fd6", - "reference": "07722b9013ea9e57f79d3a75ccc68d4278bd7fd6", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/4ad82a34a00684e8051bd20e93b364fd07c9f0d5", + "reference": "4ad82a34a00684e8051bd20e93b364fd07c9f0d5", "shasum": "" }, "require": { @@ -276,7 +276,7 @@ "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/master" }, - "time": "2026-05-15T08:42:57+00:00" + "time": "2026-05-19T02:10:02+00:00" }, { "name": "nikic/php-parser", From bce2537568e217785da200a1b0c22510836dccbf Mon Sep 17 00:00:00 2001 From: Hoang Pham Date: Tue, 26 May 2026 17:15:40 +0700 Subject: [PATCH 2/2] style: Apply PHP CS fixer Signed-off-by: Hoang Pham --- lib/AppInfo/Application.php | 1 - lib/Controller/RecordingController.php | 5 ----- lib/Controller/WhiteboardController.php | 2 -- lib/Listener/AddContentSecurityPolicyListener.php | 1 + lib/Listener/BeforeTemplateRenderedListener.php | 1 - lib/Listener/LoadViewerListener.php | 1 - lib/Listener/RegisterTemplateCreatorListener.php | 2 +- lib/Service/File/GetFileServiceFactory.php | 3 --- lib/Service/JWTService.php | 2 -- lib/Service/WhiteboardContentService.php | 1 - tests/Unit/AppInfo/ApplicationTest.php | 1 - 11 files changed, 2 insertions(+), 18 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 3ca22b1b..59465e70 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -7,7 +7,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ - namespace OCA\Whiteboard\AppInfo; use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent; diff --git a/lib/Controller/RecordingController.php b/lib/Controller/RecordingController.php index 26d9e64c..072acfc2 100644 --- a/lib/Controller/RecordingController.php +++ b/lib/Controller/RecordingController.php @@ -10,7 +10,6 @@ namespace OCA\Whiteboard\Controller; use InvalidArgumentException; - use OCA\Whiteboard\Exception\InvalidUserException; use OCA\Whiteboard\Exception\UnauthorizedException; use OCA\Whiteboard\Model\AuthenticatedUser; @@ -86,8 +85,6 @@ public function recording(int $fileId, string $userId) { } } - - /** * @NoCSRFRequired * @NoAdminRequired @@ -185,8 +182,6 @@ private function validateUploadedFile(): array { return $uploadedFile; } - - /** * @throws NotPermittedException * @throws NotFoundException diff --git a/lib/Controller/WhiteboardController.php b/lib/Controller/WhiteboardController.php index 9f720c09..c16f4473 100644 --- a/lib/Controller/WhiteboardController.php +++ b/lib/Controller/WhiteboardController.php @@ -92,11 +92,9 @@ public function update(int $fileId, array $data): DataResponse { $this->contentService->updateContent($file, $data); return new DataResponse(['status' => 'success']); - } catch (Exception $e) { $this->logger->error('Error syncing whiteboard data: ' . $e->getMessage()); return $this->exceptionService->handleException($e); - } finally { if ($this->cache->get($lockKey) === $lockValue) { $this->cache->remove($lockKey); diff --git a/lib/Listener/AddContentSecurityPolicyListener.php b/lib/Listener/AddContentSecurityPolicyListener.php index 05792b3d..882f55fe 100644 --- a/lib/Listener/AddContentSecurityPolicyListener.php +++ b/lib/Listener/AddContentSecurityPolicyListener.php @@ -5,6 +5,7 @@ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ + namespace OCA\Whiteboard\Listener; use OCA\Whiteboard\Service\ConfigService; diff --git a/lib/Listener/BeforeTemplateRenderedListener.php b/lib/Listener/BeforeTemplateRenderedListener.php index 4616ce1e..71c7b0de 100644 --- a/lib/Listener/BeforeTemplateRenderedListener.php +++ b/lib/Listener/BeforeTemplateRenderedListener.php @@ -7,7 +7,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ - namespace OCA\Whiteboard\Listener; use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent; diff --git a/lib/Listener/LoadViewerListener.php b/lib/Listener/LoadViewerListener.php index eee85f6c..63ad0892 100644 --- a/lib/Listener/LoadViewerListener.php +++ b/lib/Listener/LoadViewerListener.php @@ -7,7 +7,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ - namespace OCA\Whiteboard\Listener; use OCA\Viewer\Event\LoadViewer; diff --git a/lib/Listener/RegisterTemplateCreatorListener.php b/lib/Listener/RegisterTemplateCreatorListener.php index 02adac2c..a319ddf9 100644 --- a/lib/Listener/RegisterTemplateCreatorListener.php +++ b/lib/Listener/RegisterTemplateCreatorListener.php @@ -5,6 +5,7 @@ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ + namespace OCA\Whiteboard\Listener; use OCA\Whiteboard\AppInfo\Application; @@ -31,7 +32,6 @@ public function handle(Event $event): void { return; } - $event->getTemplateManager()->registerTemplateFileCreator(function () { return self::getTemplateFileCreator($this->l10n); }); diff --git a/lib/Service/File/GetFileServiceFactory.php b/lib/Service/File/GetFileServiceFactory.php index dc1e171a..64c60d6d 100644 --- a/lib/Service/File/GetFileServiceFactory.php +++ b/lib/Service/File/GetFileServiceFactory.php @@ -12,7 +12,6 @@ use OCA\Whiteboard\Exception\InvalidUserException; use OCA\Whiteboard\Model\AuthenticatedUser; use OCA\Whiteboard\Model\PublicSharingUser; - use OCA\Whiteboard\Model\User; use OCP\Files\IRootFolder; use OCP\Share\IManager as ShareManager; @@ -40,8 +39,6 @@ public function create(User $user, int $fileId): GetFileService { return new GetFileFromPublicSharingTokenService($this->shareManager, $user->getPublicSharingToken(), $fileId); } - - throw new InvalidUserException(); } } diff --git a/lib/Service/JWTService.php b/lib/Service/JWTService.php index 721df26d..88190b97 100644 --- a/lib/Service/JWTService.php +++ b/lib/Service/JWTService.php @@ -44,8 +44,6 @@ public function generateJWT(User $user, File $file, bool $isFileReadOnly = true) 'exp' => $expirationTime ]; - - return $this->generateJWTFromPayload($payload); } diff --git a/lib/Service/WhiteboardContentService.php b/lib/Service/WhiteboardContentService.php index 5ba88d87..b67c8807 100644 --- a/lib/Service/WhiteboardContentService.php +++ b/lib/Service/WhiteboardContentService.php @@ -97,7 +97,6 @@ public function updateContent(File $file, array $data): void { try { $file->putContent($encodedPayload); return; - } catch (LockedException $e) { if ($attempt === $maxRetries - 1) { $this->logger->error('Whiteboard file write failed after retries', [ diff --git a/tests/Unit/AppInfo/ApplicationTest.php b/tests/Unit/AppInfo/ApplicationTest.php index be02ba36..ed1367c8 100644 --- a/tests/Unit/AppInfo/ApplicationTest.php +++ b/tests/Unit/AppInfo/ApplicationTest.php @@ -7,7 +7,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ - namespace OCA\Whiteboard\AppInfo; class ApplicationTest extends \Test\TestCase {