Skip to content

refactor(files_versions): add conservative typing and improve Storage phpdoc#59537

Draft
joshtrichards wants to merge 9 commits intomasterfrom
jtr/refactor-versions-Storage-typing
Draft

refactor(files_versions): add conservative typing and improve Storage phpdoc#59537
joshtrichards wants to merge 9 commits intomasterfrom
jtr/refactor-versions-Storage-typing

Conversation

@joshtrichards
Copy link
Copy Markdown
Member

@joshtrichards joshtrichards commented Apr 9, 2026

  • Resolves: #

Summary

Adds conservative type declarations and improves phpdoc in apps/files_versions/lib/Storage.php.

Storage is a legacy static utility class with several mixed-return methods and loosely documented array shapes. This makes the API clearer for readers and static analysis while preserving existing behavior.

What changed

  • added parameter types where inputs are already used consistently
  • added return types within the confines of legacy return contracts
  • improved phpdoc for shaped arrays and nullable/mixed returns

Notes

No functional changes.
Preserves legacy mixed-return behavior in store(), renameOrCopy(), and expire() to ensure compatibility, but this should make future refactoring easier.

TODO

  • ...

Checklist

AI (if applicable)

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

Signed-off-by: Josh <josh.t.richards@gmail.com>
…eter typing

Signed-off-by: Josh <josh.t.richards@gmail.com>
To Storage::getUidAndFilename()

Signed-off-by: Josh <josh.t.richards@gmail.com>
…ge functions

Signed-off-by: Josh <josh.t.richards@gmail.com>
…hapes in Storage

Update/improve docblocks for key functions

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards requested a review from a team as a code owner April 9, 2026 13:26
@joshtrichards joshtrichards requested review from ArtificialOwl, icewind1991, leftybournes and salmart-dev and removed request for a team April 9, 2026 13:26
@joshtrichards joshtrichards added 3. to review Waiting for reviews feature: versions ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) labels Apr 9, 2026
@joshtrichards joshtrichards added this to the Nextcloud 34 milestone Apr 9, 2026
@joshtrichards joshtrichards requested a review from artonge April 9, 2026 13:28
@joshtrichards joshtrichards added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Apr 9, 2026
@joshtrichards joshtrichards marked this pull request as draft April 9, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress feature: versions ♻️ 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.

1 participant