Skip to content

Use constructor properties in Sharing#62335

Merged
provokateurin merged 2 commits into
masterfrom
refactor/sharing/use-constructor-properties
Jul 21, 2026
Merged

Use constructor properties in Sharing#62335
provokateurin merged 2 commits into
masterfrom
refactor/sharing/use-constructor-properties

Conversation

@provokateurin

@provokateurin provokateurin commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

#51803
#62241 (comment)

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
@provokateurin provokateurin added this to the Nextcloud 35 milestone Jul 20, 2026
@provokateurin
provokateurin requested a review from a team as a code owner July 20, 2026 10:05
@provokateurin provokateurin added the 3. to review Waiting for reviews label Jul 20, 2026
@provokateurin
provokateurin requested review from nfebe and removed request for a team July 20, 2026 10:05
@provokateurin provokateurin added the ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) label Jul 20, 2026
@provokateurin provokateurin mentioned this pull request Jul 20, 2026
7 tasks
@provokateurin
provokateurin enabled auto-merge July 20, 2026 10:06
Comment thread core/AppInfo/Application.php
@@ -118,13 +118,13 @@ public function register(IRegistrationContext $context): void {

$registry = Server::get(ISharingRegistry::class);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unrelated nitpick: but I wonder if it would make sense to have IRegistrationContext::getSharingRegistry as an API

@provokateurin
provokateurin merged commit 4ad68f0 into master Jul 21, 2026
251 of 261 checks passed
@provokateurin
provokateurin deleted the refactor/sharing/use-constructor-properties branch July 21, 2026 04:35
@nickvergessen

Copy link
Copy Markdown
Member

This breaks the circles app:

  • Install a server
  • Run occ status
  • Run occ app:enable circles
  • Run occ status
$ occ status
  - installed: true
  - version: 35.0.0.1
  - versionstring: 35.0.0 dev
  - edition: 
  - maintenance: false
  - needsDbUpgrade: false
  - productname: Nextcloud
  - extendedSupport: false

$ occ app:enable circles
circles 35.0.0-dev.0 enabled

$ occ status
Failed to construct console command 'OCA\Circles\Command\MigrateCustomGroups': Could not resolve OCA\Circles\CirclesManager! Class "OCA\Circles\CirclesManager" does not exist
  - installed: true
  - version: 35.0.0.1
  - versionstring: 35.0.0 dev
  - edition: 
  - maintenance: false
  - needsDbUpgrade: false
  - productname: Nextcloud
  - extendedSupport: false

Bisected this and ended up on:

7e3af671a3f6f5cb86dabc7029ee02f4057c2a10 is the first bad commit
commit 7e3af671a3f6f5cb86dabc7029ee02f4057c2a10 (HEAD)
Author: provokateurin <kate@provokateurin.de>
Date:   Mon Jul 20 12:02:39 2026 +0200

    refactor(core): Use constructor properties in Sharing
    
    Signed-off-by: provokateurin <kate@provokateurin.de>

 core/AppInfo/Application.php                                        | 10 +++++-----
 core/Sharing/Permission/ReshareSharePermissionType.php              | 12 +++++-------
 core/Sharing/Property/ExpirationDateSharePropertyType.php           | 29 ++++++++++++-----------------
 core/Sharing/Property/PasswordSharePropertyType.php                 | 18 ++++++------------
 core/Sharing/Recipient/EmailShareRecipientType.php                  | 10 ++++------
 core/Sharing/Recipient/GroupShareRecipientType.php                  | 14 ++++----------
 core/Sharing/Recipient/TeamShareRecipientType.php                   | 14 ++++----------
 core/Sharing/Recipient/TokenShareRecipientType.php                  | 12 +++++-------
 core/Sharing/Recipient/UserShareRecipientType.php                   | 15 +++++----------
 tests/Core/Sharing/Property/ExpirationDateSharePropertyTypeTest.php |  2 +-
 tests/Core/Sharing/Property/PasswordSharePropertyTypeTest.php       |  2 +-
 tests/Core/Sharing/Recipient/EmailShareRecipientTypeTest.php        |  2 +-
 tests/Core/Sharing/Recipient/GroupShareRecipientTypeTest.php        |  2 +-
 tests/Core/Sharing/Recipient/TeamShareRecipientTypeTest.php         |  2 +-
 tests/Core/Sharing/Recipient/TokenShareRecipientTypeTest.php        |  3 ++-
 tests/Core/Sharing/Recipient/UserShareRecipientTypeTest.php         |  2 +-
 tests/lib/Sharing/AbstractSharingManagerTests.php                   |  4 ++--
 17 files changed, 60 insertions(+), 93 deletions(-)

@provokateurin

provokateurin commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants