fix(ocp): Deprecate isInstalled and add isEnabledForAnyone instead

The method name was really confusing

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2024-12-04 15:41:17 +01:00
parent 6e1d9a2620
commit d2864f7d84
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
2 changed files with 13 additions and 3 deletions

View file

@ -395,10 +395,12 @@ class AppManager implements IAppManager {
* 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]);
}

View file

@ -79,9 +79,17 @@ interface IAppManager {
* @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
*