add constructor property promotion
add return type of methods
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
namespace OCA\SideMenu\Service;
|
||||
|
||||
use OC\User\User;
|
||||
use OCP\INavigationManager;
|
||||
use OCP\L10N\IFactory;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
|
||||
use OCP\IUserSession;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCA\SideMenu\AppInfo\Application;
|
||||
use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use OCP\INavigationManager;
|
||||
use OCP\IUserSession;
|
||||
use OCP\L10N\IFactory;
|
||||
|
||||
/**
|
||||
* class AppRepository.
|
||||
@@ -35,10 +35,8 @@ class AppRepository
|
||||
|
||||
/**
|
||||
* Retrieves visibles apps.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getVisibleApps()
|
||||
public function getVisibleApps(): array
|
||||
{
|
||||
$navigation = $this->navigationManager->getAll();
|
||||
$appCategoriesCustom = $this->config->getAppValueArray('apps-categories-custom', '[]');
|
||||
@@ -99,7 +97,7 @@ class AppRepository
|
||||
return $visibleApps;
|
||||
}
|
||||
|
||||
public function getAppName($app)
|
||||
public function getAppName($app): string
|
||||
{
|
||||
return $this->config->getAppValue(
|
||||
'app.navigation.name',
|
||||
@@ -108,7 +106,7 @@ class AppRepository
|
||||
);
|
||||
}
|
||||
|
||||
public function getOrderedApps(?User $user = null)
|
||||
public function getOrderedApps(?User $user = null): array
|
||||
{
|
||||
$apps = $this->getVisibleApps();
|
||||
$orders = $this->config->getAppValueArray('apps-order', '[]');
|
||||
|
||||
Reference in New Issue
Block a user