diff --git a/lib/Controller/PreviewController.php b/lib/Controller/PreviewController.php index c19ea36e0..eb22f2442 100644 --- a/lib/Controller/PreviewController.php +++ b/lib/Controller/PreviewController.php @@ -129,7 +129,12 @@ public function index( } - protected function getFileIdForAlbums($fileId, $albums) { + /** + * @param (\OCA\Photos\Album\AlbumInfo|mixed)[] $albums + * + * @psalm-param array<\OCA\Photos\Album\AlbumInfo|mixed> $albums + */ + protected function getFileIdForAlbums(int $fileId, array $albums) { foreach ($albums as $album) { $albumFile = $this->albumMapper->getForAlbumIdAndFileId($album->getId(), $fileId); $nodes = $this->rootFolder diff --git a/lib/Sabre/Album/AlbumRoot.php b/lib/Sabre/Album/AlbumRoot.php index fe4f03414..4c102ddd7 100644 --- a/lib/Sabre/Album/AlbumRoot.php +++ b/lib/Sabre/Album/AlbumRoot.php @@ -88,9 +88,8 @@ protected function getPhotosLocationInfo() { * * @param string $name * @param null|resource|string $data - * @return void */ - public function createFile($name, $data = null) { + public function createFile($name, $data = null): string { try { [$photosLocation, $userFolder] = $this->getPhotosLocationInfo(); diff --git a/lib/Sabre/PhotosHome.php b/lib/Sabre/PhotosHome.php index 67e6e534f..0b3c966d2 100644 --- a/lib/Sabre/PhotosHome.php +++ b/lib/Sabre/PhotosHome.php @@ -95,7 +95,9 @@ public function getChild($name) { } /** - * @return (AlbumsHome)[] + * @return (AlbumsHome|PlacesHome|SharedAlbumsHome)[] + * + * @psalm-return array{0: AlbumsHome, 1: SharedAlbumsHome, 2: PlacesHome} */ public function getChildren(): array { return [ diff --git a/lib/Sabre/Place/PlaceRoot.php b/lib/Sabre/Place/PlaceRoot.php index 8b4b7c3e1..a09bdfab5 100644 --- a/lib/Sabre/Place/PlaceRoot.php +++ b/lib/Sabre/Place/PlaceRoot.php @@ -36,7 +36,7 @@ use Sabre\DAV\ICollection; class PlaceRoot implements ICollection { - /** @var PlaceFile[]|null */ + /** @var PlacePhoto[]|null */ protected ?array $children = null; public function __construct( @@ -83,7 +83,9 @@ public function createDirectory($name) { } /** - * @return PlacePhoto[] + * @return (PlacePhoto)[] + * + * @psalm-return array */ public function getChildren(): array { if ($this->children === null) { diff --git a/lib/Sabre/PublicRootCollection.php b/lib/Sabre/PublicRootCollection.php index 7eefbf6c5..bbd4783b2 100644 --- a/lib/Sabre/PublicRootCollection.php +++ b/lib/Sabre/PublicRootCollection.php @@ -77,10 +77,8 @@ public function getChildForPrincipal(array $principalInfo): PublicAlbumRoot { * @param string $token * * @throws NotFound - * - * @return DAV\INode */ - public function getChild($token) { + public function getChild($token): PublicAlbumRoot { $this->throttler->sleepDelayOrThrowOnMax($this->request->getRemoteAddress(), self::BRUTEFORCE_ACTION); if (is_null($token)) { diff --git a/lib/Service/ReverseGeoCoderService.php b/lib/Service/ReverseGeoCoderService.php index d7bb79d52..0c69a1258 100644 --- a/lib/Service/ReverseGeoCoderService.php +++ b/lib/Service/ReverseGeoCoderService.php @@ -131,7 +131,7 @@ private function loadCities1000(): array { return $cities; } - public function buildKDTree($force = false): void { + public function buildKDTree(bool $force = false): void { if ($this->geoNameFolder->fileExists('cities1000.bin') && !$force) { return; }