Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify app manager method names #49648

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(ocp): Deprecate isInstalled and add isEnabledForAnyone instead
The method name was really confusing

Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Dec 4, 2024
commit 3f51e566258f4ff82d528d1aced953d7808bc13a
8 changes: 5 additions & 3 deletions lib/private/App/AppManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,12 @@ private function checkAppForGroups(string $enabled, IGroup $group): bool {
* Notice: This actually checks if the app is enabled and not only if it is installed.
*
* @param string $appId
* @param IGroup[]|String[] $groups
* @return bool
*/
public function isInstalled($appId) {
public function isInstalled($appId): bool {
return $this->isEnabledForAnyone($appId);
}

public function isEnabledForAnyone(string $appId): bool {
$installedApps = $this->getInstalledAppsValues();
return isset($installedApps[$appId]);
}
Expand Down
8 changes: 8 additions & 0 deletions lib/public/App/IAppManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,17 @@ public function isEnabledForUser($appId, $user = null);
* @param string $appId
* @return bool
* @since 8.0.0
* @deprecated 31.0.0 Use either {@see self::isEnabledForUser} or {@see self::isEnabledForAnyone}
*/
public function isInstalled($appId);

/**
* Check if an app is enabled in the instance, either for everyone or for specific groups
*
* @since 31.0.0
*/
public function isEnabledForAnyone(string $appId): bool;

/**
* Check if an app should be enabled by default
*
Expand Down