Merge pull request #25636 from nextcloud/fix/psalm/closure_return_types

Add some closure return types
This commit is contained in:
Christoph Wurst 2021-02-15 12:07:24 +01:00 committed by GitHub
commit 65465b5abc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -117,7 +117,7 @@ class ConfigController extends OCSController {
$highcontrast = [$this->accessibilityProvider->getHighContrast()]; $highcontrast = [$this->accessibilityProvider->getHighContrast()];
$fonts = $this->accessibilityProvider->getFonts(); $fonts = $this->accessibilityProvider->getFonts();
$availableOptions = array_map(function ($option) { $availableOptions = array_map(function ($option): string {
return $option['id']; return $option['id'];
}, array_merge($themes, $highcontrast, $fonts)); }, array_merge($themes, $highcontrast, $fonts));

View File

@ -143,7 +143,7 @@ class Application extends App implements IBootstrap {
} }
}); });
$birthdayListener = function ($event) use ($container) { $birthdayListener = function ($event) use ($container): void {
if ($event instanceof GenericEvent) { if ($event instanceof GenericEvent) {
/** @var BirthdayService $b */ /** @var BirthdayService $b */
$b = $container->query(BirthdayService::class); $b = $container->query(BirthdayService::class);
@ -168,7 +168,7 @@ class Application extends App implements IBootstrap {
} }
}); });
$clearPhotoCache = function ($event) use ($container) { $clearPhotoCache = function ($event) use ($container): void {
if ($event instanceof GenericEvent) { if ($event instanceof GenericEvent) {
/** @var PhotoCache $p */ /** @var PhotoCache $p */
$p = $container->query(PhotoCache::class); $p = $container->query(PhotoCache::class);
@ -240,7 +240,7 @@ class Application extends App implements IBootstrap {
); );
}); });
$listener = function (GenericEvent $event, $eventName) use ($container) { $listener = function (GenericEvent $event, $eventName) use ($container): void {
/** @var Backend $backend */ /** @var Backend $backend */
$backend = $container->query(Backend::class); $backend = $container->query(Backend::class);
@ -336,7 +336,7 @@ class Application extends App implements IBootstrap {
} }
); );
$eventHandler = function () use ($container, $serverContainer) { $eventHandler = function () use ($container, $serverContainer): void {
try { try {
/** @var UpdateCalendarResourcesRoomsBackgroundJob $job */ /** @var UpdateCalendarResourcesRoomsBackgroundJob $job */
$job = $container->query(UpdateCalendarResourcesRoomsBackgroundJob::class); $job = $container->query(UpdateCalendarResourcesRoomsBackgroundJob::class);

View File

@ -399,7 +399,7 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
->where($query->expr()->eq('backend_id', $query->createNamedParameter($backendId))); ->where($query->expr()->eq('backend_id', $query->createNamedParameter($backendId)));
$stmt = $query->execute(); $stmt = $query->execute();
return array_map(function ($row) { return array_map(function ($row): string {
return $row['resource_id']; return $row['resource_id'];
}, $stmt->fetchAll()); }, $stmt->fetchAll());
} }

View File

@ -309,7 +309,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
return $this->isAllowedToAccessResource($row, $usersGroups); return $this->isAllowedToAccessResource($row, $usersGroups);
}); });
$results[] = array_map(function ($row) { $results[] = array_map(function ($row): string {
return $row['uri']; return $row['uri'];
}, $filteredRows); }, $filteredRows);