Skip to content

chore(Controllers): Modernize controller code - #2351

Merged
marcelklehr merged 18 commits into
masterfrom
chore/modernize2
Feb 14, 2026
Merged

chore(Controllers): Modernize controller code#2351
marcelklehr merged 18 commits into
masterfrom
chore/modernize2

Conversation

@marcelklehr

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request modernizes the controller code in the Bookmarks application by migrating from legacy docblock annotations to PHP 8 attributes and implementing other modern PHP patterns. The changes improve code maintainability and align with current Nextcloud development practices.

Changes:

  • Migrated controller method metadata from docblock annotations (e.g., @NoAdminRequired) to PHP 8 attributes (e.g., #[NoAdminRequired])
  • Moved route definitions from appinfo/routes.php to #[FrontpageRoute] attributes on controller methods
  • Applied constructor property promotion across controllers to reduce boilerplate code
  • Enhanced type hints throughout controller methods and constructors
  • Added improved exception handling with proper try-catch blocks for database operations
  • Removed unused dependencies (e.g., IURLGenerator from BookmarkController)

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
lib/Controller/WebViewController.php Migrated annotations to attributes and added route attributes for all public-facing web views
lib/Controller/TagsController.php Modernized constructor with property promotion, added route attributes, improved exception handling and authorization checks
lib/Controller/SettingsController.php Applied constructor property promotion and migrated to route attributes
lib/Controller/InternalTagsController.php Updated constructor and added route attributes for internal tag operations
lib/Controller/InternalFoldersController.php Modernized with property promotion and route attributes
lib/Controller/InternalBookmarkController.php Converted to use attributes and updated route definitions
lib/Controller/FoldersController.php Comprehensive migration to attributes with route definitions for all folder operations
lib/Controller/BookmarkController.php Major refactoring with constructor property promotion, removed unused IURLGenerator, added route attributes, improved exception handling
lib/Controller/AdminController.php Migrated to route attributes for admin settings
lib/Db/FolderMapper.php Added @throws Exception documentation
lib/AppInfo/Application.php Removed unused service registrations for 'UserId' and 'request'
appinfo/routes.php Removed legacy route definitions (now defined as attributes)
tests/BookmarkControllerTest.php Updated test setup to match new constructor signature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/Controller/FoldersController.php Outdated
Comment thread lib/Controller/InternalFoldersController.php Outdated
Comment thread lib/Controller/FoldersController.php Outdated
Comment thread lib/Controller/FoldersController.php Outdated
Comment thread lib/Controller/FoldersController.php Outdated
Comment thread lib/Controller/InternalTagsController.php Outdated
Comment thread lib/Controller/BookmarkController.php Outdated
Comment thread lib/Controller/BookmarkController.php Outdated
Comment thread lib/Controller/BookmarkController.php Outdated
Comment thread lib/Controller/InternalFoldersController.php Outdated
marcelklehr and others added 5 commits February 13, 2026 17:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>

# Conflicts:
#	lib/Controller/InternalTagsController.php
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr
marcelklehr requested a review from Copilot February 13, 2026 18:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/Controller/BookmarkController.php
Comment thread lib/Controller/FoldersController.php
Comment thread lib/Controller/FoldersController.php Outdated
Comment thread lib/Controller/InternalTagsController.php Outdated
marcelklehr and others added 7 commits February 13, 2026 19:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr
marcelklehr merged commit 34a1c88 into master Feb 14, 2026
52 of 83 checks passed
@marcelklehr
marcelklehr deleted the chore/modernize2 branch February 14, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants