aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2021-02-10 21:37:18 +0100
committerGitHub <noreply@github.com>2021-02-10 21:37:18 +0100
commit8a474305fad01db45ec265c5cfcc25ba9a51ec76 (patch)
treef78a1719321bb28cc9e5a96b05ef49cdea3dbc98
parent7bacd710a16ab4ce334aba71e638469f2dad03b5 (diff)
parenta6cd23851792d331d12f97705f03499bd6851e6e (diff)
downloadnextcloud-server-8a474305fad01db45ec265c5cfcc25ba9a51ec76.tar.gz
nextcloud-server-8a474305fad01db45ec265c5cfcc25ba9a51ec76.zip
Merge pull request #25570 from nextcloud/enh/dashboard/psalm_fixes
Some psalm fixes for the DashboardController
-rw-r--r--apps/dashboard/lib/Controller/DashboardController.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php
index 63508f28c83..da8f095d43e 100644
--- a/apps/dashboard/lib/Controller/DashboardController.php
+++ b/apps/dashboard/lib/Controller/DashboardController.php
@@ -36,18 +36,18 @@ use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\NotFoundResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\App\IAppManager;
+use OCP\AppFramework\Services\IInitialState;
use OCP\Dashboard\IManager;
use OCP\Dashboard\IWidget;
use OCP\Dashboard\RegisterWidgetEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
-use OCP\IInitialStateService;
use OCP\IRequest;
class DashboardController extends Controller {
- /** @var IInitialStateService */
- private $inititalStateService;
+ /** @var IInitialState */
+ private $inititalState;
/** @var IEventDispatcher */
private $eventDispatcher;
/** @var IAppManager */
@@ -66,7 +66,7 @@ class DashboardController extends Controller {
public function __construct(
string $appName,
IRequest $request,
- IInitialStateService $initialStateService,
+ IInitialState $initialState,
IEventDispatcher $eventDispatcher,
IAppManager $appManager,
IManager $dashboardManager,
@@ -76,7 +76,7 @@ class DashboardController extends Controller {
) {
parent::__construct($appName, $request);
- $this->inititalStateService = $initialStateService;
+ $this->inititalState = $initialState;
$this->eventDispatcher = $eventDispatcher;
$this->appManager = $appManager;
$this->dashboardManager = $dashboardManager;
@@ -119,14 +119,14 @@ class DashboardController extends Controller {
$themingDefaultBackground = $this->appManager->isEnabledForUser('theming')
? $this->config->getAppValue('theming', 'backgroundMime', '')
: '';
- $this->inititalStateService->provideInitialState('dashboard', 'themingDefaultBackground', $themingDefaultBackground);
- $this->inititalStateService->provideInitialState('dashboard', 'panels', $widgets);
- $this->inititalStateService->provideInitialState('dashboard', 'statuses', $statuses);
- $this->inititalStateService->provideInitialState('dashboard', 'layout', $userLayout);
- $this->inititalStateService->provideInitialState('dashboard', 'firstRun', $this->config->getUserValue($this->userId, 'dashboard', 'firstRun', '1') === '1');
- $this->inititalStateService->provideInitialState('dashboard', 'shippedBackgrounds', BackgroundService::SHIPPED_BACKGROUNDS);
- $this->inititalStateService->provideInitialState('dashboard', 'background', $this->config->getUserValue($this->userId, 'dashboard', 'background', 'default'));
- $this->inititalStateService->provideInitialState('dashboard', 'version', $this->config->getUserValue($this->userId, 'dashboard', 'backgroundVersion', 0));
+ $this->inititalState->provideInitialState('themingDefaultBackground', $themingDefaultBackground);
+ $this->inititalState->provideInitialState('panels', $widgets);
+ $this->inititalState->provideInitialState('statuses', $statuses);
+ $this->inititalState->provideInitialState('layout', $userLayout);
+ $this->inititalState->provideInitialState('firstRun', $this->config->getUserValue($this->userId, 'dashboard', 'firstRun', '1') === '1');
+ $this->inititalState->provideInitialState('shippedBackgrounds', BackgroundService::SHIPPED_BACKGROUNDS);
+ $this->inititalState->provideInitialState('background', $this->config->getUserValue($this->userId, 'dashboard', 'background', 'default'));
+ $this->inititalState->provideInitialState('version', $this->config->getUserValue($this->userId, 'dashboard', 'backgroundVersion', 0));
$this->config->setUserValue($this->userId, 'dashboard', 'firstRun', '0');
$response = new TemplateResponse('dashboard', 'index');
@@ -199,7 +199,7 @@ class DashboardController extends Controller {
* @NoAdminRequired
* @NoCSRFRequired
*/
- public function getBackground() {
+ public function getBackground(): Http\Response {
$file = $this->backgroundService->getBackground();
if ($file !== null) {
$response = new FileDisplayResponse($file, Http::STATUS_OK, ['Content-Type' => $file->getMimeType()]);