Public interfaces extending private ones
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- Nextcloud Server is running on 64bit capable CPU, PHP and OS.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
Some public interfaces extend private interfaces, so static code analysis is not possible using psalm and nextcloud/ocp.
One example: OCP\Files\IRootFolder which extends OC\Hooks\Emitter.
This leads to following psalm error:
OCP\Files\IRootFolder depends on class or interface oc\hooks\emitter that does not exist (see https://psalm.dev/157)
Steps to reproduce
- Use
IRootFolderwithin an app - Use the
nextcloud/ocpcomposer package to get public interfaces for code analysis - Run psalm
Expected behavior
No errors, public interfaces should only depend on other public structures.
Installation method
None
Operating system
None
PHP engine version
None
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
No response
List of activated Apps
-
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting OCP\Files\IRootFolder and its dependency on OC\Hooks\Emitter, then review how the nextcloud/ocp Composer package exposes public interfaces to Psalm. Confirm that public interfaces no longer depend on private structures and reproduce the result by running Psalm against an app using IRootFolder.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100