Skip to content

Commit

Permalink
cs:fix
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr authored and AndyScherzinger committed Mar 19, 2024
1 parent 76668cc commit b587fee
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 66 deletions.
2 changes: 1 addition & 1 deletion lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
122 changes: 57 additions & 65 deletions lib/Dashboard/OnThisDay.php
Original file line number Diff line number Diff line change
@@ -1,80 +1,72 @@
<?php

namespace OCA\Photos\Dashboard;

use OCA\Photos\AppInfo\Application;
use OCP\AppFramework\Services\IInitialState;
use OCP\IInitialStateService;
use OCP\Util;

class OnThisDay implements \OCP\Dashboard\IWidget
{
/**
* @var \OCP\IL10N
*/
private $l;
/**
* @var \OCP\IURLGenerator
*/
private $url;
/**
* @var \OCP\AppFramework\Services\IInitialState
*/
private $initialState;
class OnThisDay implements \OCP\Dashboard\IWidget {
/**
* @var \OCP\IL10N
*/
private $l;
/**
* @var \OCP\IURLGenerator
*/
private $url;
/**
* @var \OCP\AppFramework\Services\IInitialState
*/
private $initialState;

public function __construct(\OCP\IL10N $l, \OCP\IURLGenerator $url, IInitialStateService $initialState)
{
$this->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;

Check failure on line 26 in lib/Dashboard/OnThisDay.php

View workflow job for this annotation

GitHub Actions / Nextcloud

InvalidPropertyAssignmentValue

lib/Dashboard/OnThisDay.php:26:25: InvalidPropertyAssignmentValue: $this->initialState with declared type 'OCP\AppFramework\Services\IInitialState' cannot be assigned type 'OCP\IInitialStateService' (see https://psalm.dev/145)
}

/**
* @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);

Check failure on line 69 in lib/Dashboard/OnThisDay.php

View workflow job for this annotation

GitHub Actions / Nextcloud

TooManyArguments

lib/Dashboard/OnThisDay.php:69:24: TooManyArguments: Too many arguments for method OCP\AppFramework\Services\IInitialState::provideinitialstate - saw 3 (see https://psalm.dev/026)
$this->initialState->provideInitialState('photos', 'video-mimes', Application::VIDEO_MIMES);

Check failure on line 70 in lib/Dashboard/OnThisDay.php

View workflow job for this annotation

GitHub Actions / Nextcloud

TooManyArguments

lib/Dashboard/OnThisDay.php:70:24: TooManyArguments: Too many arguments for method OCP\AppFramework\Services\IInitialState::provideinitialstate - saw 3 (see https://psalm.dev/026)
}
}

0 comments on commit b587fee

Please sign in to comment.