Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Sep 5, 2024

Summary

This is not fixing all issues in the helper, but at least where possible use the public methods.
For the rest I am not sure what the best solution would be, just ignore? Make the data access public (probably not)...

Checklist

This is not fixing all issues in the helper,
but at least where possible use the public methods.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux added 3. to review Waiting for reviews technical debt labels Sep 5, 2024
@susnux susnux added this to the Nextcloud 31 milestone Sep 5, 2024
if (isset($i['is_share_mount_point'])) {
$entry['isShareMountPoint'] = $i['is_share_mount_point'];
}
if (isset($i['extraData'])) {

Check notice

Code scanning / Psalm

UndefinedInterfaceMethod

Method OCP\Files\FileInfo::offsetGet does not exist
@provokateurin
Copy link
Member

I think you could cast it to the internal type (for safety) and then access the getters from there? It would at least ensure you never call the getters on some other class.

Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

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

Yeah maybe wrap in an if (instanceof) the arrayaccess part, maybe with an else clause logging an error to be safe.
Or clean it up and add getters for this info (or find a way to access it using public API if it exists)

@skjnldsv skjnldsv merged commit f5512ca into master Sep 16, 2024
@skjnldsv skjnldsv deleted the chore/use-public-api-helper branch September 16, 2024 09:21
@skjnldsv skjnldsv mentioned this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants