nextcloud / nextcloud/server

Public interfaces extending private ones

Open
#36,302 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage technical debt
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
  1. Use IRootFolder within an app
  2. Use the nextcloud/ocp composer package to get public interfaces for code analysis
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.