better name for getAppsEnabledForUser

remotes/origin/log-external-deletes
Robin Appelman 11 years ago
parent 434835b326
commit 04628cf368
  1. 2
      lib/private/app.php
  2. 2
      lib/private/app/appmanager.php
  3. 2
      lib/public/app/iappmanager.php
  4. 2
      tests/lib/app/manager.php

@ -220,7 +220,7 @@ class OC_App {
if (is_null($user)) {
$apps = $appManager->getInstalledApps();
} else {
$apps = $appManager->getAppsEnabledForUser($user);
$apps = $appManager->getEnabledAppsForUser($user);
}
$apps = array_filter($apps, function ($app) {
return $app !== 'files';//we add this manually

@ -76,7 +76,7 @@ class AppManager implements IAppManager {
* @param \OCP\IUser $user
* @return string[]
*/
public function getAppsEnabledForUser(IUser $user) {
public function getEnabledAppsForUser(IUser $user) {
$apps = $this->getInstalledAppsValues();
$appsForUser = array_filter($apps, function ($enabled) use ($user) {
return $this->checkAppForUser($enabled, $user);

@ -57,7 +57,7 @@ interface IAppManager {
* @param \OCP\IUser $user
* @return string[]
*/
public function getAppsEnabledForUser(IUser $user);
public function getEnabledAppsForUser(IUser $user);
/**
* List all installed apps

@ -222,6 +222,6 @@ class Manager extends \PHPUnit_Framework_TestCase {
$appConfig->setValue('test2', 'enabled', 'no');
$appConfig->setValue('test3', 'enabled', '["foo"]');
$appConfig->setValue('test4', 'enabled', '["asd"]');
$this->assertEquals(['test1', 'test3'], $manager->getAppsEnabledForUser($user));
$this->assertEquals(['test1', 'test3'], $manager->getEnabledAppsForUser($user));
}
}

Loading…
Cancel
Save