Skip to content

Commit

Permalink
Composer update + phpstan (#2653)
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria authored Nov 5, 2024
1 parent 42b4c20 commit 327475a
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 86 deletions.
5 changes: 4 additions & 1 deletion app/Actions/Photo/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ private function collectLivePhotoPathsByPhotoID(array $photoIDs)

$liveVariantsShortPathsGrouped = $livePhotoShortPaths->groupBy('storage_disk');
$liveVariantsShortPathsGrouped->each(
fn ($liveVariantsShortPaths, $disk) => $this->fileDeleter->addFiles($liveVariantsShortPaths->map(fn ($lv) => $lv->live_photo_short_path), $disk)
fn ($liveVariantsShortPaths, $disk) =>
/** @phpstan-ignore-next-line */
$this->fileDeleter->addFiles($liveVariantsShortPaths->map(fn ($lv) => $lv->live_photo_short_path), $disk)
);
// @codeCoverageIgnoreStart
} catch (\InvalidArgumentException $e) {
Expand Down Expand Up @@ -262,6 +264,7 @@ private function collectLivePhotoPathsByAlbumID(array $albumIDs)

$liveVariantsShortPathsGrouped = $livePhotoShortPaths->groupBy('storage_disk');
$liveVariantsShortPathsGrouped->each(
/** @phpstan-ignore-next-line */
fn ($liveVariantsShortPaths, $disk) => $this->fileDeleter->addFiles($liveVariantsShortPaths->map(fn ($lv) => $lv->live_photo_short_path), $disk)
);
// @codeCoverageIgnoreStart
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Admin/UserManagementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ class UserManagementController extends Controller
*/
public function list(ManagmentListUsersRequest $request, Spaces $spaces): Collection
{
/** @var Collection<int,User> $users */
$users = User::select(['id', 'username', 'may_administrate', 'may_upload', 'may_edit_own_settings', 'quota_kb', 'description', 'note'])->orderBy('id', 'asc')->get();
$spacesPerUser = $spaces->getFullSpacePerUser();
/** @var Collection<int,array{0:User,1:array{id:int,username:string,size:int}}> $zipped */
$zipped = $users->zip($spacesPerUser);

return $zipped->map(fn ($item) => new UserManagementResource($item[0], $item[1], $request->is_se()));
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/StatisticsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function getSpacePerAlbum(SpacePerAlbumRequest $request, Spaces $spaces):
album_id: $albumId,
owner_id: $ownerId);

/** @var Collection<int,array{0:array{id:string,left:int,right:int,size:int},1:array{id:string,username:string,title:string,is_nsfw:bool,left:int,right:int,num_photos:int,num_descendants:int}}> $zipped */
$zipped = $spaceData->zip($countData);

return $zipped->map(fn ($z) => new Album($z[0], $z[1]));
Expand All @@ -90,6 +91,7 @@ public function getTotalSpacePerAlbum(SpacePerAlbumRequest $request, Spaces $spa
album_id: $albumId,
owner_id: $ownerId);

/** @var Collection<int,array{0:array{id:string,left:int,right:int,size:int},1:array{id:string,username:string,title:string,is_nsfw:bool,left:int,right:int,num_photos:int,num_descendants:int}}> $zipped */
$zipped = $spaceData->zip($countData);

return $zipped->map(fn ($z) => new Album($z[0], $z[1]));
Expand Down
4 changes: 2 additions & 2 deletions app/Image/FileDeleter.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public function addSymbolicLinks(Collection $symbolicLinks): void
/**
* Give the possility to add files with their associated storage to the deleter.
*
* @param Collection<int|string,string|null> $paths
* @param string $diskName
* @param Collection<int,string> $paths
* @param string $diskName
*
* @return void
*/
Expand Down
Loading

0 comments on commit 327475a

Please sign in to comment.