diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-02-08 13:29:57 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-03-20 10:21:45 +0100 |
commit | 13c71ed24a4f30dd3dfb04bd09f16648fb4fe080 (patch) | |
tree | 2593ce5ec8cca788c25787af6c6ffa66ec58fe7e /lib | |
parent | 78c17168185c21b6b788e40602f95c690fe441f9 (diff) | |
download | nextcloud-server-13c71ed24a4f30dd3dfb04bd09f16648fb4fe080.tar.gz nextcloud-server-13c71ed24a4f30dd3dfb04bd09f16648fb4fe080.zip |
Small cleanups for AppManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/AppManager.php | 4 | ||||
-rw-r--r-- | lib/private/legacy/OC_App.php | 4 | ||||
-rw-r--r-- | lib/public/App/IAppManager.php | 1 |
3 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index d969f1d0260..5f243a1250e 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -237,7 +237,7 @@ class AppManager implements IAppManager { public function isType(string $app, array $types): bool { $appTypes = $this->getAppTypes($app); foreach ($types as $type) { - if (array_search($type, $appTypes) !== false) { + if (in_array($type, $appTypes, true)) { return true; } } @@ -253,7 +253,7 @@ class AppManager implements IAppManager { private function getAppTypes(string $app): array { //load the cache if (count($this->appTypes) === 0) { - $this->appTypes = \OC::$server->getAppConfig()->getValues(false, 'types'); + $this->appTypes = $this->appConfig->getValues(false, 'types') ?: []; } if (isset($this->appTypes[$app])) { diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index 5d7941ffa3f..5051d3e7ab5 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -98,6 +98,7 @@ class OC_App { * * @param string $app * @return bool + * @deprecated 26.0.0 use IAppManager::isAppLoaded */ public static function isAppLoaded(string $app): bool { return \OC::$server->get(IAppManager::class)->isAppLoaded($app); @@ -128,6 +129,7 @@ class OC_App { * * @param string $app * @throws Exception + * @deprecated 26.0.0 use IAppManager::loadApp */ public static function loadApp(string $app): void { \OC::$server->get(IAppManager::class)->loadApp($app); @@ -169,7 +171,7 @@ class OC_App { * @param string $app * @param array $types * @return bool - * @deprecated 26.0.0 call \OC::$server->get(IAppManager::class)->isType($app, $types) + * @deprecated 26.0.0 use IAppManager::isType */ public static function isType(string $app, array $types): bool { return \OC::$server->get(IAppManager::class)->isType($app, $types); diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php index 5387e104fd9..faaf871a74c 100644 --- a/lib/public/App/IAppManager.php +++ b/lib/public/App/IAppManager.php @@ -207,6 +207,7 @@ interface IAppManager { * exists. * * if $types is set to non-empty array, only apps of those types will be loaded + * @since 26.0.0 */ public function loadApps(array $types = []): bool; |