-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
docs(api): clarify getNumericStorageId return value in IMountPoint interface #57110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…terface This updates the IMountPoint interface documentation to specify that getNumericStorageId returns -1 if the storage is unavailable, not null, aligning docs with actual implementations. Also aligned documentation language and improved clarity throughout the interface. Signed-off-by: Josh <[email protected]>
Added additional details to the return annotation for clarity. Signed-off-by: Josh <[email protected]>
Signed-off-by: Josh <[email protected]>
provokateurin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| /** | ||
| * Returns the storage backend mounted at this point. | ||
| * | ||
| * Result may be memoized for subsequent calls. | ||
| * | ||
| * @return \OCP\Files\Storage\IStorage|null The mounted storage backend, or null if initialization failed. | ||
| * @since 8.0.0 | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There already is a comment on this method, please replace it instead of adding another one.
| * This integer ID is more efficient for database operations and lookups compared | ||
| * to the string-based storage ID. | ||
| * | ||
| * @return int Numeric storage identifier, or -1 if storage cannot be initialized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could make the type -1|positive-int
| * This is the unique id (from the file cache) of the root entry for the storage mounted at this point. | ||
| * Returns -1 if the storage is not available or has not been scanned yet. | ||
| * | ||
| * @return int File id of the root folder, or -1 if unavailable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
| * with string keys and mixed values. | ||
| * | ||
| * @return array | ||
| * @return array Associative array of mount options (may be empty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be array<string, mixed>.
| * such as in the case of temporary or system mounts. | ||
| * | ||
| * @return int|null mount id or null if not applicable | ||
| * @return int|null Mount point id, or null if not applicable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
positive-int|null
| * The mount provider is the service or class that created and manages this mount | ||
| * (for example, a class handling user homes, external storage, or shared mounts). | ||
| * | ||
| * @return string Fully-qualified class name of the provider, or empty string if the provider is not set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class-string<\OCP\Files\Config\IMountProvider>
CarlSchwan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice improvement :)
| * @return int The numeric storage ID from the oc_storages table, | ||
| * or -1 if the storage is unavailable or failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * @return int The numeric storage ID from the oc_storages table, | |
| * or -1 if the storage is unavailable or failed. | |
| * @return -1|positive-int The numeric storage ID from the oc_storages table, | |
| * or -1 if the storage is unavailable or failed. |
Summary
This updates the IMountPoint interface documentation to specify that getNumericStorageId returns -1 if the storage is unavailable, not null, aligning docs with actual implementations.
Also aligned documentation language and improved clarity throughout the interface.
Found while doing some refactoring for groupfolders.
TODO
Checklist
3. to review, feature component)stable32)