Skip to content

refactor: Cleanup application namespace handling#59977

Open
come-nc wants to merge 4 commits intomasterfrom
fix/clean-app-namespace-handling
Open

refactor: Cleanup application namespace handling#59977
come-nc wants to merge 4 commits intomasterfrom
fix/clean-app-namespace-handling

Conversation

@come-nc
Copy link
Copy Markdown
Contributor

@come-nc come-nc commented Apr 28, 2026

Summary

Cleanup application namespace handling.

TODO

  • Remove weird tinkering and dead code
  • Move away from static vars and methods to AppManager

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc added this to the Nextcloud 34 milestone Apr 28, 2026
@come-nc come-nc self-assigned this Apr 28, 2026
@come-nc come-nc added 2. developing Work in progress technical debt 🧱 🤔🚀 labels Apr 28, 2026
come-nc added 2 commits April 28, 2026 17:54
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc changed the title refactor: cleanup application namespace handling refactor: Cleanup application namespace handling Apr 28, 2026
@come-nc come-nc marked this pull request as ready for review April 28, 2026 15:57
@come-nc come-nc requested a review from a team as a code owner April 28, 2026 15:57
@come-nc come-nc requested review from Altahrim, icewind1991, leftybournes and salmart-dev and removed request for a team April 28, 2026 15:57
@come-nc come-nc added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 28, 2026
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Copy link
Copy Markdown
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Nice!

The two new methods look very testable 🫣

Comment on lines +1179 to +1180
// If the tag is not found, fall back to uppercasing the first letter
$this->namespaceCache[$appId] = ucfirst($appId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was wondering if that logic makes sense for app IDs with more than one word but this code just moved 👍

Comment on lines +376 to +389

/**
* Get the app namespace
*
* @since 34.0.0
*/
public function getAppNamespace(string $appId): string;

/**
* Get the app id for this namespace
*
* @since 34.0.0
*/
public function getAppFromNamespace(string $className): ?string;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

new public API -> needs docs

@ChristophWurst ChristophWurst added the pending documentation This pull request needs an associated documentation update label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews pending documentation This pull request needs an associated documentation update technical debt 🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants