diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 4aacd19b0..6fe98c393 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -81,7 +81,7 @@ public function __construct() { } public function register(IRegistrationContext $context): void { - $context->registerDashboardWidget(OnThisDay::class); + $context->registerDashboardWidget(OnThisDay::class); /** Register $principalBackend for the DAV collection */ $context->registerServiceAlias('principalBackend', Principal::class); diff --git a/lib/Dashboard/OnThisDay.php b/lib/Dashboard/OnThisDay.php index b3ed0105c..28afc8997 100644 --- a/lib/Dashboard/OnThisDay.php +++ b/lib/Dashboard/OnThisDay.php @@ -1,80 +1,72 @@ l = $l; - $this->url = $url; - $this->initialState = $initialState; - } + public function __construct(\OCP\IL10N $l, \OCP\IURLGenerator $url, IInitialStateService $initialState) { + $this->l = $l; + $this->url = $url; + $this->initialState = $initialState; + } - /** - * @inheritDoc - */ - public function getId(): string - { - return 'photos.onthisday'; - } + /** + * @inheritDoc + */ + public function getId(): string { + return 'photos.onthisday'; + } - /** - * @inheritDoc - */ - public function getTitle(): string - { - return $this->l->t('On This Day'); - } + /** + * @inheritDoc + */ + public function getTitle(): string { + return $this->l->t('On This Day'); + } - /** - * @inheritDoc - */ - public function getOrder(): int - { - return 20; - } + /** + * @inheritDoc + */ + public function getOrder(): int { + return 20; + } - /** - * @inheritDoc - */ - public function getIconClass(): string - { - return 'icon-calendar-dark'; - } + /** + * @inheritDoc + */ + public function getIconClass(): string { + return 'icon-calendar-dark'; + } - /** - * @inheritDoc - */ - public function getUrl(): ?string - { - return $this->url->linkToRoute('photos.page.indexthisday'); - } + /** + * @inheritDoc + */ + public function getUrl(): ?string { + return $this->url->linkToRoute('photos.page.indexthisday'); + } - /** - * @inheritDoc - */ - public function load(): void - { - Util::addScript('photos', 'photos-dashboard'); - $this->initialState->provideInitialState('photos', 'image-mimes', Application::IMAGE_MIMES); - $this->initialState->provideInitialState('photos', 'video-mimes', Application::VIDEO_MIMES); - } + /** + * @inheritDoc + */ + public function load(): void { + Util::addScript('photos', 'photos-dashboard'); + $this->initialState->provideInitialState('photos', 'image-mimes', Application::IMAGE_MIMES); + $this->initialState->provideInitialState('photos', 'video-mimes', Application::VIDEO_MIMES); + } }