Skip to content

Commit 58dc48f

Browse files
committed
fix(psalm): Auto-fixes
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 57c15a3 commit 58dc48f

10 files changed

+26
-2
lines changed

lib/AppInfo/Application.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ public function __construct(array $urlParams = []) {
2525
parent::__construct(self::APP_ID, $urlParams);
2626
}
2727

28+
#[\Override]
2829
public function register(IRegistrationContext $context): void {
2930
$context->registerEventListener(LoadAdditionalScriptsEvent::class, FilesLoadAdditionalScriptsListener::class);
3031
$context->registerDashboardWidget(RecommendationWidget::class);
3132
$context->registerCapability(Capabilities::class);
3233
}
3334

35+
#[\Override]
3436
public function boot(IBootContext $context): void {
3537
}
3638
}

lib/Capabilities.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function __construct(
2929
* },
3030
* }
3131
*/
32+
#[\Override]
3233
public function getCapabilities(): array {
3334
$user = $this->userSession->getUser();
3435
if ($user === null) {

lib/Command/GetRecommendations.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function __construct(IUserManager $userManager,
2828
$this->recommendationService = $recommendationService;
2929
}
3030

31+
#[\Override]
3132
protected function configure() {
3233
$this->setName('files:recommendations:recommend');
3334
$this->setDescription('Shows recommended files for an account');
@@ -43,7 +44,8 @@ protected function configure() {
4344
);
4445
}
4546

46-
public function execute(InputInterface $input, OutputInterface $output) {
47+
#[\Override]
48+
public function execute(InputInterface $input, OutputInterface $output): int {
4749
$user = $this->userManager->get(
4850
$input->getArgument('uid')
4951
);

lib/Dashboard/RecommendationWidget.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,37 @@ public function __construct(
4747
$this->userManager = $userManager;
4848
}
4949

50+
#[\Override]
5051
public function getId(): string {
5152
return 'recommendations';
5253
}
5354

55+
#[\Override]
5456
public function getTitle(): string {
5557
return $this->l10n->t('Recommended files');
5658
}
5759

60+
#[\Override]
5861
public function getOrder(): int {
5962
return 0;
6063
}
6164

65+
#[\Override]
6266
public function getIconClass(): string {
6367
return 'icon-files-dark';
6468
}
6569

70+
#[\Override]
6671
public function getIconUrl(): string {
6772
return $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('files', 'app-dark.svg'));
6873
}
6974

75+
#[\Override]
7076
public function getUrl(): ?string {
7177
return null;
7278
}
7379

80+
#[\Override]
7481
public function load(): void {
7582
$user = $this->userSession->getUser();
7683
if ($user === null) {
@@ -79,6 +86,7 @@ public function load(): void {
7986
Util::addScript(Application::APP_ID, 'recommendations-dashboard');
8087
}
8188

89+
#[\Override]
8290
public function getItems(string $userId, ?string $since = null, int $limit = 7): array {
8391
$user = $this->userManager->get($userId);
8492
if (!$user) {

lib/Listeners/FilesLoadAdditionalScriptsListener.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use OCP\Util;
1616

1717
class FilesLoadAdditionalScriptsListener implements IEventListener {
18+
#[\Override]
1819
public function handle(Event $event): void {
1920
if (!$event instanceof LoadAdditionalScriptsEvent) {
2021
return;

lib/Service/RecentlyCommentedFilesSource.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ private function getNMostRecentlyCommenedFiles(array $comments, int $n): array {
131131
/**
132132
* @return IRecommendation[]
133133
*/
134+
#[\Override]
134135
public function getMostRecentRecommendation(IUser $user, int $max): array {
135136
$all = iterator_to_array($this->getAllCommentedFiles($user));
136137

lib/Service/RecentlyEditedFilesSource.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function __construct(IServerContainer $serverContainer,
3232
/**
3333
* @return RecommendedFile[]
3434
*/
35+
#[\Override]
3536
public function getMostRecentRecommendation(IUser $user, int $max): array {
3637
/** @var IRootFolder $rootFolder */
3738
$rootFolder = $this->serverContainer->get(IRootFolder::class);

lib/Service/RecentlySharedFilesSource.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ private function getMostRecentShares(IUser $user, int $max): array {
9393
/**
9494
* @return IRecommendation[]
9595
*/
96+
#[\Override]
9697
public function getMostRecentRecommendation(IUser $user, int $max): array {
9798
$shares = $this->getMostRecentShares($user, $max);
9899
$userFolder = $this->rootFolder->getUserFolder($user->getUID());

lib/Service/RecommendedFile.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function __construct(string $directory,
3333
$this->hasPreview = false;
3434
}
3535

36+
#[\Override]
3637
public function getId(): string {
3738
return (string)$this->node->getId();
3839
}
@@ -41,22 +42,27 @@ public function getDirectory(): string {
4142
return $this->directory;
4243
}
4344

45+
#[\Override]
4446
public function getTimestamp(): int {
4547
return $this->timestamp;
4648
}
4749

50+
#[\Override]
4851
public function getNode(): Node {
4952
return $this->node;
5053
}
5154

55+
#[\Override]
5256
public function getReason(): string {
5357
return $this->reason;
5458
}
5559

60+
#[\Override]
5661
public function hasPreview(): bool {
5762
return $this->hasPreview;
5863
}
5964

65+
#[\Override]
6066
public function setHasPreview(bool $state) {
6167
$this->hasPreview = $state;
6268
}
@@ -65,6 +71,7 @@ public function setHasPreview(bool $state) {
6571
* @return RecommendationsRecommendedFile
6672
*/
6773
#[\ReturnTypeWillChange]
74+
#[\Override]
6875
public function jsonSerialize() {
6976
return [
7077
'id' => $this->getId(),

psalm-baseline.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
2+
<files psalm-version="6.13.1@1e3b7f0a8ab32b23197b91107adc0a7ed8a05b51">
33
<file src="lib/AppInfo/Application.php">
44
<UndefinedClass>
55
<code><![CDATA[LoadAdditionalScriptsEvent]]></code>

0 commit comments

Comments
 (0)