Skip to content

refactor(types): add native parameter and return types to UserSettings#2572

Open
miaulalala wants to merge 1 commit intomasterfrom
refactor/type-safety-usersettings
Open

refactor(types): add native parameter and return types to UserSettings#2572
miaulalala wants to merge 1 commit intomasterfrom
refactor/type-safety-usersettings

Conversation

@miaulalala
Copy link
Copy Markdown
Collaborator

Summary

  • Add native PHP 8.x parameter and return types to all six UserSettings methods (getUserSetting, getAdminSetting, getDefaultSetting, canModifySetting, getNotificationTypes, filterUsersBySetting)
  • Migrate two test mocks from willReturnMap to willReturnCallback so they return a typed default (false / []) instead of null when no map entry matches

Test plan

  • composer test:unit passes (328 tests)

🤖 AI-Assisted-By: Claude Sonnet 4.6 noreply@anthropic.com

All six public/protected methods now carry PHP 8.x native types instead
of relying on docblocks alone.  Two test mocks that used willReturnMap
were migrated to willReturnCallback so they return a typed default
(false / []) instead of null when no entry matches.

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cypress
Copy link
Copy Markdown

cypress Bot commented May 6, 2026

Activity    Run #3710

Run Properties:  status check passed Passed #3710  •  git commit 4514c977b2: refactor(types): add native parameter and return types to UserSettings
Project Activity
Branch Review refactor/type-safety-usersettings
Run status status check passed Passed #3710
Run duration 02m 03s
Commit git commit 4514c977b2: refactor(types): add native parameter and return types to UserSettings
Committer Anna
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 1
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 9
View all changes introduced in this branch ↗︎

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant