Skip to content

fix: stop using deprecated IAppContainer::getServer() - #2804

Merged
miaulalala merged 1 commit into
masterfrom
fix/drop-deprecated-getserver
Jul 20, 2026
Merged

fix: stop using deprecated IAppContainer::getServer()#2804
miaulalala merged 1 commit into
masterfrom
fix/drop-deprecated-getserver

Conversation

@miaulalala

@miaulalala miaulalala commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • App::getContainer() is now typed as returning Psr\Container\ContainerInterface instead of the deprecated IAppContainer (nextcloud/server@1d55835d39, "refactor: Remove most usages of IAppContainer and IServerContainer"), so psalm flags ->getServer() as undefined on the narrower type in current Renovate PRs bumping nextcloud/ocp.
  • getServer() has been deprecated since Nextcloud 20 anyway, and the app container's get() already resolves core/server services directly (same pattern used throughout DIContainer itself), so it was redundant.
  • Replaced both call sites in registerActivityConsumer() and registerNotifier() with direct $c->get(...) / $this->getContainer()->get(...) calls.

Test plan

  • Ran composer update nextcloud/ocp --with-dependencies to pull the same OCP commit CI uses, then composer run psalm — no errors (previously 3 UndefinedInterfaceMethod/MissingPureAnnotation errors on getServer())
  • CI green on this PR
  • AI assisted

Signed-off-by: Anna Larch <anna@nextcloud.com>
@miaulalala
miaulalala merged commit daa1b78 into master Jul 20, 2026
51 checks passed
@miaulalala
miaulalala deleted the fix/drop-deprecated-getserver branch July 20, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants