mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
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:
parent
6e1d9a2620
commit
d2864f7d84
2 changed files with 13 additions and 3 deletions
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue