From 5effbf4c9f5750785520ab5953fb2d27d774ee15 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 19 Jun 2026 17:34:19 -0400 Subject: [PATCH 01/13] chore: php-cs fixes and property promotion for Util.php Signed-off-by: Josh --- lib/Service/Util.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/Service/Util.php b/lib/Service/Util.php index 2f025ab79..55dd7f305 100644 --- a/lib/Service/Util.php +++ b/lib/Service/Util.php @@ -13,15 +13,10 @@ use Psr\Log\LoggerInterface; class Util { - public IL10N $l10n; - public LoggerInterface $logger; - public function __construct( - IL10N $l10n, - LoggerInterface $logger, + public IL10N $l10n, + public LoggerInterface $logger, ) { - $this->l10n = $l10n; - $this->logger = $logger; } public static function retryIfLocked(callable $f, int $maxRetries = 5, int $sleep = 1) { From 09c4996b8b60a946f9d5884275737fc29dd42244 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 19 Jun 2026 17:35:55 -0400 Subject: [PATCH 02/13] chore: php-cs style and property promotion for EditorHint.php Signed-off-by: Josh --- lib/Migration/EditorHint.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/Migration/EditorHint.php b/lib/Migration/EditorHint.php index c1ef264c8..31ef04960 100644 --- a/lib/Migration/EditorHint.php +++ b/lib/Migration/EditorHint.php @@ -17,11 +17,10 @@ use OCP\Migration\IRepairStep; class EditorHint implements IRepairStep { - private IConfig $config; - private IUserManager $userManager; - public function __construct(IConfig $config, IUserManager $userManager) { - $this->config = $config; - $this->userManager = $userManager; + public function __construct( + private IConfig $config, + private IUserManager $userManager, + ) { } public function getName() { From 10ba283efed3b156a02e92ac55541a8a879d3b30 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 19 Jun 2026 17:36:50 -0400 Subject: [PATCH 03/13] chore: php-cs and property promo for Cleanup.php Signed-off-by: Josh --- lib/Migration/Cleanup.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/Migration/Cleanup.php b/lib/Migration/Cleanup.php index 028b8d553..1df92d735 100644 --- a/lib/Migration/Cleanup.php +++ b/lib/Migration/Cleanup.php @@ -14,10 +14,7 @@ use OCP\Migration\IRepairStep; class Cleanup implements IRepairStep { - private MetaMapper $metaMapper; - - public function __construct(MetaMapper $metaMapper) { - $this->metaMapper = $metaMapper; + public function __construct(private MetaMapper $metaMapper) { } /* From c23bbbcd72d7bc593c57a2606057be6b99947b65 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 19 Jun 2026 17:39:06 -0400 Subject: [PATCH 04/13] chore: php-cs styling for routes.php Signed-off-by: Josh --- appinfo/routes.php | 1 - 1 file changed, 1 deletion(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index 558315734..cefc4eeb9 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -103,7 +103,6 @@ ], ////////// A T T A C H M E N T S ////////// - [ 'name' => 'notes#getAttachment', 'url' => '/notes/{noteid}/attachment', From e7ad5df980c30a92b4be97889465cba123853be6 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 19 Jun 2026 17:43:17 -0400 Subject: [PATCH 05/13] chore: php-cs styling and const prop promo for NotesService.php Signed-off-by: Josh --- lib/Service/NotesService.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/Service/NotesService.php b/lib/Service/NotesService.php index ece3a69d2..644b61f0c 100644 --- a/lib/Service/NotesService.php +++ b/lib/Service/NotesService.php @@ -16,18 +16,11 @@ use OCP\Files\NotPermittedException; class NotesService { - private MetaService $metaService; - private SettingsService $settings; - private NoteUtil $noteUtil; - public function __construct( - MetaService $metaService, - SettingsService $settings, - NoteUtil $noteUtil, + private MetaService $metaService, + private SettingsService $settings, + private NoteUtil $noteUtil, ) { - $this->metaService = $metaService; - $this->settings = $settings; - $this->noteUtil = $noteUtil; } public function getAll(string $userId, bool $autoCreateNotesFolder = false) : array { @@ -94,6 +87,7 @@ function (Note $note) use ($terms) : bool { } )); } + private function searchTermsInNote(Note $note, array $terms) : bool { try { $d = $note->getData(); @@ -108,6 +102,7 @@ private function searchTermsInNote(Note $note, array $terms) : bool { return false; } } + private function searchTermInData(array $strings, string $term) : bool { foreach ($strings as $str) { if (stripos($str, $term) !== false) { From 90c462482f3ae879c0af0a624c51cea85ed77f0b Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 19 Jun 2026 17:45:53 -0400 Subject: [PATCH 06/13] chore: php-cs styling and const prop promo for PageController.php Signed-off-by: Josh --- lib/Controller/PageController.php | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index cdc3eba38..b4312bd3a 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -33,33 +33,18 @@ use Psr\Log\LoggerInterface; class PageController extends Controller { - private NotesService $notesService; - private IConfig $config; - private IUserSession $userSession; - private IURLGenerator $urlGenerator; - private IEventDispatcher $eventDispatcher; - private IInitialState $initialState; - private LoggerInterface $logger; - public function __construct( string $AppName, IRequest $request, - NotesService $notesService, - IConfig $config, - IUserSession $userSession, - IURLGenerator $urlGenerator, - IEventDispatcher $eventDispatcher, - IInitialState $initialState, - LoggerInterface $logger, + private NotesService $notesService, + private IConfig $config, + private IUserSession $userSession, + private IURLGenerator $urlGenerator, + private IEventDispatcher $eventDispatcher, + private IInitialState $initialState, + private LoggerInterface $logger, ) { parent::__construct($AppName, $request); - $this->notesService = $notesService; - $this->config = $config; - $this->userSession = $userSession; - $this->urlGenerator = $urlGenerator; - $this->eventDispatcher = $eventDispatcher; - $this->initialState = $initialState; - $this->logger = $logger; } /** From 8320ab932f6b1729ff6155c3045deb198ac7ea4e Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 19 Jun 2026 17:46:58 -0400 Subject: [PATCH 07/13] chore: php-cs styling and const prop promo for SettingsController.php Signed-off-by: Josh --- lib/Controller/SettingsController.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 7fc083483..eff410228 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -17,18 +17,13 @@ use OCP\IUserSession; class SettingsController extends Controller { - private SettingsService $service; - private IUserSession $userSession; - public function __construct( string $appName, IRequest $request, - SettingsService $service, - IUserSession $userSession, + private SettingsService $service, + private IUserSession $userSession, ) { parent::__construct($appName, $request); - $this->service = $service; - $this->userSession = $userSession; } private function getUID(): string { From 26bc60020f37d94814cb432d292b716682e4de02 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 19 Jun 2026 17:48:22 -0400 Subject: [PATCH 08/13] chore: php-cs styling and const prop promo for Helper.php Signed-off-by: Josh --- lib/Controller/Helper.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/Controller/Helper.php b/lib/Controller/Helper.php index df5dfd9d5..97b3d10e2 100644 --- a/lib/Controller/Helper.php +++ b/lib/Controller/Helper.php @@ -23,21 +23,12 @@ use Psr\Log\LoggerInterface; class Helper { - private NotesService $notesService; - private MetaService $metaService; - public LoggerInterface $logger; - private IUserSession $userSession; - public function __construct( - NotesService $notesService, - MetaService $metaService, - IUserSession $userSession, - LoggerInterface $logger, + private NotesService $notesService, + private MetaService $metaService, + private IUserSession $userSession, + public LoggerInterface $logger, ) { - $this->notesService = $notesService; - $this->metaService = $metaService; - $this->userSession = $userSession; - $this->logger = $logger; } public function getUID() : string { From 730a9c57d636744e99a778d7e91efb1d2c03b74e Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 19 Jun 2026 17:49:05 -0400 Subject: [PATCH 09/13] chore: php-cs styling and prop promo for ETagDoesNotMatchException Signed-off-by: Josh --- lib/Controller/ETagDoesNotMatchException.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/Controller/ETagDoesNotMatchException.php b/lib/Controller/ETagDoesNotMatchException.php index 44e3c9aec..6ed53001f 100644 --- a/lib/Controller/ETagDoesNotMatchException.php +++ b/lib/Controller/ETagDoesNotMatchException.php @@ -13,9 +13,6 @@ use OCA\Notes\Service\Note; class ETagDoesNotMatchException extends Exception { - public Note $note; - - public function __construct(Note $note) { - $this->note = $note; + public function __construct(public Note $note) { } } From a495917aaac47c2e73ca913ad37b6818404e61fa Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 19 Jun 2026 17:51:14 -0400 Subject: [PATCH 10/13] chore: php-cs styling and const prop promo for NotesApiController Signed-off-by: Josh --- lib/Controller/NotesApiController.php | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/lib/Controller/NotesApiController.php b/lib/Controller/NotesApiController.php index a9a201451..7b176e119 100644 --- a/lib/Controller/NotesApiController.php +++ b/lib/Controller/NotesApiController.php @@ -25,27 +25,16 @@ use OCP\IRequest; class NotesApiController extends ApiController { - private NotesService $service; - private MetaService $metaService; - private SettingsService $settingsService; - private Helper $helper; - private IMimeTypeDetector $mimeTypeDetector; - public function __construct( string $AppName, IRequest $request, - NotesService $service, - MetaService $metaService, - SettingsService $settingsService, - Helper $helper, - IMimeTypeDetector $mimeTypeDetector, + private NotesService $service, + private MetaService $metaService, + private SettingsService $settingsService, + private Helper $helper, + private IMimeTypeDetector $mimeTypeDetector, ) { parent::__construct($AppName, $request); - $this->service = $service; - $this->metaService = $metaService; - $this->settingsService = $settingsService; - $this->helper = $helper; - $this->mimeTypeDetector = $mimeTypeDetector; } /** @@ -316,5 +305,4 @@ public function uploadFile(int $noteid): JSONResponse { ); }); } - } From 353894c7b4639182f5635e562c1a817b21fce5db Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 19 Jun 2026 17:53:37 -0400 Subject: [PATCH 11/13] chore: php-cs styling and const prop promo for NotesController Signed-off-by: Josh --- lib/Controller/NotesController.php | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/lib/Controller/NotesController.php b/lib/Controller/NotesController.php index 9eb9761c2..aed5218fe 100644 --- a/lib/Controller/NotesController.php +++ b/lib/Controller/NotesController.php @@ -28,33 +28,18 @@ use OCP\IRequest; class NotesController extends Controller { - private NotesService $notesService; - private SettingsService $settingsService; - private ILockManager $lockManager; - private Helper $helper; - private IConfig $settings; - private IL10N $l10n; - private IMimeTypeDetector $mimeTypeDetector; - public function __construct( string $AppName, IRequest $request, - NotesService $notesService, - ILockManager $lockManager, - SettingsService $settingsService, - Helper $helper, - IConfig $settings, - IL10N $l10n, - IMimeTypeDetector $mimeTypeDetector, + private NotesService $notesService, + private ILockManager $lockManager, + private SettingsService $settingsService, + private Helper $helper, + private IConfig $settings, + private IL10N $l10n, + private IMimeTypeDetector $mimeTypeDetector, ) { parent::__construct($AppName, $request); - $this->notesService = $notesService; - $this->settingsService = $settingsService; - $this->lockManager = $lockManager; - $this->helper = $helper; - $this->settings = $settings; - $this->l10n = $l10n; - $this->mimeTypeDetector = $mimeTypeDetector; } /** From e9e85d5579e5dc0f4c0982bd51df158c229942b2 Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 20 Jun 2026 11:50:01 -0400 Subject: [PATCH 12/13] chore: make lint happy about ETagDoesNotMatchException Signed-off-by: Josh --- lib/Controller/ETagDoesNotMatchException.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Controller/ETagDoesNotMatchException.php b/lib/Controller/ETagDoesNotMatchException.php index 6ed53001f..079cbe60f 100644 --- a/lib/Controller/ETagDoesNotMatchException.php +++ b/lib/Controller/ETagDoesNotMatchException.php @@ -13,6 +13,8 @@ use OCA\Notes\Service\Note; class ETagDoesNotMatchException extends Exception { - public function __construct(public Note $note) { + public function __construct( + public Note $note, + ) { } } From 656c1112bb261e38f71f988f93ca8ea59f842e9c Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 20 Jun 2026 11:50:38 -0400 Subject: [PATCH 13/13] chore: make lint happy about Cleanup.php Signed-off-by: Josh --- lib/Migration/Cleanup.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Migration/Cleanup.php b/lib/Migration/Cleanup.php index 1df92d735..892e2f5c4 100644 --- a/lib/Migration/Cleanup.php +++ b/lib/Migration/Cleanup.php @@ -14,7 +14,9 @@ use OCP\Migration\IRepairStep; class Cleanup implements IRepairStep { - public function __construct(private MetaMapper $metaMapper) { + public function __construct( + private MetaMapper $metaMapper, + ) { } /*