refactor(types): add native parameter/return types to Data::get and APIv2Controller#2573
refactor(types): add native parameter/return types to Data::get and APIv2Controller#2573miaulalala wants to merge 2 commits intomasterfrom
Conversation
Activity
|
||||||||||||||||||||||||||||
| Project |
Activity
|
| Branch Review |
refactor/type-safety-data-get
|
| Run status |
|
| Run duration | 03m 51s |
| Commit |
|
| Committer | Anna |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
1
|
|
|
0
|
|
|
9
|
| View all changes introduced in this branch ↗︎ | |
|
Why replace some |
…PIv2Controller - Data::get(): type the 5 previously untyped parameters (string $user, int $since, int $limit, string $sort, string $filter) and add array return type; same for the related setOffsetFromSince() helper - APIv2Controller: replace @var docblock properties with native typed properties, all with sensible defaults matching validateParameters() Three test mocks that relied on null being assignable to untyped IUser::getUID() are updated to return 'testuser' so the string property assignment passes. Signed-off-by: Anna Larch <anna@nextcloud.com> AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
065c38e to
e1c042b
Compare
wdym? |
I meant, in |
|
@copilot resolve the merge conflicts in this pull request |
…y-data-get # Conflicts: # lib/Data.php Co-authored-by: miaulalala <7427347+miaulalala@users.noreply.github.com>
Good catch — I've now added native type annotations to all methods in
Merge conflicts resolved in c5739ef. The conflict in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
Data::get(): type the 5 previously untyped parameters (string $user,int $since,int $limit,string $sort,string $filter) and addarrayreturn type; same treatment for the privatesetOffsetFromSince()helperAPIv2Controller: replace eight/** @var type */docblock properties with native typed properties, each with a sensible default matching whatvalidateParameters()would setTest plan
composer test:unitpasses (328 tests)nullbeing assignable to untyped properties are updated to return a real string fromgetUID()🤖 AI-Assisted-By: Claude Sonnet 4.6 noreply@anthropic.com